
(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 10 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 4e+213) 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 <= 4e+213) {
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 <= 4d+213) 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 <= 4e+213) {
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 <= 4e+213: 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 <= 4e+213) 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 <= 4e+213) 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, 4e+213], 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 4 \cdot 10^{+213}:\\
\;\;\;\;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) < 3.99999999999999994e213Initial program 99.8%
if 3.99999999999999994e213 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 75.8%
associate-*r/69.0%
associate-/r*71.1%
Simplified71.1%
associate-*r/79.8%
*-commutative79.8%
frac-times75.8%
associate-*l/100.0%
Applied egg-rr100.0%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(if (<= x -4.1e+194)
(* 0.5 (* y (/ x z)))
(if (or (<= x -1.5e-8) (not (<= x 1e-14)))
(* (cosh x) (/ y (* x z)))
(/ (/ y x) z))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.1e+194) {
tmp = 0.5 * (y * (x / z));
} else if ((x <= -1.5e-8) || !(x <= 1e-14)) {
tmp = cosh(x) * (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 (x <= (-4.1d+194)) then
tmp = 0.5d0 * (y * (x / z))
else if ((x <= (-1.5d-8)) .or. (.not. (x <= 1d-14))) then
tmp = cosh(x) * (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 (x <= -4.1e+194) {
tmp = 0.5 * (y * (x / z));
} else if ((x <= -1.5e-8) || !(x <= 1e-14)) {
tmp = Math.cosh(x) * (y / (x * z));
} else {
tmp = (y / x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.1e+194: tmp = 0.5 * (y * (x / z)) elif (x <= -1.5e-8) or not (x <= 1e-14): tmp = math.cosh(x) * (y / (x * z)) else: tmp = (y / x) / z return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.1e+194) tmp = Float64(0.5 * Float64(y * Float64(x / z))); elseif ((x <= -1.5e-8) || !(x <= 1e-14)) tmp = Float64(cosh(x) * 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 (x <= -4.1e+194) tmp = 0.5 * (y * (x / z)); elseif ((x <= -1.5e-8) || ~((x <= 1e-14))) tmp = cosh(x) * (y / (x * z)); else tmp = (y / x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.1e+194], N[(0.5 * N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -1.5e-8], N[Not[LessEqual[x, 1e-14]], $MachinePrecision]], N[(N[Cosh[x], $MachinePrecision] * N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.1 \cdot 10^{+194}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{z}\right)\\
\mathbf{elif}\;x \leq -1.5 \cdot 10^{-8} \lor \neg \left(x \leq 10^{-14}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\
\end{array}
\end{array}
if x < -4.1e194Initial program 64.7%
Taylor expanded in x around 0 54.5%
Taylor expanded in x around inf 54.5%
associate-/l*43.8%
associate-/r/55.1%
Simplified55.1%
if -4.1e194 < x < -1.49999999999999987e-8 or 9.99999999999999999e-15 < x Initial program 85.1%
associate-*r/76.3%
associate-/r*78.9%
Simplified78.9%
if -1.49999999999999987e-8 < x < 9.99999999999999999e-15Initial program 98.2%
Taylor expanded in x around 0 98.2%
Final simplification86.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.5e+35) (not (<= z 5e-126))) (* (/ y x) (/ (cosh x) z)) (/ (cosh x) (* x (/ z y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.5e+35) || !(z <= 5e-126)) {
tmp = (y / x) * (cosh(x) / z);
} else {
tmp = cosh(x) / (x * (z / y));
}
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.5d+35)) .or. (.not. (z <= 5d-126))) then
tmp = (y / x) * (cosh(x) / z)
else
tmp = cosh(x) / (x * (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.5e+35) || !(z <= 5e-126)) {
tmp = (y / x) * (Math.cosh(x) / z);
} else {
tmp = Math.cosh(x) / (x * (z / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.5e+35) or not (z <= 5e-126): tmp = (y / x) * (math.cosh(x) / z) else: tmp = math.cosh(x) / (x * (z / y)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.5e+35) || !(z <= 5e-126)) tmp = Float64(Float64(y / x) * Float64(cosh(x) / z)); else tmp = Float64(cosh(x) / Float64(x * Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.5e+35) || ~((z <= 5e-126))) tmp = (y / x) * (cosh(x) / z); else tmp = cosh(x) / (x * (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.5e+35], N[Not[LessEqual[z, 5e-126]], $MachinePrecision]], N[(N[(y / x), $MachinePrecision] * N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[Cosh[x], $MachinePrecision] / N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+35} \lor \neg \left(z \leq 5 \cdot 10^{-126}\right):\\
\;\;\;\;\frac{y}{x} \cdot \frac{\cosh x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x}{x \cdot \frac{z}{y}}\\
\end{array}
\end{array}
if z < -1.49999999999999995e35 or 5.00000000000000006e-126 < z Initial program 90.7%
associate-*l/90.7%
Simplified90.7%
if -1.49999999999999995e35 < z < 5.00000000000000006e-126Initial program 89.6%
associate-/l*89.5%
Simplified89.5%
associate-/r/96.7%
Applied egg-rr96.7%
Final simplification93.6%
(FPCore (x y z) :precision binary64 (* (/ y x) (/ (cosh x) z)))
double code(double x, double y, double z) {
return (y / x) * (cosh(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) * (cosh(x) / z)
end function
public static double code(double x, double y, double z) {
return (y / x) * (Math.cosh(x) / z);
}
def code(x, y, z): return (y / x) * (math.cosh(x) / z)
function code(x, y, z) return Float64(Float64(y / x) * Float64(cosh(x) / z)) end
function tmp = code(x, y, z) tmp = (y / x) * (cosh(x) / z); end
code[x_, y_, z_] := N[(N[(y / x), $MachinePrecision] * N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{x} \cdot \frac{\cosh x}{z}
\end{array}
Initial program 90.1%
associate-*l/90.1%
Simplified90.1%
Final simplification90.1%
(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 90.1%
associate-*r/85.4%
associate-/r*79.2%
Simplified79.2%
associate-*r/83.5%
*-commutative83.5%
frac-times90.1%
associate-*l/97.0%
Applied egg-rr97.0%
Final simplification97.0%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.4) (not (<= x 1.42))) (* 0.5 (* y (/ x z))) (/ (/ y x) z)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4) || !(x <= 1.42)) {
tmp = 0.5 * (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 ((x <= (-1.4d0)) .or. (.not. (x <= 1.42d0))) then
tmp = 0.5d0 * (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 ((x <= -1.4) || !(x <= 1.42)) {
tmp = 0.5 * (y * (x / z));
} else {
tmp = (y / x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.4) or not (x <= 1.42): tmp = 0.5 * (y * (x / z)) else: tmp = (y / x) / z return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.4) || !(x <= 1.42)) tmp = Float64(0.5 * 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 ((x <= -1.4) || ~((x <= 1.42))) tmp = 0.5 * (y * (x / 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.42]], $MachinePrecision]], N[(0.5 * N[(y * N[(x / z), $MachinePrecision]), $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.42\right):\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\
\end{array}
\end{array}
if x < -1.3999999999999999 or 1.4199999999999999 < x Initial program 81.7%
Taylor expanded in x around 0 41.3%
Taylor expanded in x around inf 41.3%
associate-/l*35.5%
associate-/r/43.0%
Simplified43.0%
if -1.3999999999999999 < x < 1.4199999999999999Initial program 98.3%
Taylor expanded in x around 0 97.0%
Final simplification70.4%
(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 90.1%
Taylor expanded in x around 0 69.8%
Final simplification69.8%
(FPCore (x y z) :precision binary64 (if (<= z -5e+63) (/ y (* x z)) (/ (/ y z) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -5e+63) {
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 <= (-5d+63)) 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 <= -5e+63) {
tmp = y / (x * z);
} else {
tmp = (y / z) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5e+63: tmp = y / (x * z) else: tmp = (y / z) / x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5e+63) 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 <= -5e+63) tmp = y / (x * z); else tmp = (y / z) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5e+63], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+63}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\end{array}
\end{array}
if z < -5.00000000000000011e63Initial program 95.4%
associate-*r/81.8%
associate-/r*72.5%
Simplified72.5%
Taylor expanded in x around 0 53.5%
if -5.00000000000000011e63 < z Initial program 89.0%
associate-*r/86.2%
associate-/r*80.6%
Simplified80.6%
associate-*r/84.9%
*-commutative84.9%
frac-times89.0%
associate-*l/98.9%
Applied egg-rr98.9%
Taylor expanded in x around 0 59.0%
Final simplification58.0%
(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 90.1%
associate-*r/85.4%
associate-/r*79.2%
Simplified79.2%
Taylor expanded in x around 0 47.1%
Final simplification47.1%
(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(Float64(y / x) / z) end
function tmp = code(x, y, z) tmp = (y / x) / z; end
code[x_, y_, z_] := N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{x}}{z}
\end{array}
Initial program 90.1%
Taylor expanded in x around 0 53.0%
Final simplification53.0%
(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 2023287
(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))