
(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (cosh(x) * (y / x)) / z
end function
public static double code(double x, double y, double z) {
return (Math.cosh(x) * (y / x)) / z;
}
def code(x, y, z): return (math.cosh(x) * (y / x)) / z
function code(x, y, z) return Float64(Float64(cosh(x) * Float64(y / x)) / z) end
function tmp = code(x, y, z) tmp = (cosh(x) * (y / x)) / z; end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cosh x \cdot \frac{y}{x}}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (cosh(x) * (y / x)) / z
end function
public static double code(double x, double y, double z) {
return (Math.cosh(x) * (y / x)) / z;
}
def code(x, y, z): return (math.cosh(x) * (y / x)) / z
function code(x, y, z) return Float64(Float64(cosh(x) * Float64(y / x)) / z) end
function tmp = code(x, y, z) tmp = (cosh(x) * (y / x)) / z; end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cosh x \cdot \frac{y}{x}}{z}
\end{array}
(FPCore (x y z) :precision binary64 (let* ((t_0 (* (cosh x) (/ y x)))) (if (<= t_0 2e+133) (/ t_0 z) (/ (/ (* (cosh x) y) z) x))))
double code(double x, double y, double z) {
double t_0 = cosh(x) * (y / x);
double tmp;
if (t_0 <= 2e+133) {
tmp = t_0 / z;
} else {
tmp = ((cosh(x) * y) / z) / x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = cosh(x) * (y / x)
if (t_0 <= 2d+133) then
tmp = t_0 / z
else
tmp = ((cosh(x) * y) / z) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.cosh(x) * (y / x);
double tmp;
if (t_0 <= 2e+133) {
tmp = t_0 / z;
} else {
tmp = ((Math.cosh(x) * y) / z) / x;
}
return tmp;
}
def code(x, y, z): t_0 = math.cosh(x) * (y / x) tmp = 0 if t_0 <= 2e+133: tmp = t_0 / z else: tmp = ((math.cosh(x) * y) / z) / x return tmp
function code(x, y, z) t_0 = Float64(cosh(x) * Float64(y / x)) tmp = 0.0 if (t_0 <= 2e+133) tmp = Float64(t_0 / z); else tmp = Float64(Float64(Float64(cosh(x) * y) / z) / x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = cosh(x) * (y / x); tmp = 0.0; if (t_0 <= 2e+133) tmp = t_0 / z; else tmp = ((cosh(x) * y) / z) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e+133], N[(t$95$0 / z), $MachinePrecision], N[(N[(N[(N[Cosh[x], $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cosh x \cdot \frac{y}{x}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{+133}:\\
\;\;\;\;\frac{t_0}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 y x)) < 2e133Initial program 99.8%
if 2e133 < (*.f64 (cosh.f64 x) (/.f64 y x)) Initial program 64.4%
associate-*r/56.5%
associate-/r*59.6%
Simplified59.6%
associate-*r/72.8%
*-commutative72.8%
associate-/r*100.0%
Applied egg-rr100.0%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* (cosh x) (/ y x)))) (if (<= t_0 INFINITY) (/ t_0 z) (/ (/ y (/ z (+ 1.0 (* 0.5 (* x x))))) x))))
double code(double x, double y, double z) {
double t_0 = cosh(x) * (y / x);
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0 / z;
} else {
tmp = (y / (z / (1.0 + (0.5 * (x * x))))) / x;
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = Math.cosh(x) * (y / x);
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0 / z;
} else {
tmp = (y / (z / (1.0 + (0.5 * (x * x))))) / x;
}
return tmp;
}
def code(x, y, z): t_0 = math.cosh(x) * (y / x) tmp = 0 if t_0 <= math.inf: tmp = t_0 / z else: tmp = (y / (z / (1.0 + (0.5 * (x * x))))) / x return tmp
function code(x, y, z) t_0 = Float64(cosh(x) * Float64(y / x)) tmp = 0.0 if (t_0 <= Inf) tmp = Float64(t_0 / z); else tmp = Float64(Float64(y / Float64(z / Float64(1.0 + Float64(0.5 * Float64(x * x))))) / x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = cosh(x) * (y / x); tmp = 0.0; if (t_0 <= Inf) tmp = t_0 / z; else tmp = (y / (z / (1.0 + (0.5 * (x * x))))) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], N[(t$95$0 / z), $MachinePrecision], N[(N[(y / N[(z / N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cosh x \cdot \frac{y}{x}\\
\mathbf{if}\;t_0 \leq \infty:\\
\;\;\;\;\frac{t_0}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{\frac{z}{1 + 0.5 \cdot \left(x \cdot x\right)}}}{x}\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 y x)) < +inf.0Initial program 97.4%
if +inf.0 < (*.f64 (cosh.f64 x) (/.f64 y x)) Initial program 0.0%
associate-*r/0.0%
associate-/r*17.1%
Simplified17.1%
associate-*r/51.4%
*-commutative51.4%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 74.8%
*-commutative74.8%
unpow274.8%
Simplified74.8%
Taylor expanded in y around 0 74.8%
associate-/l*80.3%
unpow280.3%
Simplified80.3%
Final simplification95.0%
(FPCore (x y z)
:precision binary64
(if (<= x -4e+128)
(/ (/ y (/ 2.0 (/ (* x x) z))) x)
(if (<= x 8.6e+105)
(* (cosh x) (/ y (* x z)))
(/ (/ y (/ z (+ 1.0 (* 0.5 (* x x))))) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4e+128) {
tmp = (y / (2.0 / ((x * x) / z))) / x;
} else if (x <= 8.6e+105) {
tmp = cosh(x) * (y / (x * z));
} else {
tmp = (y / (z / (1.0 + (0.5 * (x * x))))) / x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4d+128)) then
tmp = (y / (2.0d0 / ((x * x) / z))) / x
else if (x <= 8.6d+105) then
tmp = cosh(x) * (y / (x * z))
else
tmp = (y / (z / (1.0d0 + (0.5d0 * (x * x))))) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4e+128) {
tmp = (y / (2.0 / ((x * x) / z))) / x;
} else if (x <= 8.6e+105) {
tmp = Math.cosh(x) * (y / (x * z));
} else {
tmp = (y / (z / (1.0 + (0.5 * (x * x))))) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4e+128: tmp = (y / (2.0 / ((x * x) / z))) / x elif x <= 8.6e+105: tmp = math.cosh(x) * (y / (x * z)) else: tmp = (y / (z / (1.0 + (0.5 * (x * x))))) / x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4e+128) tmp = Float64(Float64(y / Float64(2.0 / Float64(Float64(x * x) / z))) / x); elseif (x <= 8.6e+105) tmp = Float64(cosh(x) * Float64(y / Float64(x * z))); else tmp = Float64(Float64(y / Float64(z / Float64(1.0 + Float64(0.5 * Float64(x * x))))) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4e+128) tmp = (y / (2.0 / ((x * x) / z))) / x; elseif (x <= 8.6e+105) tmp = cosh(x) * (y / (x * z)); else tmp = (y / (z / (1.0 + (0.5 * (x * x))))) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4e+128], N[(N[(y / N[(2.0 / N[(N[(x * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 8.6e+105], N[(N[Cosh[x], $MachinePrecision] * N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(z / N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+128}:\\
\;\;\;\;\frac{\frac{y}{\frac{2}{\frac{x \cdot x}{z}}}}{x}\\
\mathbf{elif}\;x \leq 8.6 \cdot 10^{+105}:\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{\frac{z}{1 + 0.5 \cdot \left(x \cdot x\right)}}}{x}\\
\end{array}
\end{array}
if x < -4.0000000000000003e128Initial program 63.6%
associate-*r/54.5%
associate-/r*36.4%
Simplified36.4%
associate-*r/50.0%
*-commutative50.0%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 91.1%
*-commutative91.1%
unpow291.1%
Simplified91.1%
Taylor expanded in y around 0 91.1%
associate-/l*91.1%
unpow291.1%
Simplified91.1%
Taylor expanded in x around inf 91.1%
unpow291.1%
associate-*r/91.1%
associate-/l*93.3%
Simplified93.3%
if -4.0000000000000003e128 < x < 8.6000000000000003e105Initial program 95.4%
associate-*r/92.5%
associate-/r*90.5%
Simplified90.5%
if 8.6000000000000003e105 < x Initial program 58.5%
associate-*r/51.2%
associate-/r*51.2%
Simplified51.2%
associate-*r/61.0%
*-commutative61.0%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 90.4%
*-commutative90.4%
unpow290.4%
Simplified90.4%
Taylor expanded in y around 0 90.4%
associate-/l*92.9%
unpow292.9%
Simplified92.9%
Final simplification91.4%
(FPCore (x y z)
:precision binary64
(if (<= x -3.2e+124)
(/ (/ y (/ 2.0 (/ (* x x) z))) x)
(if (<= x 2.5e+105)
(/ (cosh x) (/ z (/ y x)))
(/ (/ y (/ z (+ 1.0 (* 0.5 (* x x))))) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.2e+124) {
tmp = (y / (2.0 / ((x * x) / z))) / x;
} else if (x <= 2.5e+105) {
tmp = cosh(x) / (z / (y / x));
} else {
tmp = (y / (z / (1.0 + (0.5 * (x * x))))) / x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-3.2d+124)) then
tmp = (y / (2.0d0 / ((x * x) / z))) / x
else if (x <= 2.5d+105) then
tmp = cosh(x) / (z / (y / x))
else
tmp = (y / (z / (1.0d0 + (0.5d0 * (x * x))))) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.2e+124) {
tmp = (y / (2.0 / ((x * x) / z))) / x;
} else if (x <= 2.5e+105) {
tmp = Math.cosh(x) / (z / (y / x));
} else {
tmp = (y / (z / (1.0 + (0.5 * (x * x))))) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.2e+124: tmp = (y / (2.0 / ((x * x) / z))) / x elif x <= 2.5e+105: tmp = math.cosh(x) / (z / (y / x)) else: tmp = (y / (z / (1.0 + (0.5 * (x * x))))) / x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.2e+124) tmp = Float64(Float64(y / Float64(2.0 / Float64(Float64(x * x) / z))) / x); elseif (x <= 2.5e+105) tmp = Float64(cosh(x) / Float64(z / Float64(y / x))); else tmp = Float64(Float64(y / Float64(z / Float64(1.0 + Float64(0.5 * Float64(x * x))))) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.2e+124) tmp = (y / (2.0 / ((x * x) / z))) / x; elseif (x <= 2.5e+105) tmp = cosh(x) / (z / (y / x)); else tmp = (y / (z / (1.0 + (0.5 * (x * x))))) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.2e+124], N[(N[(y / N[(2.0 / N[(N[(x * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 2.5e+105], N[(N[Cosh[x], $MachinePrecision] / N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(z / N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{+124}:\\
\;\;\;\;\frac{\frac{y}{\frac{2}{\frac{x \cdot x}{z}}}}{x}\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{+105}:\\
\;\;\;\;\frac{\cosh x}{\frac{z}{\frac{y}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{\frac{z}{1 + 0.5 \cdot \left(x \cdot x\right)}}}{x}\\
\end{array}
\end{array}
if x < -3.19999999999999993e124Initial program 63.6%
associate-*r/54.5%
associate-/r*36.4%
Simplified36.4%
associate-*r/50.0%
*-commutative50.0%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 91.1%
*-commutative91.1%
unpow291.1%
Simplified91.1%
Taylor expanded in y around 0 91.1%
associate-/l*91.1%
unpow291.1%
Simplified91.1%
Taylor expanded in x around inf 91.1%
unpow291.1%
associate-*r/91.1%
associate-/l*93.3%
Simplified93.3%
if -3.19999999999999993e124 < x < 2.50000000000000023e105Initial program 95.4%
associate-/l*92.3%
Simplified92.3%
if 2.50000000000000023e105 < x Initial program 58.5%
associate-*r/51.2%
associate-/r*51.2%
Simplified51.2%
associate-*r/61.0%
*-commutative61.0%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 90.4%
*-commutative90.4%
unpow290.4%
Simplified90.4%
Taylor expanded in y around 0 90.4%
associate-/l*92.9%
unpow292.9%
Simplified92.9%
Final simplification92.6%
(FPCore (x y z)
:precision binary64
(if (<= x -400000000.0)
(/ (* 0.5 (/ (* y (* x x)) z)) x)
(if (<= x 7.5e-280)
(/ (+ (/ y x) (* 0.5 (* x y))) z)
(/ (/ y (/ z (+ 1.0 (* 0.5 (* x x))))) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -400000000.0) {
tmp = (0.5 * ((y * (x * x)) / z)) / x;
} else if (x <= 7.5e-280) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = (y / (z / (1.0 + (0.5 * (x * x))))) / x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-400000000.0d0)) then
tmp = (0.5d0 * ((y * (x * x)) / z)) / x
else if (x <= 7.5d-280) then
tmp = ((y / x) + (0.5d0 * (x * y))) / z
else
tmp = (y / (z / (1.0d0 + (0.5d0 * (x * x))))) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -400000000.0) {
tmp = (0.5 * ((y * (x * x)) / z)) / x;
} else if (x <= 7.5e-280) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = (y / (z / (1.0 + (0.5 * (x * x))))) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -400000000.0: tmp = (0.5 * ((y * (x * x)) / z)) / x elif x <= 7.5e-280: tmp = ((y / x) + (0.5 * (x * y))) / z else: tmp = (y / (z / (1.0 + (0.5 * (x * x))))) / x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -400000000.0) tmp = Float64(Float64(0.5 * Float64(Float64(y * Float64(x * x)) / z)) / x); elseif (x <= 7.5e-280) tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z); else tmp = Float64(Float64(y / Float64(z / Float64(1.0 + Float64(0.5 * Float64(x * x))))) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -400000000.0) tmp = (0.5 * ((y * (x * x)) / z)) / x; elseif (x <= 7.5e-280) tmp = ((y / x) + (0.5 * (x * y))) / z; else tmp = (y / (z / (1.0 + (0.5 * (x * x))))) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -400000000.0], N[(N[(0.5 * N[(N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 7.5e-280], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y / N[(z / N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -400000000:\\
\;\;\;\;\frac{0.5 \cdot \frac{y \cdot \left(x \cdot x\right)}{z}}{x}\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-280}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{\frac{z}{1 + 0.5 \cdot \left(x \cdot x\right)}}}{x}\\
\end{array}
\end{array}
if x < -4e8Initial program 73.0%
associate-*r/63.5%
associate-/r*49.2%
Simplified49.2%
associate-*r/63.5%
*-commutative63.5%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 76.9%
*-commutative76.9%
unpow276.9%
Simplified76.9%
Taylor expanded in y around 0 76.9%
associate-/l*72.4%
unpow272.4%
Simplified72.4%
Taylor expanded in x around inf 76.9%
unpow276.9%
*-commutative76.9%
Simplified76.9%
if -4e8 < x < 7.4999999999999999e-280Initial program 97.1%
Taylor expanded in x around 0 94.6%
if 7.4999999999999999e-280 < x Initial program 82.1%
associate-*r/77.2%
associate-/r*77.7%
Simplified77.7%
associate-*r/82.6%
*-commutative82.6%
associate-/r*97.8%
Applied egg-rr97.8%
Taylor expanded in x around 0 83.2%
*-commutative83.2%
unpow283.2%
Simplified83.2%
Taylor expanded in y around 0 83.2%
associate-/l*83.2%
unpow283.2%
Simplified83.2%
Final simplification84.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.4) (not (<= x 1.45))) (/ (* 0.5 (/ (* x x) (/ z y))) x) (/ (/ y x) z)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4) || !(x <= 1.45)) {
tmp = (0.5 * ((x * x) / (z / y))) / x;
} else {
tmp = (y / x) / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.4d0)) .or. (.not. (x <= 1.45d0))) then
tmp = (0.5d0 * ((x * x) / (z / y))) / x
else
tmp = (y / x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4) || !(x <= 1.45)) {
tmp = (0.5 * ((x * x) / (z / y))) / x;
} else {
tmp = (y / x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.4) or not (x <= 1.45): tmp = (0.5 * ((x * x) / (z / y))) / x else: tmp = (y / x) / z return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.4) || !(x <= 1.45)) tmp = Float64(Float64(0.5 * Float64(Float64(x * x) / Float64(z / y))) / x); else tmp = Float64(Float64(y / x) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.4) || ~((x <= 1.45))) tmp = (0.5 * ((x * x) / (z / y))) / x; else tmp = (y / x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.4], N[Not[LessEqual[x, 1.45]], $MachinePrecision]], N[(N[(0.5 * N[(N[(x * x), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \lor \neg \left(x \leq 1.45\right):\\
\;\;\;\;\frac{0.5 \cdot \frac{x \cdot x}{\frac{z}{y}}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\
\end{array}
\end{array}
if x < -1.3999999999999999 or 1.44999999999999996 < x Initial program 72.4%
associate-*r/63.0%
associate-/r*55.9%
Simplified55.9%
associate-*r/67.7%
*-commutative67.7%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 73.4%
*-commutative73.4%
unpow273.4%
Simplified73.4%
Taylor expanded in x around inf 73.4%
associate-/l*61.0%
unpow261.0%
Simplified61.0%
if -1.3999999999999999 < x < 1.44999999999999996Initial program 95.5%
Taylor expanded in x around 0 94.7%
Final simplification78.0%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.4) (not (<= x 1.4))) (/ (* 0.5 (/ (* y (* x x)) z)) x) (/ (/ y x) z)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4) || !(x <= 1.4)) {
tmp = (0.5 * ((y * (x * x)) / z)) / x;
} else {
tmp = (y / x) / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.4d0)) .or. (.not. (x <= 1.4d0))) then
tmp = (0.5d0 * ((y * (x * x)) / z)) / x
else
tmp = (y / x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4) || !(x <= 1.4)) {
tmp = (0.5 * ((y * (x * x)) / z)) / x;
} else {
tmp = (y / x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.4) or not (x <= 1.4): tmp = (0.5 * ((y * (x * x)) / z)) / x else: tmp = (y / x) / z return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.4) || !(x <= 1.4)) tmp = Float64(Float64(0.5 * Float64(Float64(y * Float64(x * x)) / z)) / x); else tmp = Float64(Float64(y / x) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.4) || ~((x <= 1.4))) tmp = (0.5 * ((y * (x * x)) / z)) / x; else tmp = (y / x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.4], N[Not[LessEqual[x, 1.4]], $MachinePrecision]], N[(N[(0.5 * N[(N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \lor \neg \left(x \leq 1.4\right):\\
\;\;\;\;\frac{0.5 \cdot \frac{y \cdot \left(x \cdot x\right)}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\
\end{array}
\end{array}
if x < -1.3999999999999999 or 1.3999999999999999 < x Initial program 72.4%
associate-*r/63.0%
associate-/r*55.9%
Simplified55.9%
associate-*r/67.7%
*-commutative67.7%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 73.4%
*-commutative73.4%
unpow273.4%
Simplified73.4%
Taylor expanded in y around 0 73.4%
associate-/l*71.2%
unpow271.2%
Simplified71.2%
Taylor expanded in x around inf 73.4%
unpow273.4%
*-commutative73.4%
Simplified73.4%
if -1.3999999999999999 < x < 1.3999999999999999Initial program 95.5%
Taylor expanded in x around 0 94.7%
Final simplification84.1%
(FPCore (x y z) :precision binary64 (if (or (<= x -2000000000.0) (not (<= x 2e+18))) (/ (* 0.5 (/ (* y (* x x)) z)) x) (/ (+ (/ y x) (* 0.5 (* x y))) z)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2000000000.0) || !(x <= 2e+18)) {
tmp = (0.5 * ((y * (x * x)) / z)) / x;
} else {
tmp = ((y / x) + (0.5 * (x * y))) / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-2000000000.0d0)) .or. (.not. (x <= 2d+18))) then
tmp = (0.5d0 * ((y * (x * x)) / z)) / x
else
tmp = ((y / x) + (0.5d0 * (x * y))) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -2000000000.0) || !(x <= 2e+18)) {
tmp = (0.5 * ((y * (x * x)) / z)) / x;
} else {
tmp = ((y / x) + (0.5 * (x * y))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2000000000.0) or not (x <= 2e+18): tmp = (0.5 * ((y * (x * x)) / z)) / x else: tmp = ((y / x) + (0.5 * (x * y))) / z return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2000000000.0) || !(x <= 2e+18)) tmp = Float64(Float64(0.5 * Float64(Float64(y * Float64(x * x)) / z)) / x); else tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -2000000000.0) || ~((x <= 2e+18))) tmp = (0.5 * ((y * (x * x)) / z)) / x; else tmp = ((y / x) + (0.5 * (x * y))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2000000000.0], N[Not[LessEqual[x, 2e+18]], $MachinePrecision]], N[(N[(0.5 * N[(N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2000000000 \lor \neg \left(x \leq 2 \cdot 10^{+18}\right):\\
\;\;\;\;\frac{0.5 \cdot \frac{y \cdot \left(x \cdot x\right)}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\end{array}
\end{array}
if x < -2e9 or 2e18 < x Initial program 71.1%
associate-*r/61.2%
associate-/r*53.7%
Simplified53.7%
associate-*r/66.1%
*-commutative66.1%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 75.9%
*-commutative75.9%
unpow275.9%
Simplified75.9%
Taylor expanded in y around 0 75.9%
associate-/l*73.6%
unpow273.6%
Simplified73.6%
Taylor expanded in x around inf 75.9%
unpow275.9%
*-commutative75.9%
Simplified75.9%
if -2e9 < x < 2e18Initial program 95.7%
Taylor expanded in x around 0 92.0%
Final simplification84.4%
(FPCore (x y z)
:precision binary64
(if (<= x -2000000000.0)
(/ (* 0.5 (/ (* y (* x x)) z)) x)
(if (<= x 1e+35)
(/ (+ (/ y x) (* 0.5 (* x y))) z)
(/ (/ y (/ 2.0 (/ (* x x) z))) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2000000000.0) {
tmp = (0.5 * ((y * (x * x)) / z)) / x;
} else if (x <= 1e+35) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = (y / (2.0 / ((x * x) / z))) / x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2000000000.0d0)) then
tmp = (0.5d0 * ((y * (x * x)) / z)) / x
else if (x <= 1d+35) then
tmp = ((y / x) + (0.5d0 * (x * y))) / z
else
tmp = (y / (2.0d0 / ((x * x) / z))) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2000000000.0) {
tmp = (0.5 * ((y * (x * x)) / z)) / x;
} else if (x <= 1e+35) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = (y / (2.0 / ((x * x) / z))) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2000000000.0: tmp = (0.5 * ((y * (x * x)) / z)) / x elif x <= 1e+35: tmp = ((y / x) + (0.5 * (x * y))) / z else: tmp = (y / (2.0 / ((x * x) / z))) / x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2000000000.0) tmp = Float64(Float64(0.5 * Float64(Float64(y * Float64(x * x)) / z)) / x); elseif (x <= 1e+35) tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z); else tmp = Float64(Float64(y / Float64(2.0 / Float64(Float64(x * x) / z))) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2000000000.0) tmp = (0.5 * ((y * (x * x)) / z)) / x; elseif (x <= 1e+35) tmp = ((y / x) + (0.5 * (x * y))) / z; else tmp = (y / (2.0 / ((x * x) / z))) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2000000000.0], N[(N[(0.5 * N[(N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 1e+35], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y / N[(2.0 / N[(N[(x * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2000000000:\\
\;\;\;\;\frac{0.5 \cdot \frac{y \cdot \left(x \cdot x\right)}{z}}{x}\\
\mathbf{elif}\;x \leq 10^{+35}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{\frac{2}{\frac{x \cdot x}{z}}}}{x}\\
\end{array}
\end{array}
if x < -2e9Initial program 73.0%
associate-*r/63.5%
associate-/r*49.2%
Simplified49.2%
associate-*r/63.5%
*-commutative63.5%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 76.9%
*-commutative76.9%
unpow276.9%
Simplified76.9%
Taylor expanded in y around 0 76.9%
associate-/l*72.4%
unpow272.4%
Simplified72.4%
Taylor expanded in x around inf 76.9%
unpow276.9%
*-commutative76.9%
Simplified76.9%
if -2e9 < x < 9.9999999999999997e34Initial program 95.8%
Taylor expanded in x around 0 90.8%
if 9.9999999999999997e34 < x Initial program 66.7%
associate-*r/55.6%
associate-/r*55.6%
Simplified55.6%
associate-*r/66.7%
*-commutative66.7%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 76.5%
*-commutative76.5%
unpow276.5%
Simplified76.5%
Taylor expanded in y around 0 76.5%
associate-/l*78.4%
unpow278.4%
Simplified78.4%
Taylor expanded in x around inf 78.4%
unpow278.4%
associate-*r/78.4%
associate-/l*78.4%
Simplified78.4%
Final simplification84.8%
(FPCore (x y z) :precision binary64 (/ (/ (+ y (* 0.5 (* y (* x x)))) z) x))
double code(double x, double y, double z) {
return ((y + (0.5 * (y * (x * x)))) / z) / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((y + (0.5d0 * (y * (x * x)))) / z) / x
end function
public static double code(double x, double y, double z) {
return ((y + (0.5 * (y * (x * x)))) / z) / x;
}
def code(x, y, z): return ((y + (0.5 * (y * (x * x)))) / z) / x
function code(x, y, z) return Float64(Float64(Float64(y + Float64(0.5 * Float64(y * Float64(x * x)))) / z) / x) end
function tmp = code(x, y, z) tmp = ((y + (0.5 * (y * (x * x)))) / z) / x; end
code[x_, y_, z_] := N[(N[(N[(y + N[(0.5 * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y + 0.5 \cdot \left(y \cdot \left(x \cdot x\right)\right)}{z}}{x}
\end{array}
Initial program 84.1%
associate-*r/79.4%
associate-/r*74.9%
Simplified74.9%
associate-*r/80.8%
*-commutative80.8%
associate-/r*95.9%
Applied egg-rr95.9%
Taylor expanded in x around 0 82.6%
*-commutative82.6%
unpow282.6%
Simplified82.6%
Final simplification82.6%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.4) (not (<= x 1.4))) (* 0.5 (/ (* x y) z)) (/ (/ y x) z)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4) || !(x <= 1.4)) {
tmp = 0.5 * ((x * y) / z);
} else {
tmp = (y / x) / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.4d0)) .or. (.not. (x <= 1.4d0))) then
tmp = 0.5d0 * ((x * y) / z)
else
tmp = (y / x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4) || !(x <= 1.4)) {
tmp = 0.5 * ((x * y) / z);
} else {
tmp = (y / x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.4) or not (x <= 1.4): tmp = 0.5 * ((x * y) / z) else: tmp = (y / x) / z return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.4) || !(x <= 1.4)) tmp = Float64(0.5 * Float64(Float64(x * y) / z)); else tmp = Float64(Float64(y / x) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.4) || ~((x <= 1.4))) tmp = 0.5 * ((x * y) / z); else tmp = (y / x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.4], N[Not[LessEqual[x, 1.4]], $MachinePrecision]], N[(0.5 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \lor \neg \left(x \leq 1.4\right):\\
\;\;\;\;0.5 \cdot \frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\
\end{array}
\end{array}
if x < -1.3999999999999999 or 1.3999999999999999 < x Initial program 72.4%
Taylor expanded in x around 0 43.9%
Taylor expanded in x around inf 43.9%
if -1.3999999999999999 < x < 1.3999999999999999Initial program 95.5%
Taylor expanded in x around 0 94.7%
Final simplification69.5%
(FPCore (x y z) :precision binary64 (if (<= z 9.8e-64) (/ (/ y x) z) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if (z <= 9.8e-64) {
tmp = (y / x) / z;
} else {
tmp = y / (x * z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= 9.8d-64) then
tmp = (y / x) / z
else
tmp = y / (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 9.8e-64) {
tmp = (y / x) / z;
} else {
tmp = y / (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 9.8e-64: tmp = (y / x) / z else: tmp = y / (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 9.8e-64) tmp = Float64(Float64(y / x) / z); else tmp = Float64(y / Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 9.8e-64) tmp = (y / x) / z; else tmp = y / (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 9.8e-64], N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 9.8 \cdot 10^{-64}:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if z < 9.8000000000000003e-64Initial program 87.5%
Taylor expanded in x around 0 59.9%
if 9.8000000000000003e-64 < z Initial program 77.1%
associate-*r/66.7%
associate-/r*60.4%
Simplified60.4%
Taylor expanded in x around 0 39.5%
Final simplification53.1%
(FPCore (x y z) :precision binary64 (if (<= z 7e-61) (/ (/ y z) x) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if (z <= 7e-61) {
tmp = (y / z) / x;
} else {
tmp = y / (x * z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= 7d-61) then
tmp = (y / z) / x
else
tmp = y / (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 7e-61) {
tmp = (y / z) / x;
} else {
tmp = y / (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 7e-61: tmp = (y / z) / x else: tmp = y / (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 7e-61) tmp = Float64(Float64(y / z) / x); else tmp = Float64(y / Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 7e-61) tmp = (y / z) / x; else tmp = y / (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 7e-61], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 7 \cdot 10^{-61}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if z < 7.0000000000000006e-61Initial program 87.6%
associate-*r/85.9%
associate-/r*82.4%
Simplified82.4%
associate-*r/85.9%
*-commutative85.9%
associate-/r*97.8%
Applied egg-rr97.8%
Taylor expanded in x around 0 62.0%
if 7.0000000000000006e-61 < z Initial program 76.9%
associate-*r/66.3%
associate-/r*59.9%
Simplified59.9%
Taylor expanded in x around 0 39.9%
Final simplification54.6%
(FPCore (x y z) :precision binary64 (/ y (* x z)))
double code(double x, double y, double z) {
return y / (x * z);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y / (x * z)
end function
public static double code(double x, double y, double z) {
return y / (x * z);
}
def code(x, y, z): return y / (x * z)
function code(x, y, z) return Float64(y / Float64(x * z)) end
function tmp = code(x, y, z) tmp = y / (x * z); end
code[x_, y_, z_] := N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{x \cdot z}
\end{array}
Initial program 84.1%
associate-*r/79.4%
associate-/r*74.9%
Simplified74.9%
Taylor expanded in x around 0 50.4%
Final simplification50.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ (/ y z) x) (cosh x))))
(if (< y -4.618902267687042e-52)
t_0
(if (< y 1.038530535935153e-39) (/ (/ (* (cosh x) y) x) z) t_0))))
double code(double x, double y, double z) {
double t_0 = ((y / z) / x) * cosh(x);
double tmp;
if (y < -4.618902267687042e-52) {
tmp = t_0;
} else if (y < 1.038530535935153e-39) {
tmp = ((cosh(x) * y) / x) / z;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((y / z) / x) * cosh(x)
if (y < (-4.618902267687042d-52)) then
tmp = t_0
else if (y < 1.038530535935153d-39) then
tmp = ((cosh(x) * y) / x) / z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((y / z) / x) * Math.cosh(x);
double tmp;
if (y < -4.618902267687042e-52) {
tmp = t_0;
} else if (y < 1.038530535935153e-39) {
tmp = ((Math.cosh(x) * y) / x) / z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((y / z) / x) * math.cosh(x) tmp = 0 if y < -4.618902267687042e-52: tmp = t_0 elif y < 1.038530535935153e-39: tmp = ((math.cosh(x) * y) / x) / z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(y / z) / x) * cosh(x)) tmp = 0.0 if (y < -4.618902267687042e-52) tmp = t_0; elseif (y < 1.038530535935153e-39) tmp = Float64(Float64(Float64(cosh(x) * y) / x) / z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((y / z) / x) * cosh(x); tmp = 0.0; if (y < -4.618902267687042e-52) tmp = t_0; elseif (y < 1.038530535935153e-39) tmp = ((cosh(x) * y) / x) / z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision] * N[Cosh[x], $MachinePrecision]), $MachinePrecision]}, If[Less[y, -4.618902267687042e-52], t$95$0, If[Less[y, 1.038530535935153e-39], N[(N[(N[(N[Cosh[x], $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision] / z), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{z}}{x} \cdot \cosh x\\
\mathbf{if}\;y < -4.618902267687042 \cdot 10^{-52}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y < 1.038530535935153 \cdot 10^{-39}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
herbie shell --seed 2023275
(FPCore (x y z)
:name "Linear.Quaternion:$ctan from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< y -4.618902267687042e-52) (* (/ (/ y z) x) (cosh x)) (if (< y 1.038530535935153e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))