def secant_bulk_modulus(s, t, p):
    """Secant bulk modulus according to Fofonoff, P. and R. C. Millard Jr (1983): Algorithms for computation of
    fundamental properties of seawater. Equation 15
    :param s:
    :param t:
    :param p:
    :return:
    """
    k0 = 8.50935E-5
    k1 = -6.12293E-6
    k2 = 5.2787E-8
    bw = k0 + (k1 + (k2 * t)) * t

    h0 = 3.239908
    h1 = 1.43713E-3
    h2 = 1.16092E-4
    h3 = -5.77905E-7
    aw = h0 + (h1 + (h2 + h3 * t) * t) * t

    e0 = 19652.21
    e1 = 148.4206
    e2 = -2.327105
    e3 = 1.360477E-2
    e4 = -5.155288E-5
    kw = e0 + (e1 + (e2 + (e3 + e4 * t ) * t ) * t ) * t  # eq. 19

    m0 = -9.9348E-7
    m1 = 2.0816E-8
    m2 = 9.1697E-10
    b = bw + (m0 + m1 * t + m2 * t * t) * s  # eq. 18

    i0 = 2.2838E-3
    i1 = -1.0981E-5
    i2 = -1.6078E-6
    j0 = 1.91075E-4
    a = aw + (i0 + i1 * t + i2 * t * t) * s + j0 * (s ** 1.5)  # eq. 17

    f0 = 54.6746
    f1 = -0.603459
    f2 = 1.09987E-2
    f3 = -6.1670E-5
    g0 = 7.944E-2
    g1 = 1.6483E-2
    g2 = -5.3009E-4
    k0 = kw + (f0 + (f1 + (f2 + (f3 * t) * t) * t) * t) * s + (g0 + g1 * t + g2 * t * t) * (s ** 1.5)  # eq. 16

    return k0 + (a + b * p) * p