
(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 15 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)) z))) (if (<= t_0 1e+101) t_0 (/ (* y (/ (cosh x) z)) x))))
double code(double x, double y, double z) {
double t_0 = (cosh(x) * (y / x)) / z;
double tmp;
if (t_0 <= 1e+101) {
tmp = t_0;
} else {
tmp = (y * (cosh(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) :: t_0
real(8) :: tmp
t_0 = (cosh(x) * (y / x)) / z
if (t_0 <= 1d+101) then
tmp = t_0
else
tmp = (y * (cosh(x) / 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)) / z;
double tmp;
if (t_0 <= 1e+101) {
tmp = t_0;
} else {
tmp = (y * (Math.cosh(x) / z)) / x;
}
return tmp;
}
def code(x, y, z): t_0 = (math.cosh(x) * (y / x)) / z tmp = 0 if t_0 <= 1e+101: tmp = t_0 else: tmp = (y * (math.cosh(x) / z)) / x return tmp
function code(x, y, z) t_0 = Float64(Float64(cosh(x) * Float64(y / x)) / z) tmp = 0.0 if (t_0 <= 1e+101) tmp = t_0; else tmp = Float64(Float64(y * Float64(cosh(x) / z)) / x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (cosh(x) * (y / x)) / z; tmp = 0.0; if (t_0 <= 1e+101) tmp = t_0; else tmp = (y * (cosh(x) / z)) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[t$95$0, 1e+101], t$95$0, N[(N[(y * N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\cosh x \cdot \frac{y}{x}}{z}\\
\mathbf{if}\;t_0 \leq 10^{+101}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{\cosh x}{z}}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 9.9999999999999998e100Initial program 97.1%
if 9.9999999999999998e100 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 68.1%
*-commutative68.1%
associate-*r/68.8%
Simplified68.8%
associate-*l/99.9%
Applied egg-rr99.9%
Final simplification98.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ (cosh x) (* x z)))) (t_1 (/ z (* x y))))
(if (<= x -1.65e+165)
(/ (+ (* (/ y x) t_1) (* z 0.5)) (* z t_1))
(if (<= x -3.2e-153)
t_0
(if (<= x 3.8e-186)
(/ (/ y z) x)
(if (<= x 6.5e+174)
t_0
(/ (* (* y 0.5) (* x z)) (* x (* z (/ z x))))))))))
double code(double x, double y, double z) {
double t_0 = y * (cosh(x) / (x * z));
double t_1 = z / (x * y);
double tmp;
if (x <= -1.65e+165) {
tmp = (((y / x) * t_1) + (z * 0.5)) / (z * t_1);
} else if (x <= -3.2e-153) {
tmp = t_0;
} else if (x <= 3.8e-186) {
tmp = (y / z) / x;
} else if (x <= 6.5e+174) {
tmp = t_0;
} else {
tmp = ((y * 0.5) * (x * z)) / (x * (z * (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) :: t_1
real(8) :: tmp
t_0 = y * (cosh(x) / (x * z))
t_1 = z / (x * y)
if (x <= (-1.65d+165)) then
tmp = (((y / x) * t_1) + (z * 0.5d0)) / (z * t_1)
else if (x <= (-3.2d-153)) then
tmp = t_0
else if (x <= 3.8d-186) then
tmp = (y / z) / x
else if (x <= 6.5d+174) then
tmp = t_0
else
tmp = ((y * 0.5d0) * (x * z)) / (x * (z * (z / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (Math.cosh(x) / (x * z));
double t_1 = z / (x * y);
double tmp;
if (x <= -1.65e+165) {
tmp = (((y / x) * t_1) + (z * 0.5)) / (z * t_1);
} else if (x <= -3.2e-153) {
tmp = t_0;
} else if (x <= 3.8e-186) {
tmp = (y / z) / x;
} else if (x <= 6.5e+174) {
tmp = t_0;
} else {
tmp = ((y * 0.5) * (x * z)) / (x * (z * (z / x)));
}
return tmp;
}
def code(x, y, z): t_0 = y * (math.cosh(x) / (x * z)) t_1 = z / (x * y) tmp = 0 if x <= -1.65e+165: tmp = (((y / x) * t_1) + (z * 0.5)) / (z * t_1) elif x <= -3.2e-153: tmp = t_0 elif x <= 3.8e-186: tmp = (y / z) / x elif x <= 6.5e+174: tmp = t_0 else: tmp = ((y * 0.5) * (x * z)) / (x * (z * (z / x))) return tmp
function code(x, y, z) t_0 = Float64(y * Float64(cosh(x) / Float64(x * z))) t_1 = Float64(z / Float64(x * y)) tmp = 0.0 if (x <= -1.65e+165) tmp = Float64(Float64(Float64(Float64(y / x) * t_1) + Float64(z * 0.5)) / Float64(z * t_1)); elseif (x <= -3.2e-153) tmp = t_0; elseif (x <= 3.8e-186) tmp = Float64(Float64(y / z) / x); elseif (x <= 6.5e+174) tmp = t_0; else tmp = Float64(Float64(Float64(y * 0.5) * Float64(x * z)) / Float64(x * Float64(z * Float64(z / x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (cosh(x) / (x * z)); t_1 = z / (x * y); tmp = 0.0; if (x <= -1.65e+165) tmp = (((y / x) * t_1) + (z * 0.5)) / (z * t_1); elseif (x <= -3.2e-153) tmp = t_0; elseif (x <= 3.8e-186) tmp = (y / z) / x; elseif (x <= 6.5e+174) tmp = t_0; else tmp = ((y * 0.5) * (x * z)) / (x * (z * (z / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(N[Cosh[x], $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z / N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.65e+165], N[(N[(N[(N[(y / x), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] / N[(z * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.2e-153], t$95$0, If[LessEqual[x, 3.8e-186], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 6.5e+174], t$95$0, N[(N[(N[(y * 0.5), $MachinePrecision] * N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{\cosh x}{x \cdot z}\\
t_1 := \frac{z}{x \cdot y}\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{+165}:\\
\;\;\;\;\frac{\frac{y}{x} \cdot t_1 + z \cdot 0.5}{z \cdot t_1}\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-153}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-186}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+174}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(y \cdot 0.5\right) \cdot \left(x \cdot z\right)}{x \cdot \left(z \cdot \frac{z}{x}\right)}\\
\end{array}
\end{array}
if x < -1.6499999999999999e165Initial program 73.1%
*-commutative73.1%
associate-*r/73.1%
Simplified73.1%
Taylor expanded in x around 0 63.1%
+-commutative63.1%
associate-/l*48.6%
*-commutative48.6%
Simplified48.6%
clear-num48.6%
un-div-inv48.6%
Applied egg-rr48.6%
+-commutative48.6%
associate-/r*48.6%
frac-add48.5%
associate-/l/48.5%
associate-/l/66.6%
Applied egg-rr66.6%
if -1.6499999999999999e165 < x < -3.1999999999999999e-153 or 3.79999999999999974e-186 < x < 6.5000000000000001e174Initial program 86.7%
associate-*r/93.9%
associate-/l/85.7%
associate-*l/86.3%
*-commutative86.3%
*-commutative86.3%
Simplified86.3%
if -3.1999999999999999e-153 < x < 3.79999999999999974e-186Initial program 91.6%
*-commutative91.6%
associate-*r/91.5%
Simplified91.5%
associate-*l/96.7%
Applied egg-rr96.7%
Taylor expanded in x around 0 96.8%
if 6.5000000000000001e174 < x Initial program 63.6%
*-commutative63.6%
associate-*r/63.6%
Simplified63.6%
Taylor expanded in x around 0 53.2%
+-commutative53.2%
associate-/l*50.6%
*-commutative50.6%
Simplified50.6%
+-commutative50.6%
*-commutative50.6%
associate-*r/50.6%
frac-add42.7%
*-commutative42.7%
*-commutative42.7%
Applied egg-rr42.7%
+-commutative42.7%
associate-*r*42.7%
*-commutative42.7%
distribute-rgt-out42.7%
associate-*l*42.7%
associate-*l*72.9%
Simplified72.9%
Taylor expanded in x around inf 72.9%
associate-*r*72.9%
*-commutative72.9%
Simplified72.9%
Final simplification84.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -4.8e+60) (not (<= z 1.42e+56))) (* (/ y x) (/ (cosh x) z)) (* (cosh x) (/ (/ y z) x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4.8e+60) || !(z <= 1.42e+56)) {
tmp = (y / x) * (cosh(x) / 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) :: tmp
if ((z <= (-4.8d+60)) .or. (.not. (z <= 1.42d+56))) then
tmp = (y / x) * (cosh(x) / 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 tmp;
if ((z <= -4.8e+60) || !(z <= 1.42e+56)) {
tmp = (y / x) * (Math.cosh(x) / z);
} else {
tmp = Math.cosh(x) * ((y / z) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4.8e+60) or not (z <= 1.42e+56): tmp = (y / x) * (math.cosh(x) / z) else: tmp = math.cosh(x) * ((y / z) / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4.8e+60) || !(z <= 1.42e+56)) tmp = Float64(Float64(y / x) * Float64(cosh(x) / z)); else tmp = Float64(cosh(x) * Float64(Float64(y / z) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -4.8e+60) || ~((z <= 1.42e+56))) tmp = (y / x) * (cosh(x) / z); else tmp = cosh(x) * ((y / z) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4.8e+60], N[Not[LessEqual[z, 1.42e+56]], $MachinePrecision]], N[(N[(y / x), $MachinePrecision] * N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[Cosh[x], $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+60} \lor \neg \left(z \leq 1.42 \cdot 10^{+56}\right):\\
\;\;\;\;\frac{y}{x} \cdot \frac{\cosh x}{z}\\
\mathbf{else}:\\
\;\;\;\;\cosh x \cdot \frac{\frac{y}{z}}{x}\\
\end{array}
\end{array}
if z < -4.8e60 or 1.42e56 < z Initial program 81.2%
*-commutative81.2%
associate-*r/82.0%
Simplified82.0%
if -4.8e60 < z < 1.42e56Initial program 85.3%
associate-*r/85.3%
associate-/l/84.0%
associate-/r*95.7%
Simplified95.7%
Final simplification89.6%
(FPCore (x y z) :precision binary64 (if (<= x 7e+170) (* (cosh x) (/ (/ y z) x)) (/ (* (* y 0.5) (* x z)) (* x (* z (/ z x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 7e+170) {
tmp = cosh(x) * ((y / z) / x);
} else {
tmp = ((y * 0.5) * (x * z)) / (x * (z * (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 <= 7d+170) then
tmp = cosh(x) * ((y / z) / x)
else
tmp = ((y * 0.5d0) * (x * z)) / (x * (z * (z / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 7e+170) {
tmp = Math.cosh(x) * ((y / z) / x);
} else {
tmp = ((y * 0.5) * (x * z)) / (x * (z * (z / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 7e+170: tmp = math.cosh(x) * ((y / z) / x) else: tmp = ((y * 0.5) * (x * z)) / (x * (z * (z / x))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 7e+170) tmp = Float64(cosh(x) * Float64(Float64(y / z) / x)); else tmp = Float64(Float64(Float64(y * 0.5) * Float64(x * z)) / Float64(x * Float64(z * Float64(z / x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 7e+170) tmp = cosh(x) * ((y / z) / x); else tmp = ((y * 0.5) * (x * z)) / (x * (z * (z / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 7e+170], N[(N[Cosh[x], $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * 0.5), $MachinePrecision] * N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 7 \cdot 10^{+170}:\\
\;\;\;\;\cosh x \cdot \frac{\frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(y \cdot 0.5\right) \cdot \left(x \cdot z\right)}{x \cdot \left(z \cdot \frac{z}{x}\right)}\\
\end{array}
\end{array}
if x < 7.00000000000000011e170Initial program 86.4%
associate-*r/81.4%
associate-/l/78.1%
associate-/r*86.4%
Simplified86.4%
if 7.00000000000000011e170 < x Initial program 63.6%
*-commutative63.6%
associate-*r/63.6%
Simplified63.6%
Taylor expanded in x around 0 53.2%
+-commutative53.2%
associate-/l*50.6%
*-commutative50.6%
Simplified50.6%
+-commutative50.6%
*-commutative50.6%
associate-*r/50.6%
frac-add42.7%
*-commutative42.7%
*-commutative42.7%
Applied egg-rr42.7%
+-commutative42.7%
associate-*r*42.7%
*-commutative42.7%
distribute-rgt-out42.7%
associate-*l*42.7%
associate-*l*72.9%
Simplified72.9%
Taylor expanded in x around inf 72.9%
associate-*r*72.9%
*-commutative72.9%
Simplified72.9%
Final simplification84.6%
(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(Float64(y * Float64(cosh(x) / z)) / x) end
function tmp = code(x, y, z) tmp = (y * (cosh(x) / z)) / x; end
code[x_, y_, z_] := N[(N[(y * N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{y \cdot \frac{\cosh x}{z}}{x}
\end{array}
Initial program 83.5%
*-commutative83.5%
associate-*r/83.8%
Simplified83.8%
associate-*l/96.3%
Applied egg-rr96.3%
Final simplification96.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -4e-14) (not (<= y 1.45e+72))) (+ (/ 0.5 (/ z (* x y))) (/ y (* x z))) (/ (+ (/ y x) (* 0.5 (* x y))) z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4e-14) || !(y <= 1.45e+72)) {
tmp = (0.5 / (z / (x * y))) + (y / (x * z));
} 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 ((y <= (-4d-14)) .or. (.not. (y <= 1.45d+72))) then
tmp = (0.5d0 / (z / (x * y))) + (y / (x * z))
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 ((y <= -4e-14) || !(y <= 1.45e+72)) {
tmp = (0.5 / (z / (x * y))) + (y / (x * z));
} else {
tmp = ((y / x) + (0.5 * (x * y))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4e-14) or not (y <= 1.45e+72): tmp = (0.5 / (z / (x * y))) + (y / (x * z)) else: tmp = ((y / x) + (0.5 * (x * y))) / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4e-14) || !(y <= 1.45e+72)) tmp = Float64(Float64(0.5 / Float64(z / Float64(x * y))) + Float64(y / Float64(x * z))); 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 ((y <= -4e-14) || ~((y <= 1.45e+72))) tmp = (0.5 / (z / (x * y))) + (y / (x * z)); else tmp = ((y / x) + (0.5 * (x * y))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4e-14], N[Not[LessEqual[y, 1.45e+72]], $MachinePrecision]], N[(N[(0.5 / N[(z / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $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}\;y \leq -4 \cdot 10^{-14} \lor \neg \left(y \leq 1.45 \cdot 10^{+72}\right):\\
\;\;\;\;\frac{0.5}{\frac{z}{x \cdot y}} + \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\end{array}
\end{array}
if y < -4e-14 or 1.45000000000000009e72 < y Initial program 88.7%
*-commutative88.7%
associate-*r/89.5%
Simplified89.5%
Taylor expanded in x around 0 80.1%
+-commutative80.1%
associate-/l*68.7%
*-commutative68.7%
Simplified68.7%
clear-num68.7%
un-div-inv68.7%
Applied egg-rr68.7%
Taylor expanded in z around 0 80.1%
if -4e-14 < y < 1.45000000000000009e72Initial program 79.1%
Taylor expanded in x around 0 57.1%
Final simplification67.5%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.1e-18) (not (<= y 1.45e+72))) (+ (/ 0.5 (/ z (* x y))) (/ y (* x z))) (+ (/ (/ y x) z) (* y (/ (* x 0.5) z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.1e-18) || !(y <= 1.45e+72)) {
tmp = (0.5 / (z / (x * y))) + (y / (x * z));
} else {
tmp = ((y / x) / z) + (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) :: tmp
if ((y <= (-3.1d-18)) .or. (.not. (y <= 1.45d+72))) then
tmp = (0.5d0 / (z / (x * y))) + (y / (x * z))
else
tmp = ((y / x) / z) + (y * ((x * 0.5d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -3.1e-18) || !(y <= 1.45e+72)) {
tmp = (0.5 / (z / (x * y))) + (y / (x * z));
} else {
tmp = ((y / x) / z) + (y * ((x * 0.5) / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.1e-18) or not (y <= 1.45e+72): tmp = (0.5 / (z / (x * y))) + (y / (x * z)) else: tmp = ((y / x) / z) + (y * ((x * 0.5) / z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.1e-18) || !(y <= 1.45e+72)) tmp = Float64(Float64(0.5 / Float64(z / Float64(x * y))) + Float64(y / Float64(x * z))); else tmp = Float64(Float64(Float64(y / x) / z) + Float64(y * Float64(Float64(x * 0.5) / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -3.1e-18) || ~((y <= 1.45e+72))) tmp = (0.5 / (z / (x * y))) + (y / (x * z)); else tmp = ((y / x) / z) + (y * ((x * 0.5) / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.1e-18], N[Not[LessEqual[y, 1.45e+72]], $MachinePrecision]], N[(N[(0.5 / N[(z / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision] + N[(y * N[(N[(x * 0.5), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-18} \lor \neg \left(y \leq 1.45 \cdot 10^{+72}\right):\\
\;\;\;\;\frac{0.5}{\frac{z}{x \cdot y}} + \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x}}{z} + y \cdot \frac{x \cdot 0.5}{z}\\
\end{array}
\end{array}
if y < -3.10000000000000007e-18 or 1.45000000000000009e72 < y Initial program 88.7%
*-commutative88.7%
associate-*r/89.5%
Simplified89.5%
Taylor expanded in x around 0 80.1%
+-commutative80.1%
associate-/l*68.7%
*-commutative68.7%
Simplified68.7%
clear-num68.7%
un-div-inv68.7%
Applied egg-rr68.7%
Taylor expanded in z around 0 80.1%
if -3.10000000000000007e-18 < y < 1.45000000000000009e72Initial program 79.1%
*-commutative79.1%
associate-*r/79.1%
Simplified79.1%
Taylor expanded in x around 0 46.7%
+-commutative46.7%
associate-/l*50.0%
*-commutative50.0%
Simplified50.0%
*-un-lft-identity50.0%
div-inv50.0%
times-frac46.7%
Applied egg-rr46.7%
Taylor expanded in y around 0 51.0%
distribute-lft-in51.0%
*-commutative51.0%
associate-*r/51.4%
*-rgt-identity51.4%
associate-/r*61.8%
associate-*r/61.8%
*-commutative61.8%
Simplified61.8%
Final simplification70.1%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.45) (not (<= x 9.5e-8))) (* 0.5 (* x (/ y z))) (/ (/ y z) x)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.45) || !(x <= 9.5e-8)) {
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 <= (-1.45d0)) .or. (.not. (x <= 9.5d-8))) 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 <= -1.45) || !(x <= 9.5e-8)) {
tmp = 0.5 * (x * (y / z));
} else {
tmp = (y / z) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.45) or not (x <= 9.5e-8): tmp = 0.5 * (x * (y / z)) else: tmp = (y / z) / x return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.45) || !(x <= 9.5e-8)) tmp = Float64(0.5 * Float64(x * Float64(y / z))); else tmp = Float64(Float64(y / z) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.45) || ~((x <= 9.5e-8))) tmp = 0.5 * (x * (y / z)); else tmp = (y / z) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.45], N[Not[LessEqual[x, 9.5e-8]], $MachinePrecision]], N[(0.5 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \lor \neg \left(x \leq 9.5 \cdot 10^{-8}\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\end{array}
\end{array}
if x < -1.44999999999999996 or 9.50000000000000036e-8 < x Initial program 77.8%
Taylor expanded in x around 0 38.6%
Taylor expanded in y around 0 38.6%
Taylor expanded in x around inf 38.6%
*-commutative38.6%
associate-*r/28.8%
Simplified28.8%
if -1.44999999999999996 < x < 9.50000000000000036e-8Initial program 89.8%
*-commutative89.8%
associate-*r/89.7%
Simplified89.7%
associate-*l/92.2%
Applied egg-rr92.2%
Taylor expanded in x around 0 92.2%
Final simplification58.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.45) (not (<= x 9.5e-8))) (* y (/ 0.5 (/ z x))) (/ (/ y z) x)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.45) || !(x <= 9.5e-8)) {
tmp = y * (0.5 / (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 ((x <= (-1.45d0)) .or. (.not. (x <= 9.5d-8))) then
tmp = y * (0.5d0 / (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 ((x <= -1.45) || !(x <= 9.5e-8)) {
tmp = y * (0.5 / (z / x));
} else {
tmp = (y / z) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.45) or not (x <= 9.5e-8): tmp = y * (0.5 / (z / x)) else: tmp = (y / z) / x return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.45) || !(x <= 9.5e-8)) tmp = Float64(y * Float64(0.5 / 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 ((x <= -1.45) || ~((x <= 9.5e-8))) tmp = y * (0.5 / (z / x)); else tmp = (y / z) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.45], N[Not[LessEqual[x, 9.5e-8]], $MachinePrecision]], N[(y * N[(0.5 / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \lor \neg \left(x \leq 9.5 \cdot 10^{-8}\right):\\
\;\;\;\;y \cdot \frac{0.5}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\end{array}
\end{array}
if x < -1.44999999999999996 or 9.50000000000000036e-8 < x Initial program 77.8%
Taylor expanded in x around 0 38.6%
Taylor expanded in y around 0 38.6%
Taylor expanded in x around inf 38.6%
associate-*r/38.6%
associate-*r*38.6%
associate-*r/33.7%
*-commutative33.7%
associate-*r*33.7%
associate-*r/33.7%
associate-/l*33.7%
Simplified33.7%
if -1.44999999999999996 < x < 9.50000000000000036e-8Initial program 89.8%
*-commutative89.8%
associate-*r/89.7%
Simplified89.7%
associate-*l/92.2%
Applied egg-rr92.2%
Taylor expanded in x around 0 92.2%
Final simplification61.4%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.45) (not (<= x 9.5e-8))) (* (* x y) (/ 0.5 z)) (/ (/ y z) x)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.45) || !(x <= 9.5e-8)) {
tmp = (x * y) * (0.5 / 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 <= (-1.45d0)) .or. (.not. (x <= 9.5d-8))) then
tmp = (x * y) * (0.5d0 / 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 <= -1.45) || !(x <= 9.5e-8)) {
tmp = (x * y) * (0.5 / z);
} else {
tmp = (y / z) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.45) or not (x <= 9.5e-8): tmp = (x * y) * (0.5 / z) else: tmp = (y / z) / x return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.45) || !(x <= 9.5e-8)) tmp = Float64(Float64(x * y) * Float64(0.5 / z)); else tmp = Float64(Float64(y / z) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.45) || ~((x <= 9.5e-8))) tmp = (x * y) * (0.5 / z); else tmp = (y / z) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.45], N[Not[LessEqual[x, 9.5e-8]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * N[(0.5 / z), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \lor \neg \left(x \leq 9.5 \cdot 10^{-8}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{0.5}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\end{array}
\end{array}
if x < -1.44999999999999996 or 9.50000000000000036e-8 < x Initial program 77.8%
*-commutative77.8%
associate-*r/78.5%
Simplified78.5%
Taylor expanded in x around 0 38.6%
+-commutative38.6%
associate-/l*32.3%
*-commutative32.3%
Simplified32.3%
*-un-lft-identity32.3%
div-inv32.3%
times-frac38.6%
Applied egg-rr38.6%
Taylor expanded in x around inf 38.6%
metadata-eval38.6%
times-frac38.6%
*-commutative38.6%
times-frac38.6%
/-rgt-identity38.6%
Simplified38.6%
if -1.44999999999999996 < x < 9.50000000000000036e-8Initial program 89.8%
*-commutative89.8%
associate-*r/89.7%
Simplified89.7%
associate-*l/92.2%
Applied egg-rr92.2%
Taylor expanded in x around 0 92.2%
Final simplification63.9%
(FPCore (x y z) :precision binary64 (/ (* y (+ (* x 0.5) (/ 1.0 x))) z))
double code(double x, double y, double z) {
return (y * ((x * 0.5) + (1.0 / 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 * 0.5d0) + (1.0d0 / x))) / z
end function
public static double code(double x, double y, double z) {
return (y * ((x * 0.5) + (1.0 / x))) / z;
}
def code(x, y, z): return (y * ((x * 0.5) + (1.0 / x))) / z
function code(x, y, z) return Float64(Float64(y * Float64(Float64(x * 0.5) + Float64(1.0 / x))) / z) end
function tmp = code(x, y, z) tmp = (y * ((x * 0.5) + (1.0 / x))) / z; end
code[x_, y_, z_] := N[(N[(y * N[(N[(x * 0.5), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{y \cdot \left(x \cdot 0.5 + \frac{1}{x}\right)}{z}
\end{array}
Initial program 83.5%
Taylor expanded in x around 0 62.8%
Taylor expanded in y around 0 62.7%
Final simplification62.7%
(FPCore (x y z) :precision binary64 (/ (+ (/ y x) (* 0.5 (* x y))) z))
double code(double x, double y, double z) {
return ((y / x) + (0.5 * (x * y))) / 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) + (0.5d0 * (x * y))) / z
end function
public static double code(double x, double y, double z) {
return ((y / x) + (0.5 * (x * y))) / z;
}
def code(x, y, z): return ((y / x) + (0.5 * (x * y))) / z
function code(x, y, z) return Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z) end
function tmp = code(x, y, z) tmp = ((y / x) + (0.5 * (x * y))) / z; end
code[x_, y_, z_] := N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}
\end{array}
Initial program 83.5%
Taylor expanded in x around 0 62.8%
Final simplification62.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -2e-12) (not (<= y 2.95e+137))) (/ y (* x z)) (/ (/ y x) z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2e-12) || !(y <= 2.95e+137)) {
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 ((y <= (-2d-12)) .or. (.not. (y <= 2.95d+137))) 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 ((y <= -2e-12) || !(y <= 2.95e+137)) {
tmp = y / (x * z);
} else {
tmp = (y / x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2e-12) or not (y <= 2.95e+137): tmp = y / (x * z) else: tmp = (y / x) / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2e-12) || !(y <= 2.95e+137)) tmp = Float64(y / Float64(x * z)); else tmp = Float64(Float64(y / x) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2e-12) || ~((y <= 2.95e+137))) tmp = y / (x * z); else tmp = (y / x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2e-12], N[Not[LessEqual[y, 2.95e+137]], $MachinePrecision]], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-12} \lor \neg \left(y \leq 2.95 \cdot 10^{+137}\right):\\
\;\;\;\;\frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\
\end{array}
\end{array}
if y < -1.99999999999999996e-12 or 2.95000000000000018e137 < y Initial program 87.0%
*-commutative87.0%
associate-*r/87.9%
Simplified87.9%
Taylor expanded in x around 0 52.9%
if -1.99999999999999996e-12 < y < 2.95000000000000018e137Initial program 81.1%
Taylor expanded in x around 0 48.1%
Final simplification50.0%
(FPCore (x y z) :precision binary64 (if (<= z -3.6e+59) (/ y (* x z)) (/ (/ y z) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.6e+59) {
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 <= (-3.6d+59)) 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 <= -3.6e+59) {
tmp = y / (x * z);
} else {
tmp = (y / z) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.6e+59: tmp = y / (x * z) else: tmp = (y / z) / x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.6e+59) tmp = Float64(y / Float64(x * z)); else tmp = Float64(Float64(y / z) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.6e+59) tmp = y / (x * z); else tmp = (y / z) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.6e+59], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+59}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\end{array}
\end{array}
if z < -3.5999999999999999e59Initial program 80.8%
*-commutative80.8%
associate-*r/82.3%
Simplified82.3%
Taylor expanded in x around 0 37.1%
if -3.5999999999999999e59 < z Initial program 84.3%
*-commutative84.3%
associate-*r/84.3%
Simplified84.3%
associate-*l/97.9%
Applied egg-rr97.9%
Taylor expanded in x around 0 54.9%
Final simplification50.7%
(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 83.5%
*-commutative83.5%
associate-*r/83.8%
Simplified83.8%
Taylor expanded in x around 0 44.3%
Final simplification44.3%
(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 2023230
(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))