
(FPCore (x y z t a b) :precision binary64 (- (* (* 2.0 (sqrt x)) (cos (- y (/ (* z t) 3.0)))) (/ a (* b 3.0))))
double code(double x, double y, double z, double t, double a, double b) {
return ((2.0 * sqrt(x)) * cos((y - ((z * t) / 3.0)))) - (a / (b * 3.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((2.0d0 * sqrt(x)) * cos((y - ((z * t) / 3.0d0)))) - (a / (b * 3.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((2.0 * Math.sqrt(x)) * Math.cos((y - ((z * t) / 3.0)))) - (a / (b * 3.0));
}
def code(x, y, z, t, a, b): return ((2.0 * math.sqrt(x)) * math.cos((y - ((z * t) / 3.0)))) - (a / (b * 3.0))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(2.0 * sqrt(x)) * cos(Float64(y - Float64(Float64(z * t) / 3.0)))) - Float64(a / Float64(b * 3.0))) end
function tmp = code(x, y, z, t, a, b) tmp = ((2.0 * sqrt(x)) * cos((y - ((z * t) / 3.0)))) - (a / (b * 3.0)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(2.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(y - N[(N[(z * t), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(a / N[(b * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z \cdot t}{3}\right) - \frac{a}{b \cdot 3}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (- (* (* 2.0 (sqrt x)) (cos (- y (/ (* z t) 3.0)))) (/ a (* b 3.0))))
double code(double x, double y, double z, double t, double a, double b) {
return ((2.0 * sqrt(x)) * cos((y - ((z * t) / 3.0)))) - (a / (b * 3.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((2.0d0 * sqrt(x)) * cos((y - ((z * t) / 3.0d0)))) - (a / (b * 3.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((2.0 * Math.sqrt(x)) * Math.cos((y - ((z * t) / 3.0)))) - (a / (b * 3.0));
}
def code(x, y, z, t, a, b): return ((2.0 * math.sqrt(x)) * math.cos((y - ((z * t) / 3.0)))) - (a / (b * 3.0))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(2.0 * sqrt(x)) * cos(Float64(y - Float64(Float64(z * t) / 3.0)))) - Float64(a / Float64(b * 3.0))) end
function tmp = code(x, y, z, t, a, b) tmp = ((2.0 * sqrt(x)) * cos((y - ((z * t) / 3.0)))) - (a / (b * 3.0)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(2.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(y - N[(N[(z * t), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(a / N[(b * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z \cdot t}{3}\right) - \frac{a}{b \cdot 3}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* 2.0 (sqrt x)) (cos (- y (/ (* z t) 3.0)))))
(t_2 (* (* t z) -0.3333333333333333)))
(if (<= t_1 2e+37)
(/
(fma
-0.3333333333333333
a
(*
2.0
(*
(*
b
(-
(* (cos y) (sin (fma -0.3333333333333333 (* t z) (/ PI 2.0))))
(* (sin y) (sin (* -0.3333333333333333 (* t z))))))
(pow x 0.5))))
b)
(if (<= t_1 4e+150)
(*
(fma
(* 2.0 (pow (pow x -1.0) 0.5))
(- (* (cos t_2) (cos y)) (* (sin t_2) (sin y)))
(* (/ (/ a b) x) -0.3333333333333333))
x)
(* -0.3333333333333333 (/ a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (2.0 * sqrt(x)) * cos((y - ((z * t) / 3.0)));
double t_2 = (t * z) * -0.3333333333333333;
double tmp;
if (t_1 <= 2e+37) {
tmp = fma(-0.3333333333333333, a, (2.0 * ((b * ((cos(y) * sin(fma(-0.3333333333333333, (t * z), (((double) M_PI) / 2.0)))) - (sin(y) * sin((-0.3333333333333333 * (t * z)))))) * pow(x, 0.5)))) / b;
} else if (t_1 <= 4e+150) {
tmp = fma((2.0 * pow(pow(x, -1.0), 0.5)), ((cos(t_2) * cos(y)) - (sin(t_2) * sin(y))), (((a / b) / x) * -0.3333333333333333)) * x;
} else {
tmp = -0.3333333333333333 * (a / b);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(2.0 * sqrt(x)) * cos(Float64(y - Float64(Float64(z * t) / 3.0)))) t_2 = Float64(Float64(t * z) * -0.3333333333333333) tmp = 0.0 if (t_1 <= 2e+37) tmp = Float64(fma(-0.3333333333333333, a, Float64(2.0 * Float64(Float64(b * Float64(Float64(cos(y) * sin(fma(-0.3333333333333333, Float64(t * z), Float64(pi / 2.0)))) - Float64(sin(y) * sin(Float64(-0.3333333333333333 * Float64(t * z)))))) * (x ^ 0.5)))) / b); elseif (t_1 <= 4e+150) tmp = Float64(fma(Float64(2.0 * ((x ^ -1.0) ^ 0.5)), Float64(Float64(cos(t_2) * cos(y)) - Float64(sin(t_2) * sin(y))), Float64(Float64(Float64(a / b) / x) * -0.3333333333333333)) * x); else tmp = Float64(-0.3333333333333333 * Float64(a / b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(2.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(y - N[(N[(z * t), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t * z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+37], N[(N[(-0.3333333333333333 * a + N[(2.0 * N[(N[(b * N[(N[(N[Cos[y], $MachinePrecision] * N[Sin[N[(-0.3333333333333333 * N[(t * z), $MachinePrecision] + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] * N[Sin[N[(-0.3333333333333333 * N[(t * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[x, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$1, 4e+150], N[(N[(N[(2.0 * N[Power[N[Power[x, -1.0], $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[t$95$2], $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[t$95$2], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(a / b), $MachinePrecision] / x), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(-0.3333333333333333 * N[(a / b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z \cdot t}{3}\right)\\
t_2 := \left(t \cdot z\right) \cdot -0.3333333333333333\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+37}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.3333333333333333, a, 2 \cdot \left(\left(b \cdot \left(\cos y \cdot \sin \left(\mathsf{fma}\left(-0.3333333333333333, t \cdot z, \frac{\pi}{2}\right)\right) - \sin y \cdot \sin \left(-0.3333333333333333 \cdot \left(t \cdot z\right)\right)\right)\right) \cdot {x}^{0.5}\right)\right)}{b}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+150}:\\
\;\;\;\;\mathsf{fma}\left(2 \cdot {\left({x}^{-1}\right)}^{0.5}, \cos t\_2 \cdot \cos y - \sin t\_2 \cdot \sin y, \frac{\frac{a}{b}}{x} \cdot -0.3333333333333333\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{a}{b}\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 2 binary64) (sqrt.f64 x)) (cos.f64 (-.f64 y (/.f64 (*.f64 z t) #s(literal 3 binary64))))) < 1.99999999999999991e37Initial program 82.9%
Taylor expanded in y around inf
Applied rewrites83.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.1%
Taylor expanded in b around 0
lower-/.f64N/A
Applied rewrites82.0%
lift-cos.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
cos-sumN/A
lower--.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-/.f64N/A
lift-PI.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
lower-sin.f64N/A
lift-*.f64N/A
lift-*.f6483.3
Applied rewrites83.3%
if 1.99999999999999991e37 < (*.f64 (*.f64 #s(literal 2 binary64) (sqrt.f64 x)) (cos.f64 (-.f64 y (/.f64 (*.f64 z t) #s(literal 3 binary64))))) < 3.99999999999999992e150Initial program 73.2%
Taylor expanded in y around inf
Applied rewrites73.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
cos-sumN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-sin.f6475.0
Applied rewrites75.0%
if 3.99999999999999992e150 < (*.f64 (*.f64 #s(literal 2 binary64) (sqrt.f64 x)) (cos.f64 (-.f64 y (/.f64 (*.f64 z t) #s(literal 3 binary64))))) Initial program 0.0%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f6457.0
Applied rewrites57.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* 2.0 (sqrt x)) (cos (- y (/ (* z t) 3.0))))))
(if (<= t_1 5e+35)
(/
(fma
-0.3333333333333333
a
(*
2.0
(*
(*
b
(-
(* (cos y) (sin (fma -0.3333333333333333 (* t z) (/ PI 2.0))))
(* (sin y) (sin (* -0.3333333333333333 (* t z))))))
(pow x 0.5))))
b)
(if (<= t_1 5e+142)
(*
(fma
(* 2.0 (/ 1.0 (pow x 0.5)))
(cos (fma (* t z) -0.3333333333333333 y))
(* (/ (/ a b) x) -0.3333333333333333))
x)
(* -0.3333333333333333 (/ a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (2.0 * sqrt(x)) * cos((y - ((z * t) / 3.0)));
double tmp;
if (t_1 <= 5e+35) {
tmp = fma(-0.3333333333333333, a, (2.0 * ((b * ((cos(y) * sin(fma(-0.3333333333333333, (t * z), (((double) M_PI) / 2.0)))) - (sin(y) * sin((-0.3333333333333333 * (t * z)))))) * pow(x, 0.5)))) / b;
} else if (t_1 <= 5e+142) {
tmp = fma((2.0 * (1.0 / pow(x, 0.5))), cos(fma((t * z), -0.3333333333333333, y)), (((a / b) / x) * -0.3333333333333333)) * x;
} else {
tmp = -0.3333333333333333 * (a / b);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(2.0 * sqrt(x)) * cos(Float64(y - Float64(Float64(z * t) / 3.0)))) tmp = 0.0 if (t_1 <= 5e+35) tmp = Float64(fma(-0.3333333333333333, a, Float64(2.0 * Float64(Float64(b * Float64(Float64(cos(y) * sin(fma(-0.3333333333333333, Float64(t * z), Float64(pi / 2.0)))) - Float64(sin(y) * sin(Float64(-0.3333333333333333 * Float64(t * z)))))) * (x ^ 0.5)))) / b); elseif (t_1 <= 5e+142) tmp = Float64(fma(Float64(2.0 * Float64(1.0 / (x ^ 0.5))), cos(fma(Float64(t * z), -0.3333333333333333, y)), Float64(Float64(Float64(a / b) / x) * -0.3333333333333333)) * x); else tmp = Float64(-0.3333333333333333 * Float64(a / b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(2.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(y - N[(N[(z * t), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+35], N[(N[(-0.3333333333333333 * a + N[(2.0 * N[(N[(b * N[(N[(N[Cos[y], $MachinePrecision] * N[Sin[N[(-0.3333333333333333 * N[(t * z), $MachinePrecision] + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] * N[Sin[N[(-0.3333333333333333 * N[(t * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[x, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$1, 5e+142], N[(N[(N[(2.0 * N[(1.0 / N[Power[x, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(t * z), $MachinePrecision] * -0.3333333333333333 + y), $MachinePrecision]], $MachinePrecision] + N[(N[(N[(a / b), $MachinePrecision] / x), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(-0.3333333333333333 * N[(a / b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z \cdot t}{3}\right)\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+35}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.3333333333333333, a, 2 \cdot \left(\left(b \cdot \left(\cos y \cdot \sin \left(\mathsf{fma}\left(-0.3333333333333333, t \cdot z, \frac{\pi}{2}\right)\right) - \sin y \cdot \sin \left(-0.3333333333333333 \cdot \left(t \cdot z\right)\right)\right)\right) \cdot {x}^{0.5}\right)\right)}{b}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+142}:\\
\;\;\;\;\mathsf{fma}\left(2 \cdot \frac{1}{{x}^{0.5}}, \cos \left(\mathsf{fma}\left(t \cdot z, -0.3333333333333333, y\right)\right), \frac{\frac{a}{b}}{x} \cdot -0.3333333333333333\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{a}{b}\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 2 binary64) (sqrt.f64 x)) (cos.f64 (-.f64 y (/.f64 (*.f64 z t) #s(literal 3 binary64))))) < 5.00000000000000021e35Initial program 83.3%
Taylor expanded in y around inf
Applied rewrites83.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.4%
Taylor expanded in b around 0
lower-/.f64N/A
Applied rewrites82.4%
lift-cos.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
cos-sumN/A
lower--.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-/.f64N/A
lift-PI.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
lower-sin.f64N/A
lift-*.f64N/A
lift-*.f6483.7
Applied rewrites83.7%
if 5.00000000000000021e35 < (*.f64 (*.f64 #s(literal 2 binary64) (sqrt.f64 x)) (cos.f64 (-.f64 y (/.f64 (*.f64 z t) #s(literal 3 binary64))))) < 5.0000000000000001e142Initial program 76.0%
Taylor expanded in y around inf
Applied rewrites75.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.3%
lift-pow.f64N/A
lift-pow.f64N/A
pow1/2N/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
pow1/2N/A
lower-pow.f6476.3
Applied rewrites76.3%
if 5.0000000000000001e142 < (*.f64 (*.f64 #s(literal 2 binary64) (sqrt.f64 x)) (cos.f64 (-.f64 y (/.f64 (*.f64 z t) #s(literal 3 binary64))))) Initial program 0.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f6453.2
Applied rewrites53.2%
(FPCore (x y z t a b) :precision binary64 (- (* (* 2.0 (sqrt x)) (cos y)) (/ (/ a b) 3.0)))
double code(double x, double y, double z, double t, double a, double b) {
return ((2.0 * sqrt(x)) * cos(y)) - ((a / b) / 3.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((2.0d0 * sqrt(x)) * cos(y)) - ((a / b) / 3.0d0)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((2.0 * Math.sqrt(x)) * Math.cos(y)) - ((a / b) / 3.0);
}
def code(x, y, z, t, a, b): return ((2.0 * math.sqrt(x)) * math.cos(y)) - ((a / b) / 3.0)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(2.0 * sqrt(x)) * cos(y)) - Float64(Float64(a / b) / 3.0)) end
function tmp = code(x, y, z, t, a, b) tmp = ((2.0 * sqrt(x)) * cos(y)) - ((a / b) / 3.0); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(2.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(N[(a / b), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(2 \cdot \sqrt{x}\right) \cdot \cos y - \frac{\frac{a}{b}}{3}
\end{array}
Initial program 68.3%
Taylor expanded in y around inf
Applied rewrites77.0%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-/.f6477.1
Applied rewrites77.1%
(FPCore (x y z t a b) :precision binary64 (- (* (* 2.0 (sqrt x)) (cos y)) (/ a (* b 3.0))))
double code(double x, double y, double z, double t, double a, double b) {
return ((2.0 * sqrt(x)) * cos(y)) - (a / (b * 3.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((2.0d0 * sqrt(x)) * cos(y)) - (a / (b * 3.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((2.0 * Math.sqrt(x)) * Math.cos(y)) - (a / (b * 3.0));
}
def code(x, y, z, t, a, b): return ((2.0 * math.sqrt(x)) * math.cos(y)) - (a / (b * 3.0))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(2.0 * sqrt(x)) * cos(y)) - Float64(a / Float64(b * 3.0))) end
function tmp = code(x, y, z, t, a, b) tmp = ((2.0 * sqrt(x)) * cos(y)) - (a / (b * 3.0)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(2.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(a / N[(b * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(2 \cdot \sqrt{x}\right) \cdot \cos y - \frac{a}{b \cdot 3}
\end{array}
Initial program 68.3%
Taylor expanded in y around inf
Applied rewrites77.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ a (* b 3.0))))
(if (<= (cos (- y (/ (* z t) 3.0))) 0.9999999999998)
(-
(*
(* 2.0 (exp (* (log x) 0.5)))
(+ (* (cos y) (cos (* z (/ t 3.0)))) (* (sin y) (sin (/ (* t z) 3.0)))))
t_1)
(- (* (* 2.0 (sqrt x)) (sin (* PI 0.5))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a / (b * 3.0);
double tmp;
if (cos((y - ((z * t) / 3.0))) <= 0.9999999999998) {
tmp = ((2.0 * exp((log(x) * 0.5))) * ((cos(y) * cos((z * (t / 3.0)))) + (sin(y) * sin(((t * z) / 3.0))))) - t_1;
} else {
tmp = ((2.0 * sqrt(x)) * sin((((double) M_PI) * 0.5))) - t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a / (b * 3.0);
double tmp;
if (Math.cos((y - ((z * t) / 3.0))) <= 0.9999999999998) {
tmp = ((2.0 * Math.exp((Math.log(x) * 0.5))) * ((Math.cos(y) * Math.cos((z * (t / 3.0)))) + (Math.sin(y) * Math.sin(((t * z) / 3.0))))) - t_1;
} else {
tmp = ((2.0 * Math.sqrt(x)) * Math.sin((Math.PI * 0.5))) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a / (b * 3.0) tmp = 0 if math.cos((y - ((z * t) / 3.0))) <= 0.9999999999998: tmp = ((2.0 * math.exp((math.log(x) * 0.5))) * ((math.cos(y) * math.cos((z * (t / 3.0)))) + (math.sin(y) * math.sin(((t * z) / 3.0))))) - t_1 else: tmp = ((2.0 * math.sqrt(x)) * math.sin((math.pi * 0.5))) - t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a / Float64(b * 3.0)) tmp = 0.0 if (cos(Float64(y - Float64(Float64(z * t) / 3.0))) <= 0.9999999999998) tmp = Float64(Float64(Float64(2.0 * exp(Float64(log(x) * 0.5))) * Float64(Float64(cos(y) * cos(Float64(z * Float64(t / 3.0)))) + Float64(sin(y) * sin(Float64(Float64(t * z) / 3.0))))) - t_1); else tmp = Float64(Float64(Float64(2.0 * sqrt(x)) * sin(Float64(pi * 0.5))) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a / (b * 3.0); tmp = 0.0; if (cos((y - ((z * t) / 3.0))) <= 0.9999999999998) tmp = ((2.0 * exp((log(x) * 0.5))) * ((cos(y) * cos((z * (t / 3.0)))) + (sin(y) * sin(((t * z) / 3.0))))) - t_1; else tmp = ((2.0 * sqrt(x)) * sin((pi * 0.5))) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a / N[(b * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Cos[N[(y - N[(N[(z * t), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 0.9999999999998], N[(N[(N[(2.0 * N[Exp[N[(N[Log[x], $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[y], $MachinePrecision] * N[Cos[N[(z * N[(t / 3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[y], $MachinePrecision] * N[Sin[N[(N[(t * z), $MachinePrecision] / 3.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(2.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{b \cdot 3}\\
\mathbf{if}\;\cos \left(y - \frac{z \cdot t}{3}\right) \leq 0.9999999999998:\\
\;\;\;\;\left(2 \cdot e^{\log x \cdot 0.5}\right) \cdot \left(\cos y \cdot \cos \left(z \cdot \frac{t}{3}\right) + \sin y \cdot \sin \left(\frac{t \cdot z}{3}\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sqrt{x}\right) \cdot \sin \left(\pi \cdot 0.5\right) - t\_1\\
\end{array}
\end{array}
if (cos.f64 (-.f64 y (/.f64 (*.f64 z t) #s(literal 3 binary64)))) < 0.999999999999800049Initial program 72.1%
lift-cos.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
cos-diffN/A
lower-+.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-cos.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sin.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6473.2
Applied rewrites73.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lower-/.f64N/A
lower-*.f6473.6
Applied rewrites73.6%
lift-sqrt.f64N/A
pow1/2N/A
pow-to-expN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f6472.0
Applied rewrites72.0%
if 0.999999999999800049 < (cos.f64 (-.f64 y (/.f64 (*.f64 z t) #s(literal 3 binary64)))) Initial program 62.1%
Taylor expanded in y around 0
sin-+PI/2-revN/A
lower-sin.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f6462.1
Applied rewrites62.1%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6485.2
Applied rewrites85.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= (* (* 2.0 (sqrt x)) (cos (- y (/ (* z t) 3.0)))) 4e+150)
(/
(fma
-0.3333333333333333
a
(*
2.0
(*
(*
b
(-
(* (cos y) (sin (fma -0.3333333333333333 (* t z) (/ PI 2.0))))
(* (sin y) (sin (* -0.3333333333333333 (* t z))))))
(pow x 0.5))))
b)
(* -0.3333333333333333 (/ a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((2.0 * sqrt(x)) * cos((y - ((z * t) / 3.0)))) <= 4e+150) {
tmp = fma(-0.3333333333333333, a, (2.0 * ((b * ((cos(y) * sin(fma(-0.3333333333333333, (t * z), (((double) M_PI) / 2.0)))) - (sin(y) * sin((-0.3333333333333333 * (t * z)))))) * pow(x, 0.5)))) / b;
} else {
tmp = -0.3333333333333333 * (a / b);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(2.0 * sqrt(x)) * cos(Float64(y - Float64(Float64(z * t) / 3.0)))) <= 4e+150) tmp = Float64(fma(-0.3333333333333333, a, Float64(2.0 * Float64(Float64(b * Float64(Float64(cos(y) * sin(fma(-0.3333333333333333, Float64(t * z), Float64(pi / 2.0)))) - Float64(sin(y) * sin(Float64(-0.3333333333333333 * Float64(t * z)))))) * (x ^ 0.5)))) / b); else tmp = Float64(-0.3333333333333333 * Float64(a / b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(2.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(y - N[(N[(z * t), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 4e+150], N[(N[(-0.3333333333333333 * a + N[(2.0 * N[(N[(b * N[(N[(N[Cos[y], $MachinePrecision] * N[Sin[N[(-0.3333333333333333 * N[(t * z), $MachinePrecision] + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] * N[Sin[N[(-0.3333333333333333 * N[(t * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[x, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(-0.3333333333333333 * N[(a / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(2 \cdot \sqrt{x}\right) \cdot \cos \left(y - \frac{z \cdot t}{3}\right) \leq 4 \cdot 10^{+150}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.3333333333333333, a, 2 \cdot \left(\left(b \cdot \left(\cos y \cdot \sin \left(\mathsf{fma}\left(-0.3333333333333333, t \cdot z, \frac{\pi}{2}\right)\right) - \sin y \cdot \sin \left(-0.3333333333333333 \cdot \left(t \cdot z\right)\right)\right)\right) \cdot {x}^{0.5}\right)\right)}{b}\\
\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{a}{b}\\
\end{array}
\end{array}
if (*.f64 (*.f64 #s(literal 2 binary64) (sqrt.f64 x)) (cos.f64 (-.f64 y (/.f64 (*.f64 z t) #s(literal 3 binary64))))) < 3.99999999999999992e150Initial program 80.2%
Taylor expanded in y around inf
Applied rewrites80.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.9%
Taylor expanded in b around 0
lower-/.f64N/A
Applied rewrites76.7%
lift-cos.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
cos-sumN/A
lower--.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-/.f64N/A
lift-PI.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
lower-sin.f64N/A
lift-*.f64N/A
lift-*.f6477.9
Applied rewrites77.9%
if 3.99999999999999992e150 < (*.f64 (*.f64 #s(literal 2 binary64) (sqrt.f64 x)) (cos.f64 (-.f64 y (/.f64 (*.f64 z t) #s(literal 3 binary64))))) Initial program 0.0%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f6457.0
Applied rewrites57.0%
(FPCore (x y z t a b)
:precision binary64
(/
(fma
-0.3333333333333333
a
(*
2.0
(*
(*
b
(-
(* (cos y) (sin (fma -0.3333333333333333 (* t z) (/ PI 2.0))))
(* (sin y) (sin (* -0.3333333333333333 (* t z))))))
(pow x 0.5))))
b))
double code(double x, double y, double z, double t, double a, double b) {
return fma(-0.3333333333333333, a, (2.0 * ((b * ((cos(y) * sin(fma(-0.3333333333333333, (t * z), (((double) M_PI) / 2.0)))) - (sin(y) * sin((-0.3333333333333333 * (t * z)))))) * pow(x, 0.5)))) / b;
}
function code(x, y, z, t, a, b) return Float64(fma(-0.3333333333333333, a, Float64(2.0 * Float64(Float64(b * Float64(Float64(cos(y) * sin(fma(-0.3333333333333333, Float64(t * z), Float64(pi / 2.0)))) - Float64(sin(y) * sin(Float64(-0.3333333333333333 * Float64(t * z)))))) * (x ^ 0.5)))) / b) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(-0.3333333333333333 * a + N[(2.0 * N[(N[(b * N[(N[(N[Cos[y], $MachinePrecision] * N[Sin[N[(-0.3333333333333333 * N[(t * z), $MachinePrecision] + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] * N[Sin[N[(-0.3333333333333333 * N[(t * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[x, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(-0.3333333333333333, a, 2 \cdot \left(\left(b \cdot \left(\cos y \cdot \sin \left(\mathsf{fma}\left(-0.3333333333333333, t \cdot z, \frac{\pi}{2}\right)\right) - \sin y \cdot \sin \left(-0.3333333333333333 \cdot \left(t \cdot z\right)\right)\right)\right) \cdot {x}^{0.5}\right)\right)}{b}
\end{array}
Initial program 68.3%
Taylor expanded in y around inf
Applied rewrites77.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.9%
Taylor expanded in b around 0
lower-/.f64N/A
Applied rewrites65.3%
lift-cos.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
cos-sumN/A
lower--.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-/.f64N/A
lift-PI.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
lower-sin.f64N/A
lift-*.f64N/A
lift-*.f6466.4
Applied rewrites66.4%
(FPCore (x y z t a b) :precision binary64 (/ (fma -0.3333333333333333 a (* 2.0 (* (* b (cos (+ y (* -0.3333333333333333 (* t z))))) (pow x 0.5)))) b))
double code(double x, double y, double z, double t, double a, double b) {
return fma(-0.3333333333333333, a, (2.0 * ((b * cos((y + (-0.3333333333333333 * (t * z))))) * pow(x, 0.5)))) / b;
}
function code(x, y, z, t, a, b) return Float64(fma(-0.3333333333333333, a, Float64(2.0 * Float64(Float64(b * cos(Float64(y + Float64(-0.3333333333333333 * Float64(t * z))))) * (x ^ 0.5)))) / b) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(-0.3333333333333333 * a + N[(2.0 * N[(N[(b * N[Cos[N[(y + N[(-0.3333333333333333 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Power[x, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(-0.3333333333333333, a, 2 \cdot \left(\left(b \cdot \cos \left(y + -0.3333333333333333 \cdot \left(t \cdot z\right)\right)\right) \cdot {x}^{0.5}\right)\right)}{b}
\end{array}
Initial program 68.3%
Taylor expanded in y around inf
Applied rewrites77.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.9%
Taylor expanded in b around 0
lower-/.f64N/A
Applied rewrites65.3%
herbie shell --seed 2025065
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, K"
:precision binary64
:alt
(! :herbie-platform default (if (< z -1379333748723514100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* (* 2 (sqrt x)) (cos (- (/ 1 y) (/ (/ 3333333333333333/10000000000000000 z) t)))) (/ (/ a 3) b)) (if (< z 35162906135559870000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* (* (sqrt x) 2) (cos (- y (* (/ t 3) z)))) (/ (/ a 3) b)) (- (* (cos (- y (/ (/ 3333333333333333/10000000000000000 z) t))) (* 2 (sqrt x))) (/ (/ a b) 3)))))
(- (* (* 2.0 (sqrt x)) (cos (- y (/ (* z t) 3.0)))) (/ a (* b 3.0))))