
(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) x)))
(if (<= y -4000000.0)
(* (/ y z) t_0)
(if (<= y 2e+125) (/ (* y t_0) z) (* (cosh x) (/ (/ y z) x))))))
double code(double x, double y, double z) {
double t_0 = cosh(x) / x;
double tmp;
if (y <= -4000000.0) {
tmp = (y / z) * t_0;
} else if (y <= 2e+125) {
tmp = (y * t_0) / z;
} else {
tmp = cosh(x) * ((y / z) / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = cosh(x) / x
if (y <= (-4000000.0d0)) then
tmp = (y / z) * t_0
else if (y <= 2d+125) then
tmp = (y * t_0) / z
else
tmp = cosh(x) * ((y / z) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.cosh(x) / x;
double tmp;
if (y <= -4000000.0) {
tmp = (y / z) * t_0;
} else if (y <= 2e+125) {
tmp = (y * t_0) / z;
} else {
tmp = Math.cosh(x) * ((y / z) / x);
}
return tmp;
}
def code(x, y, z): t_0 = math.cosh(x) / x tmp = 0 if y <= -4000000.0: tmp = (y / z) * t_0 elif y <= 2e+125: tmp = (y * t_0) / z else: tmp = math.cosh(x) * ((y / z) / x) return tmp
function code(x, y, z) t_0 = Float64(cosh(x) / x) tmp = 0.0 if (y <= -4000000.0) tmp = Float64(Float64(y / z) * t_0); elseif (y <= 2e+125) tmp = Float64(Float64(y * t_0) / z); else tmp = Float64(cosh(x) * Float64(Float64(y / z) / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = cosh(x) / x; tmp = 0.0; if (y <= -4000000.0) tmp = (y / z) * t_0; elseif (y <= 2e+125) tmp = (y * t_0) / z; else tmp = cosh(x) * ((y / z) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[y, -4000000.0], N[(N[(y / z), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y, 2e+125], N[(N[(y * t$95$0), $MachinePrecision] / z), $MachinePrecision], N[(N[Cosh[x], $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\cosh x}{x}\\
\mathbf{if}\;y \leq -4000000:\\
\;\;\;\;\frac{y}{z} \cdot t_0\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+125}:\\
\;\;\;\;\frac{y \cdot t_0}{z}\\
\mathbf{else}:\\
\;\;\;\;\cosh x \cdot \frac{\frac{y}{z}}{x}\\
\end{array}
\end{array}
if y < -4e6Initial program 88.7%
associate-/l*84.2%
associate-/r/95.3%
Simplified95.3%
*-un-lft-identity95.3%
times-frac99.8%
clear-num99.9%
Applied egg-rr99.9%
if -4e6 < y < 1.9999999999999998e125Initial program 80.7%
associate-*r/71.5%
associate-/l/74.1%
associate-/r*73.8%
Simplified73.8%
associate-/l/74.1%
associate-*r/80.4%
associate-*l/80.3%
associate-/r*95.2%
associate-*l/99.7%
Applied egg-rr99.7%
if 1.9999999999999998e125 < y Initial program 87.9%
associate-*r/87.9%
associate-/l/89.2%
associate-/r*100.0%
Simplified100.0%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* (cosh x) (/ y x)))) (if (<= t_0 2e+223) (/ t_0 z) (* (/ y z) (/ (cosh x) x)))))
double code(double x, double y, double z) {
double t_0 = cosh(x) * (y / x);
double tmp;
if (t_0 <= 2e+223) {
tmp = t_0 / z;
} else {
tmp = (y / z) * (cosh(x) / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = cosh(x) * (y / x)
if (t_0 <= 2d+223) then
tmp = t_0 / z
else
tmp = (y / z) * (cosh(x) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.cosh(x) * (y / x);
double tmp;
if (t_0 <= 2e+223) {
tmp = t_0 / z;
} else {
tmp = (y / z) * (Math.cosh(x) / x);
}
return tmp;
}
def code(x, y, z): t_0 = math.cosh(x) * (y / x) tmp = 0 if t_0 <= 2e+223: tmp = t_0 / z else: tmp = (y / z) * (math.cosh(x) / x) return tmp
function code(x, y, z) t_0 = Float64(cosh(x) * Float64(y / x)) tmp = 0.0 if (t_0 <= 2e+223) tmp = Float64(t_0 / z); else tmp = Float64(Float64(y / z) * Float64(cosh(x) / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = cosh(x) * (y / x); tmp = 0.0; if (t_0 <= 2e+223) tmp = t_0 / z; else tmp = (y / z) * (cosh(x) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e+223], N[(t$95$0 / z), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cosh x \cdot \frac{y}{x}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{+223}:\\
\;\;\;\;\frac{t_0}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{\cosh x}{x}\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 y x)) < 2.00000000000000009e223Initial program 96.7%
if 2.00000000000000009e223 < (*.f64 (cosh.f64 x) (/.f64 y x)) Initial program 64.6%
associate-/l*56.5%
associate-/r/77.0%
Simplified77.0%
*-un-lft-identity77.0%
times-frac89.9%
clear-num90.9%
Applied egg-rr90.9%
Final simplification94.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (cosh x) (/ (/ y z) x))))
(if (<= y -1.9e+51)
t_0
(if (<= y -1.35e-142)
(* (/ y x) (/ (cosh x) z))
(if (<= y 2.05e-76) (* y (/ (cosh x) (* z x))) t_0)))))
double code(double x, double y, double z) {
double t_0 = cosh(x) * ((y / z) / x);
double tmp;
if (y <= -1.9e+51) {
tmp = t_0;
} else if (y <= -1.35e-142) {
tmp = (y / x) * (cosh(x) / z);
} else if (y <= 2.05e-76) {
tmp = y * (cosh(x) / (z * x));
} 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 = cosh(x) * ((y / z) / x)
if (y <= (-1.9d+51)) then
tmp = t_0
else if (y <= (-1.35d-142)) then
tmp = (y / x) * (cosh(x) / z)
else if (y <= 2.05d-76) then
tmp = y * (cosh(x) / (z * x))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.cosh(x) * ((y / z) / x);
double tmp;
if (y <= -1.9e+51) {
tmp = t_0;
} else if (y <= -1.35e-142) {
tmp = (y / x) * (Math.cosh(x) / z);
} else if (y <= 2.05e-76) {
tmp = y * (Math.cosh(x) / (z * x));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = math.cosh(x) * ((y / z) / x) tmp = 0 if y <= -1.9e+51: tmp = t_0 elif y <= -1.35e-142: tmp = (y / x) * (math.cosh(x) / z) elif y <= 2.05e-76: tmp = y * (math.cosh(x) / (z * x)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(cosh(x) * Float64(Float64(y / z) / x)) tmp = 0.0 if (y <= -1.9e+51) tmp = t_0; elseif (y <= -1.35e-142) tmp = Float64(Float64(y / x) * Float64(cosh(x) / z)); elseif (y <= 2.05e-76) tmp = Float64(y * Float64(cosh(x) / Float64(z * x))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = cosh(x) * ((y / z) / x); tmp = 0.0; if (y <= -1.9e+51) tmp = t_0; elseif (y <= -1.35e-142) tmp = (y / x) * (cosh(x) / z); elseif (y <= 2.05e-76) tmp = y * (cosh(x) / (z * x)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Cosh[x], $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.9e+51], t$95$0, If[LessEqual[y, -1.35e-142], N[(N[(y / x), $MachinePrecision] * N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.05e-76], N[(y * N[(N[Cosh[x], $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cosh x \cdot \frac{\frac{y}{z}}{x}\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{+51}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-142}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{\cosh x}{z}\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-76}:\\
\;\;\;\;y \cdot \frac{\cosh x}{z \cdot x}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -1.8999999999999999e51 or 2.0499999999999999e-76 < y Initial program 90.3%
associate-*r/87.4%
associate-/l/87.5%
associate-/r*97.0%
Simplified97.0%
if -1.8999999999999999e51 < y < -1.3499999999999999e-142Initial program 95.3%
*-commutative95.3%
associate-*r/95.3%
Simplified95.3%
if -1.3499999999999999e-142 < y < 2.0499999999999999e-76Initial program 65.5%
associate-*r/99.7%
associate-/l/81.0%
associate-*l/80.9%
*-commutative80.9%
*-commutative80.9%
Simplified80.9%
Final simplification92.1%
(FPCore (x y z) :precision binary64 (if (or (<= y -2e-53) (not (<= y 2e-76))) (* (cosh x) (/ (/ y z) x)) (* y (/ (cosh x) (* z x)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2e-53) || !(y <= 2e-76)) {
tmp = cosh(x) * ((y / z) / x);
} 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) :: tmp
if ((y <= (-2d-53)) .or. (.not. (y <= 2d-76))) then
tmp = cosh(x) * ((y / z) / x)
else
tmp = y * (cosh(x) / (z * x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -2e-53) || !(y <= 2e-76)) {
tmp = Math.cosh(x) * ((y / z) / x);
} else {
tmp = y * (Math.cosh(x) / (z * x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2e-53) or not (y <= 2e-76): tmp = math.cosh(x) * ((y / z) / x) else: tmp = y * (math.cosh(x) / (z * x)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2e-53) || !(y <= 2e-76)) tmp = Float64(cosh(x) * Float64(Float64(y / z) / x)); else tmp = Float64(y * Float64(cosh(x) / Float64(z * x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2e-53) || ~((y <= 2e-76))) tmp = cosh(x) * ((y / z) / x); else tmp = y * (cosh(x) / (z * x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2e-53], N[Not[LessEqual[y, 2e-76]], $MachinePrecision]], N[(N[Cosh[x], $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[Cosh[x], $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-53} \lor \neg \left(y \leq 2 \cdot 10^{-76}\right):\\
\;\;\;\;\cosh x \cdot \frac{\frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\cosh x}{z \cdot x}\\
\end{array}
\end{array}
if y < -2.00000000000000006e-53 or 1.99999999999999985e-76 < y Initial program 91.9%
associate-*r/86.4%
associate-/l/86.5%
associate-/r*94.4%
Simplified94.4%
if -2.00000000000000006e-53 < y < 1.99999999999999985e-76Initial program 70.3%
associate-*r/99.7%
associate-/l/80.7%
associate-*l/80.6%
*-commutative80.6%
*-commutative80.6%
Simplified80.6%
Final simplification89.4%
(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(cosh(x) / Float64(z * x))) end
function tmp = code(x, y, z) tmp = y * (cosh(x) / (z * x)); end
code[x_, y_, z_] := N[(y * N[(N[Cosh[x], $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \frac{\cosh x}{z \cdot x}
\end{array}
Initial program 84.1%
associate-*r/94.7%
associate-/l/84.4%
associate-*l/84.3%
*-commutative84.3%
*-commutative84.3%
Simplified84.3%
Final simplification84.3%
(FPCore (x y z) :precision binary64 (* (/ y z) (/ (cosh x) x)))
double code(double x, double y, double z) {
return (y / z) * (cosh(x) / 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) * (cosh(x) / x)
end function
public static double code(double x, double y, double z) {
return (y / z) * (Math.cosh(x) / x);
}
def code(x, y, z): return (y / z) * (math.cosh(x) / x)
function code(x, y, z) return Float64(Float64(y / z) * Float64(cosh(x) / x)) end
function tmp = code(x, y, z) tmp = (y / z) * (cosh(x) / x); end
code[x_, y_, z_] := N[(N[(y / z), $MachinePrecision] * N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{z} \cdot \frac{\cosh x}{x}
\end{array}
Initial program 84.1%
associate-/l*77.4%
associate-/r/83.3%
Simplified83.3%
*-un-lft-identity83.3%
times-frac91.4%
clear-num92.4%
Applied egg-rr92.4%
Final simplification92.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ y x) (/ 0.5 (/ z (* x x))))))
(if (<= x -5e+91)
t_0
(if (<= x 2.75e+169)
(* y (/ (+ (* x 0.5) (/ 1.0 x)) z))
(if (<= x 1.95e+241) t_0 (* 0.5 (/ y (/ z x))))))))
double code(double x, double y, double z) {
double t_0 = (y / x) * (0.5 / (z / (x * x)));
double tmp;
if (x <= -5e+91) {
tmp = t_0;
} else if (x <= 2.75e+169) {
tmp = y * (((x * 0.5) + (1.0 / x)) / z);
} else if (x <= 1.95e+241) {
tmp = t_0;
} else {
tmp = 0.5 * (y / (z / x));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (y / x) * (0.5d0 / (z / (x * x)))
if (x <= (-5d+91)) then
tmp = t_0
else if (x <= 2.75d+169) then
tmp = y * (((x * 0.5d0) + (1.0d0 / x)) / z)
else if (x <= 1.95d+241) then
tmp = t_0
else
tmp = 0.5d0 * (y / (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y / x) * (0.5 / (z / (x * x)));
double tmp;
if (x <= -5e+91) {
tmp = t_0;
} else if (x <= 2.75e+169) {
tmp = y * (((x * 0.5) + (1.0 / x)) / z);
} else if (x <= 1.95e+241) {
tmp = t_0;
} else {
tmp = 0.5 * (y / (z / x));
}
return tmp;
}
def code(x, y, z): t_0 = (y / x) * (0.5 / (z / (x * x))) tmp = 0 if x <= -5e+91: tmp = t_0 elif x <= 2.75e+169: tmp = y * (((x * 0.5) + (1.0 / x)) / z) elif x <= 1.95e+241: tmp = t_0 else: tmp = 0.5 * (y / (z / x)) return tmp
function code(x, y, z) t_0 = Float64(Float64(y / x) * Float64(0.5 / Float64(z / Float64(x * x)))) tmp = 0.0 if (x <= -5e+91) tmp = t_0; elseif (x <= 2.75e+169) tmp = Float64(y * Float64(Float64(Float64(x * 0.5) + Float64(1.0 / x)) / z)); elseif (x <= 1.95e+241) tmp = t_0; else tmp = Float64(0.5 * Float64(y / Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y / x) * (0.5 / (z / (x * x))); tmp = 0.0; if (x <= -5e+91) tmp = t_0; elseif (x <= 2.75e+169) tmp = y * (((x * 0.5) + (1.0 / x)) / z); elseif (x <= 1.95e+241) tmp = t_0; else tmp = 0.5 * (y / (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y / x), $MachinePrecision] * N[(0.5 / N[(z / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5e+91], t$95$0, If[LessEqual[x, 2.75e+169], N[(y * N[(N[(N[(x * 0.5), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.95e+241], t$95$0, N[(0.5 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x} \cdot \frac{0.5}{\frac{z}{x \cdot x}}\\
\mathbf{if}\;x \leq -5 \cdot 10^{+91}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.75 \cdot 10^{+169}:\\
\;\;\;\;y \cdot \frac{x \cdot 0.5 + \frac{1}{x}}{z}\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{+241}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if x < -5.0000000000000002e91 or 2.74999999999999986e169 < x < 1.95000000000000013e241Initial program 80.6%
associate-*r/100.0%
associate-/l/64.2%
associate-*l/64.2%
*-commutative64.2%
*-commutative64.2%
Simplified64.2%
Taylor expanded in x around 0 54.2%
associate-/r*54.2%
associate-*r/54.2%
frac-add57.1%
*-commutative57.1%
Applied egg-rr57.1%
Taylor expanded in y around 0 57.1%
times-frac73.4%
unpow273.4%
Simplified73.4%
Taylor expanded in x around inf 73.4%
associate-*r/73.4%
associate-/l*73.4%
unpow273.4%
Simplified73.4%
if -5.0000000000000002e91 < x < 2.74999999999999986e169Initial program 88.7%
associate-*r/92.1%
associate-/l/93.7%
associate-*l/93.6%
*-commutative93.6%
*-commutative93.6%
Simplified93.6%
Taylor expanded in x around 0 73.7%
Taylor expanded in z around 0 73.7%
if 1.95000000000000013e241 < x Initial program 46.7%
associate-*r/100.0%
associate-/l/66.7%
associate-*l/66.7%
*-commutative66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in x around 0 61.5%
Taylor expanded in x around inf 55.7%
associate-/l*61.5%
Simplified61.5%
Final simplification72.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -9.5e+183) (not (<= z 3.2e+104))) (* (/ y x) (/ (+ 1.0 (* 0.5 (* x x))) z)) (* y (/ (+ 1.0 (* x (* x 0.5))) (* z x)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -9.5e+183) || !(z <= 3.2e+104)) {
tmp = (y / x) * ((1.0 + (0.5 * (x * x))) / z);
} else {
tmp = y * ((1.0 + (x * (x * 0.5))) / (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 <= (-9.5d+183)) .or. (.not. (z <= 3.2d+104))) then
tmp = (y / x) * ((1.0d0 + (0.5d0 * (x * x))) / z)
else
tmp = y * ((1.0d0 + (x * (x * 0.5d0))) / (z * x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -9.5e+183) || !(z <= 3.2e+104)) {
tmp = (y / x) * ((1.0 + (0.5 * (x * x))) / z);
} else {
tmp = y * ((1.0 + (x * (x * 0.5))) / (z * x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -9.5e+183) or not (z <= 3.2e+104): tmp = (y / x) * ((1.0 + (0.5 * (x * x))) / z) else: tmp = y * ((1.0 + (x * (x * 0.5))) / (z * x)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -9.5e+183) || !(z <= 3.2e+104)) tmp = Float64(Float64(y / x) * Float64(Float64(1.0 + Float64(0.5 * Float64(x * x))) / z)); else tmp = Float64(y * Float64(Float64(1.0 + Float64(x * Float64(x * 0.5))) / Float64(z * x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -9.5e+183) || ~((z <= 3.2e+104))) tmp = (y / x) * ((1.0 + (0.5 * (x * x))) / z); else tmp = y * ((1.0 + (x * (x * 0.5))) / (z * x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -9.5e+183], N[Not[LessEqual[z, 3.2e+104]], $MachinePrecision]], N[(N[(y / x), $MachinePrecision] * N[(N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(1.0 + N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+183} \lor \neg \left(z \leq 3.2 \cdot 10^{+104}\right):\\
\;\;\;\;\frac{y}{x} \cdot \frac{1 + 0.5 \cdot \left(x \cdot x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{1 + x \cdot \left(x \cdot 0.5\right)}{z \cdot x}\\
\end{array}
\end{array}
if z < -9.5000000000000003e183 or 3.2e104 < z Initial program 77.9%
associate-*r/88.5%
associate-/l/60.4%
associate-*l/60.3%
*-commutative60.3%
*-commutative60.3%
Simplified60.3%
Taylor expanded in x around 0 48.1%
associate-/r*48.1%
associate-*r/48.1%
frac-add45.2%
*-commutative45.2%
Applied egg-rr45.2%
Taylor expanded in y around 0 46.7%
times-frac59.7%
unpow259.7%
Simplified59.7%
if -9.5000000000000003e183 < z < 3.2e104Initial program 86.3%
associate-*r/96.8%
associate-/l/92.7%
associate-*l/92.7%
*-commutative92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in x around 0 74.8%
associate-/r*74.8%
associate-*r/74.8%
frac-add77.1%
*-commutative77.1%
Applied egg-rr77.1%
Taylor expanded in z around 0 77.1%
Final simplification72.6%
(FPCore (x y z) :precision binary64 (if (<= z -1.9e+183) (/ (+ (/ y x) (* 0.5 (* y x))) z) (* y (/ (+ 1.0 (* x (* x 0.5))) (* z x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.9e+183) {
tmp = ((y / x) + (0.5 * (y * x))) / z;
} else {
tmp = y * ((1.0 + (x * (x * 0.5))) / (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.9d+183)) then
tmp = ((y / x) + (0.5d0 * (y * x))) / z
else
tmp = y * ((1.0d0 + (x * (x * 0.5d0))) / (z * x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.9e+183) {
tmp = ((y / x) + (0.5 * (y * x))) / z;
} else {
tmp = y * ((1.0 + (x * (x * 0.5))) / (z * x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.9e+183: tmp = ((y / x) + (0.5 * (y * x))) / z else: tmp = y * ((1.0 + (x * (x * 0.5))) / (z * x)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.9e+183) tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(y * x))) / z); else tmp = Float64(y * Float64(Float64(1.0 + Float64(x * Float64(x * 0.5))) / Float64(z * x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.9e+183) tmp = ((y / x) + (0.5 * (y * x))) / z; else tmp = y * ((1.0 + (x * (x * 0.5))) / (z * x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.9e+183], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y * N[(N[(1.0 + N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+183}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(y \cdot x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{1 + x \cdot \left(x \cdot 0.5\right)}{z \cdot x}\\
\end{array}
\end{array}
if z < -1.9e183Initial program 83.2%
Taylor expanded in x around 0 56.3%
if -1.9e183 < z Initial program 84.2%
associate-*r/94.9%
associate-/l/88.0%
associate-*l/87.9%
*-commutative87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in x around 0 70.7%
associate-/r*70.8%
associate-*r/70.8%
frac-add72.0%
*-commutative72.0%
Applied egg-rr72.0%
Taylor expanded in z around 0 72.0%
Final simplification70.6%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.4) (not (<= x 1.42))) (* 0.5 (* (/ y z) x)) (/ y (* z x))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4) || !(x <= 1.42)) {
tmp = 0.5 * ((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 ((x <= (-1.4d0)) .or. (.not. (x <= 1.42d0))) then
tmp = 0.5d0 * ((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 ((x <= -1.4) || !(x <= 1.42)) {
tmp = 0.5 * ((y / z) * x);
} else {
tmp = y / (z * x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.4) or not (x <= 1.42): tmp = 0.5 * ((y / z) * x) else: tmp = y / (z * x) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.4) || !(x <= 1.42)) tmp = Float64(0.5 * Float64(Float64(y / z) * x)); else tmp = Float64(y / Float64(z * x)); 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 / z) * x); else tmp = y / (z * x); 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[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * x), $MachinePrecision]), $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(\frac{y}{z} \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot x}\\
\end{array}
\end{array}
if x < -1.3999999999999999 or 1.4199999999999999 < x Initial program 79.4%
associate-*r/100.0%
associate-/l/74.8%
associate-*l/74.8%
*-commutative74.8%
*-commutative74.8%
Simplified74.8%
Taylor expanded in x around 0 43.5%
associate-/r*43.5%
associate-*r/43.5%
frac-add45.4%
*-commutative45.4%
Applied egg-rr45.4%
Taylor expanded in x around inf 44.3%
associate-/l*42.8%
associate-/r/36.3%
Simplified36.3%
if -1.3999999999999999 < x < 1.4199999999999999Initial program 89.1%
associate-*r/89.1%
associate-/l/94.4%
associate-/r*92.5%
Simplified92.5%
Taylor expanded in x around 0 92.5%
Final simplification63.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.4) (not (<= x 1.42))) (* 0.5 (/ y (/ z x))) (/ y (* z x))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4) || !(x <= 1.42)) {
tmp = 0.5 * (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 ((x <= (-1.4d0)) .or. (.not. (x <= 1.42d0))) then
tmp = 0.5d0 * (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 ((x <= -1.4) || !(x <= 1.42)) {
tmp = 0.5 * (y / (z / x));
} else {
tmp = y / (z * x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.4) or not (x <= 1.42): tmp = 0.5 * (y / (z / x)) else: tmp = y / (z * x) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.4) || !(x <= 1.42)) tmp = Float64(0.5 * Float64(y / Float64(z / x))); else tmp = Float64(y / Float64(z * x)); 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 / (z / x)); else tmp = y / (z * x); 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[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \lor \neg \left(x \leq 1.42\right):\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot x}\\
\end{array}
\end{array}
if x < -1.3999999999999999 or 1.4199999999999999 < x Initial program 79.4%
associate-*r/100.0%
associate-/l/74.8%
associate-*l/74.8%
*-commutative74.8%
*-commutative74.8%
Simplified74.8%
Taylor expanded in x around 0 43.5%
Taylor expanded in x around inf 44.3%
associate-/l*42.8%
Simplified42.8%
if -1.3999999999999999 < x < 1.4199999999999999Initial program 89.1%
associate-*r/89.1%
associate-/l/94.4%
associate-/r*92.5%
Simplified92.5%
Taylor expanded in x around 0 92.5%
Final simplification67.0%
(FPCore (x y z) :precision binary64 (if (<= x -1.4) (* 0.5 (/ y (/ z x))) (if (<= x 1.42) (/ y (* z x)) (* 0.5 (/ (* y x) z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.4) {
tmp = 0.5 * (y / (z / x));
} else if (x <= 1.42) {
tmp = y / (z * x);
} else {
tmp = 0.5 * ((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)) then
tmp = 0.5d0 * (y / (z / x))
else if (x <= 1.42d0) then
tmp = y / (z * x)
else
tmp = 0.5d0 * ((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) {
tmp = 0.5 * (y / (z / x));
} else if (x <= 1.42) {
tmp = y / (z * x);
} else {
tmp = 0.5 * ((y * x) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.4: tmp = 0.5 * (y / (z / x)) elif x <= 1.42: tmp = y / (z * x) else: tmp = 0.5 * ((y * x) / z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.4) tmp = Float64(0.5 * Float64(y / Float64(z / x))); elseif (x <= 1.42) tmp = Float64(y / Float64(z * x)); else tmp = Float64(0.5 * Float64(Float64(y * x) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.4) tmp = 0.5 * (y / (z / x)); elseif (x <= 1.42) tmp = y / (z * x); else tmp = 0.5 * ((y * x) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.4], N[(0.5 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.42], N[(y / N[(z * x), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4:\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;x \leq 1.42:\\
\;\;\;\;\frac{y}{z \cdot x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{z}\\
\end{array}
\end{array}
if x < -1.3999999999999999Initial program 83.8%
associate-*r/100.0%
associate-/l/73.5%
associate-*l/73.5%
*-commutative73.5%
*-commutative73.5%
Simplified73.5%
Taylor expanded in x around 0 46.3%
Taylor expanded in x around inf 44.9%
associate-/l*46.3%
Simplified46.3%
if -1.3999999999999999 < x < 1.4199999999999999Initial program 89.1%
associate-*r/89.1%
associate-/l/94.4%
associate-/r*92.5%
Simplified92.5%
Taylor expanded in x around 0 92.5%
if 1.4199999999999999 < x Initial program 74.6%
associate-*r/100.0%
associate-/l/76.2%
associate-*l/76.2%
*-commutative76.2%
*-commutative76.2%
Simplified76.2%
Taylor expanded in x around 0 40.4%
Taylor expanded in x around inf 43.6%
Final simplification68.2%
(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(y * Float64(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[(y * N[(N[(N[(x * 0.5), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \frac{x \cdot 0.5 + \frac{1}{x}}{z}
\end{array}
Initial program 84.1%
associate-*r/94.7%
associate-/l/84.4%
associate-*l/84.3%
*-commutative84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in x around 0 67.9%
Taylor expanded in z around 0 67.9%
Final simplification67.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -5e-21) (not (<= z 6.5e-25))) (/ y (* z x)) (/ (/ y z) x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5e-21) || !(z <= 6.5e-25)) {
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 <= (-5d-21)) .or. (.not. (z <= 6.5d-25))) 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 <= -5e-21) || !(z <= 6.5e-25)) {
tmp = y / (z * x);
} else {
tmp = (y / z) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5e-21) or not (z <= 6.5e-25): tmp = y / (z * x) else: tmp = (y / z) / x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5e-21) || !(z <= 6.5e-25)) 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 <= -5e-21) || ~((z <= 6.5e-25))) tmp = y / (z * x); else tmp = (y / z) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5e-21], N[Not[LessEqual[z, 6.5e-25]], $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 -5 \cdot 10^{-21} \lor \neg \left(z \leq 6.5 \cdot 10^{-25}\right):\\
\;\;\;\;\frac{y}{z \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\end{array}
\end{array}
if z < -4.99999999999999973e-21 or 6.5e-25 < z Initial program 80.1%
associate-*r/68.8%
associate-/l/69.7%
associate-/r*72.1%
Simplified72.1%
Taylor expanded in x around 0 52.0%
if -4.99999999999999973e-21 < z < 6.5e-25Initial program 88.4%
associate-*r/99.8%
associate-/l/94.6%
associate-*l/94.5%
*-commutative94.5%
*-commutative94.5%
Simplified94.5%
Taylor expanded in x around 0 45.5%
div-inv45.5%
associate-/r*63.9%
Applied egg-rr63.9%
Final simplification57.7%
(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 84.1%
associate-*r/78.3%
associate-/l/80.9%
associate-/r*84.6%
Simplified84.6%
Taylor expanded in x around 0 48.9%
Final simplification48.9%
(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 2023240
(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))