
(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 (if (or (<= z -4e+54) (not (<= z 20000.0))) (* y (/ (/ (cosh x) z) x)) (* (/ (cosh x) x) (/ y z))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4e+54) || !(z <= 20000.0)) {
tmp = y * ((cosh(x) / z) / x);
} else {
tmp = (cosh(x) / 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 ((z <= (-4d+54)) .or. (.not. (z <= 20000.0d0))) then
tmp = y * ((cosh(x) / z) / x)
else
tmp = (cosh(x) / x) * (y / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -4e+54) || !(z <= 20000.0)) {
tmp = y * ((Math.cosh(x) / z) / x);
} else {
tmp = (Math.cosh(x) / x) * (y / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4e+54) or not (z <= 20000.0): tmp = y * ((math.cosh(x) / z) / x) else: tmp = (math.cosh(x) / x) * (y / z) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4e+54) || !(z <= 20000.0)) tmp = Float64(y * Float64(Float64(cosh(x) / z) / x)); else tmp = Float64(Float64(cosh(x) / x) * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -4e+54) || ~((z <= 20000.0))) tmp = y * ((cosh(x) / z) / x); else tmp = (cosh(x) / x) * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4e+54], N[Not[LessEqual[z, 20000.0]], $MachinePrecision]], N[(y * N[(N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+54} \lor \neg \left(z \leq 20000\right):\\
\;\;\;\;y \cdot \frac{\frac{\cosh x}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x}{x} \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -4.0000000000000003e54 or 2e4 < z Initial program 77.2%
associate-/l*62.4%
associate-/r/63.3%
associate-*l/66.7%
*-commutative66.7%
Simplified66.7%
*-commutative66.7%
associate-/l*62.4%
associate-/l*77.2%
expm1-log1p-u55.9%
expm1-udef37.5%
associate-*r/40.8%
associate-/l/33.5%
*-commutative33.5%
associate-*l/33.5%
*-commutative33.5%
Applied egg-rr33.5%
expm1-def51.9%
expm1-log1p74.9%
*-commutative74.9%
associate-/r*99.8%
Simplified99.8%
if -4.0000000000000003e54 < z < 2e4Initial program 88.8%
associate-/l*88.0%
associate-/r/93.2%
associate-*l/86.9%
*-commutative86.9%
Simplified86.9%
associate-/l*93.2%
associate-/r/99.9%
Applied egg-rr99.9%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (* y (/ (/ (cosh x) z) x)))
double code(double x, double y, double z) {
return y * ((cosh(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 * ((cosh(x) / z) / x)
end function
public static double code(double x, double y, double z) {
return y * ((Math.cosh(x) / z) / x);
}
def code(x, y, z): return y * ((math.cosh(x) / z) / x)
function code(x, y, z) return Float64(y * Float64(Float64(cosh(x) / z) / x)) end
function tmp = code(x, y, z) tmp = y * ((cosh(x) / z) / x); end
code[x_, y_, z_] := N[(y * N[(N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \frac{\frac{\cosh x}{z}}{x}
\end{array}
Initial program 83.3%
associate-/l*75.9%
associate-/r/79.0%
associate-*l/77.3%
*-commutative77.3%
Simplified77.3%
*-commutative77.3%
associate-/l*75.9%
associate-/l*83.3%
expm1-log1p-u49.3%
expm1-udef38.4%
associate-*r/43.5%
associate-/l/38.4%
*-commutative38.4%
associate-*l/38.4%
*-commutative38.4%
Applied egg-rr38.4%
expm1-def49.3%
expm1-log1p84.3%
*-commutative84.3%
associate-/r*96.5%
Simplified96.5%
Final simplification96.5%
(FPCore (x y z)
:precision binary64
(if (<= y -1e-72)
(+ (* 0.5 (/ (* y x) z)) (/ y (* z x)))
(if (<= y 1.9e-210)
(/ (+ (* 0.5 (* y x)) (/ y x)) z)
(* y (+ (* 0.5 (/ x z)) (/ 1.0 (* z x)))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1e-72) {
tmp = (0.5 * ((y * x) / z)) + (y / (z * x));
} else if (y <= 1.9e-210) {
tmp = ((0.5 * (y * x)) + (y / x)) / z;
} else {
tmp = y * ((0.5 * (x / z)) + (1.0 / (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 (y <= (-1d-72)) then
tmp = (0.5d0 * ((y * x) / z)) + (y / (z * x))
else if (y <= 1.9d-210) then
tmp = ((0.5d0 * (y * x)) + (y / x)) / z
else
tmp = y * ((0.5d0 * (x / z)) + (1.0d0 / (z * x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1e-72) {
tmp = (0.5 * ((y * x) / z)) + (y / (z * x));
} else if (y <= 1.9e-210) {
tmp = ((0.5 * (y * x)) + (y / x)) / z;
} else {
tmp = y * ((0.5 * (x / z)) + (1.0 / (z * x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1e-72: tmp = (0.5 * ((y * x) / z)) + (y / (z * x)) elif y <= 1.9e-210: tmp = ((0.5 * (y * x)) + (y / x)) / z else: tmp = y * ((0.5 * (x / z)) + (1.0 / (z * x))) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1e-72) tmp = Float64(Float64(0.5 * Float64(Float64(y * x) / z)) + Float64(y / Float64(z * x))); elseif (y <= 1.9e-210) tmp = Float64(Float64(Float64(0.5 * Float64(y * x)) + Float64(y / x)) / z); else tmp = Float64(y * Float64(Float64(0.5 * Float64(x / z)) + Float64(1.0 / Float64(z * x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1e-72) tmp = (0.5 * ((y * x) / z)) + (y / (z * x)); elseif (y <= 1.9e-210) tmp = ((0.5 * (y * x)) + (y / x)) / z; else tmp = y * ((0.5 * (x / z)) + (1.0 / (z * x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1e-72], N[(N[(0.5 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(y / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-210], N[(N[(N[(0.5 * N[(y * x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y * N[(N[(0.5 * N[(x / z), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-72}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{z} + \frac{y}{z \cdot x}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-210}:\\
\;\;\;\;\frac{0.5 \cdot \left(y \cdot x\right) + \frac{y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(0.5 \cdot \frac{x}{z} + \frac{1}{z \cdot x}\right)\\
\end{array}
\end{array}
if y < -9.9999999999999997e-73Initial program 90.4%
associate-/l*84.7%
associate-/r/92.8%
associate-*l/87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in x around 0 76.6%
if -9.9999999999999997e-73 < y < 1.90000000000000002e-210Initial program 74.5%
Taylor expanded in x around 0 58.0%
if 1.90000000000000002e-210 < y Initial program 85.2%
associate-/l*78.6%
associate-/r/85.0%
associate-*l/84.8%
*-commutative84.8%
Simplified84.8%
*-commutative84.8%
associate-/l*78.6%
associate-/l*85.2%
expm1-log1p-u49.1%
expm1-udef40.4%
associate-*r/45.0%
associate-/l/40.9%
*-commutative40.9%
associate-*l/40.9%
*-commutative40.9%
Applied egg-rr40.9%
expm1-def49.7%
expm1-log1p88.5%
*-commutative88.5%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around 0 61.5%
Final simplification64.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ y (* z x))))
(if (<= y -5e-75)
(+ (* 0.5 (/ (* y x) z)) t_0)
(if (<= y 5.9e-211)
(/ (+ (* 0.5 (* y x)) (/ y x)) z)
(+ t_0 (* y (/ (* x 0.5) z)))))))
double code(double x, double y, double z) {
double t_0 = y / (z * x);
double tmp;
if (y <= -5e-75) {
tmp = (0.5 * ((y * x) / z)) + t_0;
} else if (y <= 5.9e-211) {
tmp = ((0.5 * (y * x)) + (y / x)) / z;
} else {
tmp = t_0 + (y * ((x * 0.5) / 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) :: t_0
real(8) :: tmp
t_0 = y / (z * x)
if (y <= (-5d-75)) then
tmp = (0.5d0 * ((y * x) / z)) + t_0
else if (y <= 5.9d-211) then
tmp = ((0.5d0 * (y * x)) + (y / x)) / z
else
tmp = t_0 + (y * ((x * 0.5d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y / (z * x);
double tmp;
if (y <= -5e-75) {
tmp = (0.5 * ((y * x) / z)) + t_0;
} else if (y <= 5.9e-211) {
tmp = ((0.5 * (y * x)) + (y / x)) / z;
} else {
tmp = t_0 + (y * ((x * 0.5) / z));
}
return tmp;
}
def code(x, y, z): t_0 = y / (z * x) tmp = 0 if y <= -5e-75: tmp = (0.5 * ((y * x) / z)) + t_0 elif y <= 5.9e-211: tmp = ((0.5 * (y * x)) + (y / x)) / z else: tmp = t_0 + (y * ((x * 0.5) / z)) return tmp
function code(x, y, z) t_0 = Float64(y / Float64(z * x)) tmp = 0.0 if (y <= -5e-75) tmp = Float64(Float64(0.5 * Float64(Float64(y * x) / z)) + t_0); elseif (y <= 5.9e-211) tmp = Float64(Float64(Float64(0.5 * Float64(y * x)) + Float64(y / x)) / z); else tmp = Float64(t_0 + Float64(y * Float64(Float64(x * 0.5) / z))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y / (z * x); tmp = 0.0; if (y <= -5e-75) tmp = (0.5 * ((y * x) / z)) + t_0; elseif (y <= 5.9e-211) tmp = ((0.5 * (y * x)) + (y / x)) / z; else tmp = t_0 + (y * ((x * 0.5) / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y / N[(z * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5e-75], N[(N[(0.5 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[y, 5.9e-211], N[(N[(N[(0.5 * N[(y * x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(t$95$0 + N[(y * N[(N[(x * 0.5), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{z \cdot x}\\
\mathbf{if}\;y \leq -5 \cdot 10^{-75}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{z} + t_0\\
\mathbf{elif}\;y \leq 5.9 \cdot 10^{-211}:\\
\;\;\;\;\frac{0.5 \cdot \left(y \cdot x\right) + \frac{y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0 + y \cdot \frac{x \cdot 0.5}{z}\\
\end{array}
\end{array}
if y < -4.99999999999999979e-75Initial program 90.4%
associate-/l*84.7%
associate-/r/92.8%
associate-*l/87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in x around 0 76.6%
if -4.99999999999999979e-75 < y < 5.9000000000000002e-211Initial program 74.5%
Taylor expanded in x around 0 58.0%
if 5.9000000000000002e-211 < y Initial program 85.2%
associate-/l*78.6%
associate-/r/85.0%
associate-*l/84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in x around 0 60.7%
clear-num60.7%
un-div-inv60.7%
*-commutative60.7%
associate-/r*59.8%
Applied egg-rr59.8%
clear-num59.8%
associate-/l/60.7%
*-commutative60.7%
associate-/r*60.7%
clear-num60.7%
associate-*l*60.7%
*-un-lft-identity60.7%
times-frac61.6%
/-rgt-identity61.6%
Applied egg-rr61.6%
Final simplification64.6%
(FPCore (x y z)
:precision binary64
(if (<= z -3.4e+126)
(/ 1.0 (/ (* z x) y))
(if (<= z 1.2e+51)
(* (/ y z) (+ (* x 0.5) (/ 1.0 x)))
(* y (/ (/ 1.0 z) x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.4e+126) {
tmp = 1.0 / ((z * x) / y);
} else if (z <= 1.2e+51) {
tmp = (y / z) * ((x * 0.5) + (1.0 / x));
} else {
tmp = y * ((1.0 / 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 (z <= (-3.4d+126)) then
tmp = 1.0d0 / ((z * x) / y)
else if (z <= 1.2d+51) then
tmp = (y / z) * ((x * 0.5d0) + (1.0d0 / x))
else
tmp = y * ((1.0d0 / z) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.4e+126) {
tmp = 1.0 / ((z * x) / y);
} else if (z <= 1.2e+51) {
tmp = (y / z) * ((x * 0.5) + (1.0 / x));
} else {
tmp = y * ((1.0 / z) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.4e+126: tmp = 1.0 / ((z * x) / y) elif z <= 1.2e+51: tmp = (y / z) * ((x * 0.5) + (1.0 / x)) else: tmp = y * ((1.0 / z) / x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.4e+126) tmp = Float64(1.0 / Float64(Float64(z * x) / y)); elseif (z <= 1.2e+51) tmp = Float64(Float64(y / z) * Float64(Float64(x * 0.5) + Float64(1.0 / x))); else tmp = Float64(y * Float64(Float64(1.0 / z) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.4e+126) tmp = 1.0 / ((z * x) / y); elseif (z <= 1.2e+51) tmp = (y / z) * ((x * 0.5) + (1.0 / x)); else tmp = y * ((1.0 / z) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.4e+126], N[(1.0 / N[(N[(z * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e+51], N[(N[(y / z), $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(1.0 / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+126}:\\
\;\;\;\;\frac{1}{\frac{z \cdot x}{y}}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+51}:\\
\;\;\;\;\frac{y}{z} \cdot \left(x \cdot 0.5 + \frac{1}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{1}{z}}{x}\\
\end{array}
\end{array}
if z < -3.39999999999999989e126Initial program 77.5%
associate-/l*54.8%
associate-/r/52.9%
associate-*l/58.9%
*-commutative58.9%
Simplified58.9%
Taylor expanded in x around 0 48.5%
if -3.39999999999999989e126 < z < 1.1999999999999999e51Initial program 90.1%
associate-/l*89.5%
associate-/r/93.4%
associate-*l/88.4%
*-commutative88.4%
Simplified88.4%
Taylor expanded in x around 0 64.9%
clear-num64.9%
un-div-inv64.9%
*-commutative64.9%
associate-/r*63.7%
Applied egg-rr63.7%
Taylor expanded in y around 0 66.1%
*-commutative66.1%
+-commutative66.1%
associate-*r/66.1%
*-commutative66.1%
distribute-rgt-in66.1%
associate-/r/66.1%
*-commutative66.1%
associate-*l/71.6%
associate-/r/71.0%
associate-/r/71.0%
*-commutative71.0%
associate-*l/71.0%
associate-*r*69.8%
associate-*l/69.8%
associate-*r/69.8%
associate-*r/68.6%
associate-*r*68.6%
*-commutative68.6%
distribute-rgt-out68.6%
Simplified68.6%
if 1.1999999999999999e51 < z Initial program 69.7%
associate-/l*55.8%
associate-/r/60.8%
associate-*l/61.7%
*-commutative61.7%
Simplified61.7%
*-commutative61.7%
associate-/l*55.8%
associate-/l*69.7%
expm1-log1p-u50.0%
expm1-udef35.4%
associate-*r/40.5%
associate-/l/31.2%
*-commutative31.2%
associate-*l/31.2%
*-commutative31.2%
Applied egg-rr31.2%
expm1-def45.7%
expm1-log1p75.5%
*-commutative75.5%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around 0 52.2%
*-commutative52.2%
associate-/r*52.4%
Simplified52.4%
Final simplification61.5%
(FPCore (x y z) :precision binary64 (if (<= z 1.4e+66) (/ (+ (* 0.5 (* y x)) (/ y x)) z) (* y (+ (* 0.5 (/ x z)) (/ 1.0 (* z x))))))
double code(double x, double y, double z) {
double tmp;
if (z <= 1.4e+66) {
tmp = ((0.5 * (y * x)) + (y / x)) / z;
} else {
tmp = y * ((0.5 * (x / z)) + (1.0 / (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 (z <= 1.4d+66) then
tmp = ((0.5d0 * (y * x)) + (y / x)) / z
else
tmp = y * ((0.5d0 * (x / z)) + (1.0d0 / (z * x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 1.4e+66) {
tmp = ((0.5 * (y * x)) + (y / x)) / z;
} else {
tmp = y * ((0.5 * (x / z)) + (1.0 / (z * x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 1.4e+66: tmp = ((0.5 * (y * x)) + (y / x)) / z else: tmp = y * ((0.5 * (x / z)) + (1.0 / (z * x))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 1.4e+66) tmp = Float64(Float64(Float64(0.5 * Float64(y * x)) + Float64(y / x)) / z); else tmp = Float64(y * Float64(Float64(0.5 * Float64(x / z)) + Float64(1.0 / Float64(z * x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 1.4e+66) tmp = ((0.5 * (y * x)) + (y / x)) / z; else tmp = y * ((0.5 * (x / z)) + (1.0 / (z * x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 1.4e+66], N[(N[(N[(0.5 * N[(y * x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y * N[(N[(0.5 * N[(x / z), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.4 \cdot 10^{+66}:\\
\;\;\;\;\frac{0.5 \cdot \left(y \cdot x\right) + \frac{y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(0.5 \cdot \frac{x}{z} + \frac{1}{z \cdot x}\right)\\
\end{array}
\end{array}
if z < 1.4e66Initial program 87.5%
Taylor expanded in x around 0 65.2%
if 1.4e66 < z Initial program 68.0%
associate-/l*53.4%
associate-/r/60.4%
associate-*l/59.7%
*-commutative59.7%
Simplified59.7%
*-commutative59.7%
associate-/l*53.4%
associate-/l*68.0%
expm1-log1p-u50.9%
expm1-udef37.2%
associate-*r/42.6%
associate-/l/32.8%
*-commutative32.8%
associate-*l/32.8%
*-commutative32.8%
Applied egg-rr32.8%
expm1-def46.4%
expm1-log1p74.2%
*-commutative74.2%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around 0 50.2%
Final simplification62.0%
(FPCore (x y z) :precision binary64 (if (<= z 2.25e+67) (/ (* y (+ (* x 0.5) (/ 1.0 x))) z) (* y (/ (/ 1.0 z) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= 2.25e+67) {
tmp = (y * ((x * 0.5) + (1.0 / x))) / z;
} else {
tmp = y * ((1.0 / 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 (z <= 2.25d+67) then
tmp = (y * ((x * 0.5d0) + (1.0d0 / x))) / z
else
tmp = y * ((1.0d0 / z) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 2.25e+67) {
tmp = (y * ((x * 0.5) + (1.0 / x))) / z;
} else {
tmp = y * ((1.0 / z) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 2.25e+67: tmp = (y * ((x * 0.5) + (1.0 / x))) / z else: tmp = y * ((1.0 / z) / x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 2.25e+67) tmp = Float64(Float64(y * Float64(Float64(x * 0.5) + Float64(1.0 / x))) / z); else tmp = Float64(y * Float64(Float64(1.0 / z) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 2.25e+67) tmp = (y * ((x * 0.5) + (1.0 / x))) / z; else tmp = y * ((1.0 / z) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 2.25e+67], N[(N[(y * N[(N[(x * 0.5), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y * N[(N[(1.0 / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.25 \cdot 10^{+67}:\\
\;\;\;\;\frac{y \cdot \left(x \cdot 0.5 + \frac{1}{x}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{1}{z}}{x}\\
\end{array}
\end{array}
if z < 2.2499999999999999e67Initial program 87.1%
Taylor expanded in x around 0 64.9%
Taylor expanded in y around 0 64.8%
if 2.2499999999999999e67 < z Initial program 69.3%
associate-/l*54.4%
associate-/r/61.6%
associate-*l/60.8%
*-commutative60.8%
Simplified60.8%
*-commutative60.8%
associate-/l*54.4%
associate-/l*69.3%
expm1-log1p-u51.8%
expm1-udef37.9%
associate-*r/43.4%
associate-/l/33.4%
*-commutative33.4%
associate-*l/33.4%
*-commutative33.4%
Applied egg-rr33.4%
expm1-def47.3%
expm1-log1p73.7%
*-commutative73.7%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around 0 50.5%
*-commutative50.5%
associate-/r*50.7%
Simplified50.7%
Final simplification61.9%
(FPCore (x y z) :precision binary64 (if (<= z 1.04e+89) (/ (+ (* 0.5 (* y x)) (/ y x)) z) (* y (/ (/ 1.0 z) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= 1.04e+89) {
tmp = ((0.5 * (y * x)) + (y / x)) / z;
} else {
tmp = y * ((1.0 / 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 (z <= 1.04d+89) then
tmp = ((0.5d0 * (y * x)) + (y / x)) / z
else
tmp = y * ((1.0d0 / z) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 1.04e+89) {
tmp = ((0.5 * (y * x)) + (y / x)) / z;
} else {
tmp = y * ((1.0 / z) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 1.04e+89: tmp = ((0.5 * (y * x)) + (y / x)) / z else: tmp = y * ((1.0 / z) / x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 1.04e+89) tmp = Float64(Float64(Float64(0.5 * Float64(y * x)) + Float64(y / x)) / z); else tmp = Float64(y * Float64(Float64(1.0 / z) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 1.04e+89) tmp = ((0.5 * (y * x)) + (y / x)) / z; else tmp = y * ((1.0 / z) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 1.04e+89], N[(N[(N[(0.5 * N[(y * x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y * N[(N[(1.0 / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.04 \cdot 10^{+89}:\\
\;\;\;\;\frac{0.5 \cdot \left(y \cdot x\right) + \frac{y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{1}{z}}{x}\\
\end{array}
\end{array}
if z < 1.04e89Initial program 87.3%
Taylor expanded in x around 0 65.1%
if 1.04e89 < z Initial program 66.8%
associate-/l*52.8%
associate-/r/62.4%
associate-*l/59.7%
*-commutative59.7%
Simplified59.7%
*-commutative59.7%
associate-/l*52.8%
associate-/l*66.8%
expm1-log1p-u50.1%
expm1-udef37.0%
associate-*r/43.0%
associate-/l/32.1%
*-commutative32.1%
associate-*l/32.1%
*-commutative32.1%
Applied egg-rr32.1%
expm1-def45.2%
expm1-log1p71.6%
*-commutative71.6%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around 0 48.5%
*-commutative48.5%
associate-/r*48.8%
Simplified48.8%
Final simplification61.9%
(FPCore (x y z) :precision binary64 (if (or (<= x -90000.0) (not (<= x 1.4))) (* 0.5 (* x (/ y z))) (/ y (* z x))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -90000.0) || !(x <= 1.4)) {
tmp = 0.5 * (x * (y / z));
} else {
tmp = 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) :: tmp
if ((x <= (-90000.0d0)) .or. (.not. (x <= 1.4d0))) then
tmp = 0.5d0 * (x * (y / z))
else
tmp = y / (z * x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -90000.0) || !(x <= 1.4)) {
tmp = 0.5 * (x * (y / z));
} else {
tmp = y / (z * x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -90000.0) or not (x <= 1.4): tmp = 0.5 * (x * (y / z)) else: tmp = y / (z * x) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -90000.0) || !(x <= 1.4)) tmp = Float64(0.5 * Float64(x * Float64(y / z))); else tmp = Float64(y / Float64(z * x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -90000.0) || ~((x <= 1.4))) tmp = 0.5 * (x * (y / z)); else tmp = y / (z * x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -90000.0], N[Not[LessEqual[x, 1.4]], $MachinePrecision]], N[(0.5 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -90000 \lor \neg \left(x \leq 1.4\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot x}\\
\end{array}
\end{array}
if x < -9e4 or 1.3999999999999999 < x Initial program 77.3%
associate-/l*63.6%
associate-/r/68.9%
associate-*l/63.6%
*-commutative63.6%
Simplified63.6%
Taylor expanded in x around 0 32.2%
Taylor expanded in x around inf 32.2%
associate-*r/27.9%
Simplified27.9%
if -9e4 < x < 1.3999999999999999Initial program 89.7%
associate-/l*88.9%
associate-/r/89.8%
associate-*l/91.9%
*-commutative91.9%
Simplified91.9%
Taylor expanded in x around 0 91.1%
Final simplification58.5%
(FPCore (x y z) :precision binary64 (if (or (<= x -90000.0) (not (<= x 1.4))) (* 0.5 (/ (* y x) z)) (/ y (* z x))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -90000.0) || !(x <= 1.4)) {
tmp = 0.5 * ((y * x) / z);
} else {
tmp = 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) :: tmp
if ((x <= (-90000.0d0)) .or. (.not. (x <= 1.4d0))) then
tmp = 0.5d0 * ((y * x) / z)
else
tmp = y / (z * x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -90000.0) || !(x <= 1.4)) {
tmp = 0.5 * ((y * x) / z);
} else {
tmp = y / (z * x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -90000.0) or not (x <= 1.4): tmp = 0.5 * ((y * x) / z) else: tmp = y / (z * x) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -90000.0) || !(x <= 1.4)) tmp = Float64(0.5 * Float64(Float64(y * x) / z)); else tmp = Float64(y / Float64(z * x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -90000.0) || ~((x <= 1.4))) tmp = 0.5 * ((y * x) / z); else tmp = y / (z * x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -90000.0], N[Not[LessEqual[x, 1.4]], $MachinePrecision]], N[(0.5 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -90000 \lor \neg \left(x \leq 1.4\right):\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot x}\\
\end{array}
\end{array}
if x < -9e4 or 1.3999999999999999 < x Initial program 77.3%
associate-/l*63.6%
associate-/r/68.9%
associate-*l/63.6%
*-commutative63.6%
Simplified63.6%
Taylor expanded in x around 0 32.2%
Taylor expanded in x around inf 32.2%
if -9e4 < x < 1.3999999999999999Initial program 89.7%
associate-/l*88.9%
associate-/r/89.8%
associate-*l/91.9%
*-commutative91.9%
Simplified91.9%
Taylor expanded in x around 0 91.1%
Final simplification60.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -90000.0) (not (<= x 1.4))) (* 0.5 (/ (* y x) z)) (* y (/ (/ 1.0 z) x))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -90000.0) || !(x <= 1.4)) {
tmp = 0.5 * ((y * x) / z);
} else {
tmp = y * ((1.0 / 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 <= (-90000.0d0)) .or. (.not. (x <= 1.4d0))) then
tmp = 0.5d0 * ((y * x) / z)
else
tmp = y * ((1.0d0 / z) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -90000.0) || !(x <= 1.4)) {
tmp = 0.5 * ((y * x) / z);
} else {
tmp = y * ((1.0 / z) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -90000.0) or not (x <= 1.4): tmp = 0.5 * ((y * x) / z) else: tmp = y * ((1.0 / z) / x) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -90000.0) || !(x <= 1.4)) tmp = Float64(0.5 * Float64(Float64(y * x) / z)); else tmp = Float64(y * Float64(Float64(1.0 / z) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -90000.0) || ~((x <= 1.4))) tmp = 0.5 * ((y * x) / z); else tmp = y * ((1.0 / z) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -90000.0], N[Not[LessEqual[x, 1.4]], $MachinePrecision]], N[(0.5 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(1.0 / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -90000 \lor \neg \left(x \leq 1.4\right):\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{1}{z}}{x}\\
\end{array}
\end{array}
if x < -9e4 or 1.3999999999999999 < x Initial program 77.3%
associate-/l*63.6%
associate-/r/68.9%
associate-*l/63.6%
*-commutative63.6%
Simplified63.6%
Taylor expanded in x around 0 32.2%
Taylor expanded in x around inf 32.2%
if -9e4 < x < 1.3999999999999999Initial program 89.7%
associate-/l*88.9%
associate-/r/89.8%
associate-*l/91.9%
*-commutative91.9%
Simplified91.9%
*-commutative91.9%
associate-/l*88.9%
associate-/l*89.7%
expm1-log1p-u56.7%
expm1-udef34.1%
associate-*r/34.1%
associate-/l/34.9%
*-commutative34.9%
associate-*l/34.9%
*-commutative34.9%
Applied egg-rr34.9%
expm1-def57.4%
expm1-log1p92.6%
*-commutative92.6%
associate-/r*92.8%
Simplified92.8%
Taylor expanded in x around 0 91.0%
*-commutative91.0%
associate-/r*91.1%
Simplified91.1%
Final simplification60.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -4e+54) (not (<= z 4.5e+21))) (/ y (* z x)) (/ (/ y z) x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4e+54) || !(z <= 4.5e+21)) {
tmp = y / (z * x);
} else {
tmp = (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) :: tmp
if ((z <= (-4d+54)) .or. (.not. (z <= 4.5d+21))) then
tmp = y / (z * x)
else
tmp = (y / z) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -4e+54) || !(z <= 4.5e+21)) {
tmp = y / (z * x);
} else {
tmp = (y / z) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4e+54) or not (z <= 4.5e+21): tmp = y / (z * x) else: tmp = (y / z) / x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4e+54) || !(z <= 4.5e+21)) tmp = Float64(y / Float64(z * x)); else tmp = Float64(Float64(y / z) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -4e+54) || ~((z <= 4.5e+21))) tmp = y / (z * x); else tmp = (y / z) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4e+54], N[Not[LessEqual[z, 4.5e+21]], $MachinePrecision]], N[(y / N[(z * x), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+54} \lor \neg \left(z \leq 4.5 \cdot 10^{+21}\right):\\
\;\;\;\;\frac{y}{z \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\end{array}
\end{array}
if z < -4.0000000000000003e54 or 4.5e21 < z Initial program 76.7%
associate-/l*61.4%
associate-/r/62.4%
associate-*l/65.9%
*-commutative65.9%
Simplified65.9%
Taylor expanded in x around 0 53.2%
if -4.0000000000000003e54 < z < 4.5e21Initial program 89.0%
associate-/l*88.3%
associate-/r/93.3%
associate-*l/87.1%
*-commutative87.1%
Simplified87.1%
Taylor expanded in x around 0 41.8%
*-un-lft-identity41.8%
times-frac53.5%
Applied egg-rr53.5%
associate-*l/53.5%
*-un-lft-identity53.5%
Applied egg-rr53.5%
Final simplification53.4%
(FPCore (x y z) :precision binary64 (if (<= z 1.7e+87) (/ (/ y x) z) (/ y (* z x))))
double code(double x, double y, double z) {
double tmp;
if (z <= 1.7e+87) {
tmp = (y / x) / z;
} else {
tmp = 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) :: tmp
if (z <= 1.7d+87) then
tmp = (y / x) / z
else
tmp = y / (z * x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 1.7e+87) {
tmp = (y / x) / z;
} else {
tmp = y / (z * x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 1.7e+87: tmp = (y / x) / z else: tmp = y / (z * x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 1.7e+87) tmp = Float64(Float64(y / x) / z); else tmp = Float64(y / Float64(z * x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 1.7e+87) tmp = (y / x) / z; else tmp = y / (z * x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 1.7e+87], N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision], N[(y / N[(z * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.7 \cdot 10^{+87}:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot x}\\
\end{array}
\end{array}
if z < 1.7000000000000001e87Initial program 87.2%
Taylor expanded in x around 0 48.9%
if 1.7000000000000001e87 < z Initial program 68.1%
associate-/l*52.7%
associate-/r/61.9%
associate-*l/59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in x around 0 48.7%
Final simplification48.9%
(FPCore (x y z) :precision binary64 (/ y (* z x)))
double code(double x, double y, double z) {
return y / (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 / (z * x)
end function
public static double code(double x, double y, double z) {
return y / (z * x);
}
def code(x, y, z): return y / (z * x)
function code(x, y, z) return Float64(y / Float64(z * x)) end
function tmp = code(x, y, z) tmp = y / (z * x); end
code[x_, y_, z_] := N[(y / N[(z * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{z \cdot x}
\end{array}
Initial program 83.3%
associate-/l*75.9%
associate-/r/79.0%
associate-*l/77.3%
*-commutative77.3%
Simplified77.3%
Taylor expanded in x around 0 47.1%
Final simplification47.1%
(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 2023321
(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))