
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (cosh(x) * (y / x)) / z
end function
public static double code(double x, double y, double z) {
return (Math.cosh(x) * (y / x)) / z;
}
def code(x, y, z): return (math.cosh(x) * (y / x)) / z
function code(x, y, z) return Float64(Float64(cosh(x) * Float64(y / x)) / z) end
function tmp = code(x, y, z) tmp = (cosh(x) * (y / x)) / z; end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cosh x \cdot \frac{y}{x}}{z}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= y -5e-41) (/ (/ (* y (cosh x)) z) x) (/ (* y (/ (cosh x) x)) z)))
double code(double x, double y, double z) {
double tmp;
if (y <= -5e-41) {
tmp = ((y * cosh(x)) / z) / x;
} else {
tmp = (y * (cosh(x) / 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 <= (-5d-41)) then
tmp = ((y * cosh(x)) / z) / x
else
tmp = (y * (cosh(x) / x)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -5e-41) {
tmp = ((y * Math.cosh(x)) / z) / x;
} else {
tmp = (y * (Math.cosh(x) / x)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5e-41: tmp = ((y * math.cosh(x)) / z) / x else: tmp = (y * (math.cosh(x) / x)) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5e-41) tmp = Float64(Float64(Float64(y * cosh(x)) / z) / x); else tmp = Float64(Float64(y * Float64(cosh(x) / x)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -5e-41) tmp = ((y * cosh(x)) / z) / x; else tmp = (y * (cosh(x) / x)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5e-41], N[(N[(N[(y * N[Cosh[x], $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision], N[(N[(y * N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-41}:\\
\;\;\;\;\frac{\frac{y \cdot \cosh x}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{\cosh x}{x}}{z}\\
\end{array}
\end{array}
if y < -4.9999999999999996e-41Initial program 89.1%
associate-*l/89.1%
Simplified89.1%
associate-*r/99.8%
associate-*l/99.9%
Applied egg-rr99.9%
if -4.9999999999999996e-41 < y Initial program 81.7%
expm1-log1p-u44.1%
expm1-udef32.0%
Applied egg-rr32.0%
expm1-def44.1%
expm1-log1p81.7%
associate-*r/97.6%
associate-*l/97.6%
*-commutative97.6%
Simplified97.6%
Final simplification98.4%
(FPCore (x y z)
:precision binary64
(if (<= x -6.8e+134)
(/ (+ (/ (* y (/ (/ z y) x)) x) (* z 0.5)) (* z (/ z (* y x))))
(if (or (<= x -3e-25) (not (<= x 1.2e-101)))
(* (/ (cosh x) z) (/ y x))
(+ (* 0.5 (* y (/ x z))) (/ y (* x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -6.8e+134) {
tmp = (((y * ((z / y) / x)) / x) + (z * 0.5)) / (z * (z / (y * x)));
} else if ((x <= -3e-25) || !(x <= 1.2e-101)) {
tmp = (cosh(x) / z) * (y / x);
} else {
tmp = (0.5 * (y * (x / z))) + (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 <= (-6.8d+134)) then
tmp = (((y * ((z / y) / x)) / x) + (z * 0.5d0)) / (z * (z / (y * x)))
else if ((x <= (-3d-25)) .or. (.not. (x <= 1.2d-101))) then
tmp = (cosh(x) / z) * (y / x)
else
tmp = (0.5d0 * (y * (x / z))) + (y / (x * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -6.8e+134) {
tmp = (((y * ((z / y) / x)) / x) + (z * 0.5)) / (z * (z / (y * x)));
} else if ((x <= -3e-25) || !(x <= 1.2e-101)) {
tmp = (Math.cosh(x) / z) * (y / x);
} else {
tmp = (0.5 * (y * (x / z))) + (y / (x * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -6.8e+134: tmp = (((y * ((z / y) / x)) / x) + (z * 0.5)) / (z * (z / (y * x))) elif (x <= -3e-25) or not (x <= 1.2e-101): tmp = (math.cosh(x) / z) * (y / x) else: tmp = (0.5 * (y * (x / z))) + (y / (x * z)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -6.8e+134) tmp = Float64(Float64(Float64(Float64(y * Float64(Float64(z / y) / x)) / x) + Float64(z * 0.5)) / Float64(z * Float64(z / Float64(y * x)))); elseif ((x <= -3e-25) || !(x <= 1.2e-101)) tmp = Float64(Float64(cosh(x) / z) * Float64(y / x)); else tmp = Float64(Float64(0.5 * Float64(y * Float64(x / z))) + Float64(y / Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -6.8e+134) tmp = (((y * ((z / y) / x)) / x) + (z * 0.5)) / (z * (z / (y * x))); elseif ((x <= -3e-25) || ~((x <= 1.2e-101))) tmp = (cosh(x) / z) * (y / x); else tmp = (0.5 * (y * (x / z))) + (y / (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -6.8e+134], N[(N[(N[(N[(y * N[(N[(z / y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] / N[(z * N[(z / N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -3e-25], N[Not[LessEqual[x, 1.2e-101]], $MachinePrecision]], N[(N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+134}:\\
\;\;\;\;\frac{\frac{y \cdot \frac{\frac{z}{y}}{x}}{x} + z \cdot 0.5}{z \cdot \frac{z}{y \cdot x}}\\
\mathbf{elif}\;x \leq -3 \cdot 10^{-25} \lor \neg \left(x \leq 1.2 \cdot 10^{-101}\right):\\
\;\;\;\;\frac{\cosh x}{z} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{z}\right) + \frac{y}{x \cdot z}\\
\end{array}
\end{array}
if x < -6.80000000000000035e134Initial program 63.6%
associate-*l/63.6%
Simplified63.6%
Taylor expanded in x around 0 56.8%
clear-num56.8%
un-div-inv56.8%
associate-/r*51.1%
Applied egg-rr51.1%
+-commutative51.1%
associate-/r*51.1%
frac-add56.7%
associate-/l/56.7%
*-commutative56.7%
associate-/l/70.7%
*-commutative70.7%
Applied egg-rr70.7%
associate-*l/70.7%
*-commutative70.7%
associate-/r*76.6%
Applied egg-rr76.6%
if -6.80000000000000035e134 < x < -2.9999999999999998e-25 or 1.2e-101 < x Initial program 87.7%
associate-*l/87.6%
Simplified87.6%
if -2.9999999999999998e-25 < x < 1.2e-101Initial program 86.7%
associate-*l/86.7%
Simplified86.7%
Taylor expanded in x around 0 93.3%
associate-/l*93.3%
associate-/r/93.3%
Applied egg-rr93.3%
Final simplification88.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -4.4e+136) (not (<= z 9.6e+238))) (* (/ (cosh x) z) (/ y x)) (/ (cosh x) (* x (/ z y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4.4e+136) || !(z <= 9.6e+238)) {
tmp = (cosh(x) / z) * (y / x);
} 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 <= (-4.4d+136)) .or. (.not. (z <= 9.6d+238))) then
tmp = (cosh(x) / z) * (y / x)
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 <= -4.4e+136) || !(z <= 9.6e+238)) {
tmp = (Math.cosh(x) / z) * (y / x);
} else {
tmp = Math.cosh(x) / (x * (z / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4.4e+136) or not (z <= 9.6e+238): tmp = (math.cosh(x) / z) * (y / x) else: tmp = math.cosh(x) / (x * (z / y)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4.4e+136) || !(z <= 9.6e+238)) tmp = Float64(Float64(cosh(x) / z) * Float64(y / x)); 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 <= -4.4e+136) || ~((z <= 9.6e+238))) tmp = (cosh(x) / z) * (y / x); else tmp = cosh(x) / (x * (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4.4e+136], N[Not[LessEqual[z, 9.6e+238]], $MachinePrecision]], N[(N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision] * N[(y / x), $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 -4.4 \cdot 10^{+136} \lor \neg \left(z \leq 9.6 \cdot 10^{+238}\right):\\
\;\;\;\;\frac{\cosh x}{z} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x}{x \cdot \frac{z}{y}}\\
\end{array}
\end{array}
if z < -4.3999999999999999e136 or 9.6e238 < z Initial program 86.5%
associate-*l/86.5%
Simplified86.5%
if -4.3999999999999999e136 < z < 9.6e238Initial program 83.6%
associate-/l*82.6%
associate-/r/91.6%
associate-*l/86.4%
*-commutative86.4%
Simplified86.4%
*-commutative86.4%
associate-/l*82.6%
associate-/r/91.6%
Applied egg-rr91.6%
Final simplification90.5%
(FPCore (x y z) :precision binary64 (if (<= y -1.06e+30) (/ (cosh x) (* x (/ z y))) (/ (* y (/ (cosh x) x)) z)))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.06e+30) {
tmp = cosh(x) / (x * (z / y));
} else {
tmp = (y * (cosh(x) / 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 <= (-1.06d+30)) then
tmp = cosh(x) / (x * (z / y))
else
tmp = (y * (cosh(x) / x)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.06e+30) {
tmp = Math.cosh(x) / (x * (z / y));
} else {
tmp = (y * (Math.cosh(x) / x)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.06e+30: tmp = math.cosh(x) / (x * (z / y)) else: tmp = (y * (math.cosh(x) / x)) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.06e+30) tmp = Float64(cosh(x) / Float64(x * Float64(z / y))); else tmp = Float64(Float64(y * Float64(cosh(x) / x)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.06e+30) tmp = cosh(x) / (x * (z / y)); else tmp = (y * (cosh(x) / x)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.06e+30], N[(N[Cosh[x], $MachinePrecision] / N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.06 \cdot 10^{+30}:\\
\;\;\;\;\frac{\cosh x}{x \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{\cosh x}{x}}{z}\\
\end{array}
\end{array}
if y < -1.06e30Initial program 86.6%
associate-/l*85.2%
associate-/r/98.4%
associate-*l/95.6%
*-commutative95.6%
Simplified95.6%
*-commutative95.6%
associate-/l*85.2%
associate-/r/98.4%
Applied egg-rr98.4%
if -1.06e30 < y Initial program 83.3%
expm1-log1p-u43.4%
expm1-udef32.3%
Applied egg-rr32.3%
expm1-def43.4%
expm1-log1p83.3%
associate-*r/97.8%
associate-*l/97.8%
*-commutative97.8%
Simplified97.8%
Final simplification97.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (/ z y) x))
(t_1 (/ (+ (/ (* y t_0) x) (* z 0.5)) (* z (/ z (* y x))))))
(if (<= x -1.25e+88)
t_1
(if (<= x 1.3e-242)
(+ (/ y (* x z)) (/ 0.5 t_0))
(if (<= x 490.0)
(/ (/ y z) x)
(if (<= x 5.6e+222)
(/ (+ (* (* x z) (* x (* y 0.5))) (* y z)) (* z (* x z)))
t_1))))))
double code(double x, double y, double z) {
double t_0 = (z / y) / x;
double t_1 = (((y * t_0) / x) + (z * 0.5)) / (z * (z / (y * x)));
double tmp;
if (x <= -1.25e+88) {
tmp = t_1;
} else if (x <= 1.3e-242) {
tmp = (y / (x * z)) + (0.5 / t_0);
} else if (x <= 490.0) {
tmp = (y / z) / x;
} else if (x <= 5.6e+222) {
tmp = (((x * z) * (x * (y * 0.5))) + (y * z)) / (z * (x * z));
} else {
tmp = t_1;
}
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 = (z / y) / x
t_1 = (((y * t_0) / x) + (z * 0.5d0)) / (z * (z / (y * x)))
if (x <= (-1.25d+88)) then
tmp = t_1
else if (x <= 1.3d-242) then
tmp = (y / (x * z)) + (0.5d0 / t_0)
else if (x <= 490.0d0) then
tmp = (y / z) / x
else if (x <= 5.6d+222) then
tmp = (((x * z) * (x * (y * 0.5d0))) + (y * z)) / (z * (x * z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z / y) / x;
double t_1 = (((y * t_0) / x) + (z * 0.5)) / (z * (z / (y * x)));
double tmp;
if (x <= -1.25e+88) {
tmp = t_1;
} else if (x <= 1.3e-242) {
tmp = (y / (x * z)) + (0.5 / t_0);
} else if (x <= 490.0) {
tmp = (y / z) / x;
} else if (x <= 5.6e+222) {
tmp = (((x * z) * (x * (y * 0.5))) + (y * z)) / (z * (x * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = (z / y) / x t_1 = (((y * t_0) / x) + (z * 0.5)) / (z * (z / (y * x))) tmp = 0 if x <= -1.25e+88: tmp = t_1 elif x <= 1.3e-242: tmp = (y / (x * z)) + (0.5 / t_0) elif x <= 490.0: tmp = (y / z) / x elif x <= 5.6e+222: tmp = (((x * z) * (x * (y * 0.5))) + (y * z)) / (z * (x * z)) else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(Float64(z / y) / x) t_1 = Float64(Float64(Float64(Float64(y * t_0) / x) + Float64(z * 0.5)) / Float64(z * Float64(z / Float64(y * x)))) tmp = 0.0 if (x <= -1.25e+88) tmp = t_1; elseif (x <= 1.3e-242) tmp = Float64(Float64(y / Float64(x * z)) + Float64(0.5 / t_0)); elseif (x <= 490.0) tmp = Float64(Float64(y / z) / x); elseif (x <= 5.6e+222) tmp = Float64(Float64(Float64(Float64(x * z) * Float64(x * Float64(y * 0.5))) + Float64(y * z)) / Float64(z * Float64(x * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z / y) / x; t_1 = (((y * t_0) / x) + (z * 0.5)) / (z * (z / (y * x))); tmp = 0.0; if (x <= -1.25e+88) tmp = t_1; elseif (x <= 1.3e-242) tmp = (y / (x * z)) + (0.5 / t_0); elseif (x <= 490.0) tmp = (y / z) / x; elseif (x <= 5.6e+222) tmp = (((x * z) * (x * (y * 0.5))) + (y * z)) / (z * (x * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z / y), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(y * t$95$0), $MachinePrecision] / x), $MachinePrecision] + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] / N[(z * N[(z / N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.25e+88], t$95$1, If[LessEqual[x, 1.3e-242], N[(N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(0.5 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 490.0], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 5.6e+222], N[(N[(N[(N[(x * z), $MachinePrecision] * N[(x * N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(z * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{z}{y}}{x}\\
t_1 := \frac{\frac{y \cdot t_0}{x} + z \cdot 0.5}{z \cdot \frac{z}{y \cdot x}}\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{+88}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-242}:\\
\;\;\;\;\frac{y}{x \cdot z} + \frac{0.5}{t_0}\\
\mathbf{elif}\;x \leq 490:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{+222}:\\
\;\;\;\;\frac{\left(x \cdot z\right) \cdot \left(x \cdot \left(y \cdot 0.5\right)\right) + y \cdot z}{z \cdot \left(x \cdot z\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.24999999999999999e88 or 5.6000000000000003e222 < x Initial program 66.7%
associate-*l/66.7%
Simplified66.7%
Taylor expanded in x around 0 62.1%
clear-num62.1%
un-div-inv62.1%
associate-/r*54.6%
Applied egg-rr54.6%
+-commutative54.6%
associate-/r*54.6%
frac-add57.5%
associate-/l/57.5%
*-commutative57.5%
associate-/l/70.8%
*-commutative70.8%
Applied egg-rr70.8%
associate-*l/70.8%
*-commutative70.8%
associate-/r*75.4%
Applied egg-rr75.4%
if -1.24999999999999999e88 < x < 1.30000000000000009e-242Initial program 91.1%
associate-*l/91.1%
Simplified91.1%
Taylor expanded in x around 0 84.0%
clear-num84.0%
un-div-inv84.0%
associate-/r*84.0%
Applied egg-rr84.0%
Taylor expanded in z around 0 84.0%
*-commutative84.0%
Simplified84.0%
Taylor expanded in z around 0 84.0%
associate-/l/84.0%
Simplified84.0%
if 1.30000000000000009e-242 < x < 490Initial program 90.7%
associate-*l/90.5%
Simplified90.5%
associate-*r/97.9%
associate-*l/97.9%
Applied egg-rr97.9%
Taylor expanded in x around 0 96.9%
if 490 < x < 5.6000000000000003e222Initial program 86.4%
associate-*l/86.4%
Simplified86.4%
Taylor expanded in x around 0 32.4%
associate-*r/32.4%
frac-add53.4%
*-commutative53.4%
associate-*l*53.4%
Applied egg-rr53.4%
Final simplification79.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ z (* y x))))
(if (<= x -3e+90)
(/ (+ (* z 0.5) (* (/ y x) t_0)) (* z t_0))
(if (<= x 3.3e-251)
(+ (/ y (* x z)) (/ 0.5 (/ (/ z y) x)))
(if (<= x 17.0)
(/ (/ y z) x)
(/ (+ (* (* x z) (* x (* y 0.5))) (* y z)) (* z (* x z))))))))
double code(double x, double y, double z) {
double t_0 = z / (y * x);
double tmp;
if (x <= -3e+90) {
tmp = ((z * 0.5) + ((y / x) * t_0)) / (z * t_0);
} else if (x <= 3.3e-251) {
tmp = (y / (x * z)) + (0.5 / ((z / y) / x));
} else if (x <= 17.0) {
tmp = (y / z) / x;
} else {
tmp = (((x * z) * (x * (y * 0.5))) + (y * z)) / (z * (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) :: t_0
real(8) :: tmp
t_0 = z / (y * x)
if (x <= (-3d+90)) then
tmp = ((z * 0.5d0) + ((y / x) * t_0)) / (z * t_0)
else if (x <= 3.3d-251) then
tmp = (y / (x * z)) + (0.5d0 / ((z / y) / x))
else if (x <= 17.0d0) then
tmp = (y / z) / x
else
tmp = (((x * z) * (x * (y * 0.5d0))) + (y * z)) / (z * (x * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z / (y * x);
double tmp;
if (x <= -3e+90) {
tmp = ((z * 0.5) + ((y / x) * t_0)) / (z * t_0);
} else if (x <= 3.3e-251) {
tmp = (y / (x * z)) + (0.5 / ((z / y) / x));
} else if (x <= 17.0) {
tmp = (y / z) / x;
} else {
tmp = (((x * z) * (x * (y * 0.5))) + (y * z)) / (z * (x * z));
}
return tmp;
}
def code(x, y, z): t_0 = z / (y * x) tmp = 0 if x <= -3e+90: tmp = ((z * 0.5) + ((y / x) * t_0)) / (z * t_0) elif x <= 3.3e-251: tmp = (y / (x * z)) + (0.5 / ((z / y) / x)) elif x <= 17.0: tmp = (y / z) / x else: tmp = (((x * z) * (x * (y * 0.5))) + (y * z)) / (z * (x * z)) return tmp
function code(x, y, z) t_0 = Float64(z / Float64(y * x)) tmp = 0.0 if (x <= -3e+90) tmp = Float64(Float64(Float64(z * 0.5) + Float64(Float64(y / x) * t_0)) / Float64(z * t_0)); elseif (x <= 3.3e-251) tmp = Float64(Float64(y / Float64(x * z)) + Float64(0.5 / Float64(Float64(z / y) / x))); elseif (x <= 17.0) tmp = Float64(Float64(y / z) / x); else tmp = Float64(Float64(Float64(Float64(x * z) * Float64(x * Float64(y * 0.5))) + Float64(y * z)) / Float64(z * Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z / (y * x); tmp = 0.0; if (x <= -3e+90) tmp = ((z * 0.5) + ((y / x) * t_0)) / (z * t_0); elseif (x <= 3.3e-251) tmp = (y / (x * z)) + (0.5 / ((z / y) / x)); elseif (x <= 17.0) tmp = (y / z) / x; else tmp = (((x * z) * (x * (y * 0.5))) + (y * z)) / (z * (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z / N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3e+90], N[(N[(N[(z * 0.5), $MachinePrecision] + N[(N[(y / x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(z * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.3e-251], N[(N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(0.5 / N[(N[(z / y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 17.0], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(x * z), $MachinePrecision] * N[(x * N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(z * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{z}{y \cdot x}\\
\mathbf{if}\;x \leq -3 \cdot 10^{+90}:\\
\;\;\;\;\frac{z \cdot 0.5 + \frac{y}{x} \cdot t_0}{z \cdot t_0}\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-251}:\\
\;\;\;\;\frac{y}{x \cdot z} + \frac{0.5}{\frac{\frac{z}{y}}{x}}\\
\mathbf{elif}\;x \leq 17:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot z\right) \cdot \left(x \cdot \left(y \cdot 0.5\right)\right) + y \cdot z}{z \cdot \left(x \cdot z\right)}\\
\end{array}
\end{array}
if x < -2.99999999999999979e90Initial program 69.2%
associate-*l/69.2%
Simplified69.2%
Taylor expanded in x around 0 60.9%
clear-num60.9%
un-div-inv60.9%
associate-/r*51.3%
Applied egg-rr51.3%
+-commutative51.3%
associate-/r*51.3%
frac-add56.0%
associate-/l/56.0%
*-commutative56.0%
associate-/l/72.7%
*-commutative72.7%
Applied egg-rr72.7%
if -2.99999999999999979e90 < x < 3.3e-251Initial program 91.1%
associate-*l/91.1%
Simplified91.1%
Taylor expanded in x around 0 84.0%
clear-num84.0%
un-div-inv84.0%
associate-/r*84.0%
Applied egg-rr84.0%
Taylor expanded in z around 0 84.0%
*-commutative84.0%
Simplified84.0%
Taylor expanded in z around 0 84.0%
associate-/l/84.0%
Simplified84.0%
if 3.3e-251 < x < 17Initial program 90.7%
associate-*l/90.5%
Simplified90.5%
associate-*r/97.9%
associate-*l/97.9%
Applied egg-rr97.9%
Taylor expanded in x around 0 96.9%
if 17 < x Initial program 77.9%
associate-*l/77.9%
Simplified77.9%
Taylor expanded in x around 0 43.5%
associate-*r/43.5%
frac-add53.9%
*-commutative53.9%
associate-*l*53.9%
Applied egg-rr53.9%
Final simplification76.8%
(FPCore (x y z)
:precision binary64
(if (<= x 6.2e-245)
(+ (/ y (* x z)) (* 0.5 (/ (* y x) z)))
(if (<= x 370.0)
(/ (/ y z) x)
(/ (+ (* (* x z) (* x (* y 0.5))) (* y z)) (* z (* x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 6.2e-245) {
tmp = (y / (x * z)) + (0.5 * ((y * x) / z));
} else if (x <= 370.0) {
tmp = (y / z) / x;
} else {
tmp = (((x * z) * (x * (y * 0.5))) + (y * z)) / (z * (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 <= 6.2d-245) then
tmp = (y / (x * z)) + (0.5d0 * ((y * x) / z))
else if (x <= 370.0d0) then
tmp = (y / z) / x
else
tmp = (((x * z) * (x * (y * 0.5d0))) + (y * z)) / (z * (x * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 6.2e-245) {
tmp = (y / (x * z)) + (0.5 * ((y * x) / z));
} else if (x <= 370.0) {
tmp = (y / z) / x;
} else {
tmp = (((x * z) * (x * (y * 0.5))) + (y * z)) / (z * (x * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 6.2e-245: tmp = (y / (x * z)) + (0.5 * ((y * x) / z)) elif x <= 370.0: tmp = (y / z) / x else: tmp = (((x * z) * (x * (y * 0.5))) + (y * z)) / (z * (x * z)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 6.2e-245) tmp = Float64(Float64(y / Float64(x * z)) + Float64(0.5 * Float64(Float64(y * x) / z))); elseif (x <= 370.0) tmp = Float64(Float64(y / z) / x); else tmp = Float64(Float64(Float64(Float64(x * z) * Float64(x * Float64(y * 0.5))) + Float64(y * z)) / Float64(z * Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 6.2e-245) tmp = (y / (x * z)) + (0.5 * ((y * x) / z)); elseif (x <= 370.0) tmp = (y / z) / x; else tmp = (((x * z) * (x * (y * 0.5))) + (y * z)) / (z * (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 6.2e-245], N[(N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 370.0], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(x * z), $MachinePrecision] * N[(x * N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(z * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.2 \cdot 10^{-245}:\\
\;\;\;\;\frac{y}{x \cdot z} + 0.5 \cdot \frac{y \cdot x}{z}\\
\mathbf{elif}\;x \leq 370:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot z\right) \cdot \left(x \cdot \left(y \cdot 0.5\right)\right) + y \cdot z}{z \cdot \left(x \cdot z\right)}\\
\end{array}
\end{array}
if x < 6.20000000000000006e-245Initial program 84.9%
associate-*l/84.9%
Simplified84.9%
Taylor expanded in x around 0 77.4%
if 6.20000000000000006e-245 < x < 370Initial program 90.7%
associate-*l/90.5%
Simplified90.5%
associate-*r/97.9%
associate-*l/97.9%
Applied egg-rr97.9%
Taylor expanded in x around 0 96.9%
if 370 < x Initial program 77.9%
associate-*l/77.9%
Simplified77.9%
Taylor expanded in x around 0 43.5%
associate-*r/43.5%
frac-add53.9%
*-commutative53.9%
associate-*l*53.9%
Applied egg-rr53.9%
Final simplification75.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -4.7e+82) (not (<= z 3e-45))) (+ (/ y (* x z)) (* 0.5 (/ (* y x) z))) (/ (+ (/ y x) (* 0.5 (* y x))) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4.7e+82) || !(z <= 3e-45)) {
tmp = (y / (x * z)) + (0.5 * ((y * x) / z));
} else {
tmp = ((y / x) + (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 ((z <= (-4.7d+82)) .or. (.not. (z <= 3d-45))) then
tmp = (y / (x * z)) + (0.5d0 * ((y * x) / z))
else
tmp = ((y / x) + (0.5d0 * (y * x))) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -4.7e+82) || !(z <= 3e-45)) {
tmp = (y / (x * z)) + (0.5 * ((y * x) / z));
} else {
tmp = ((y / x) + (0.5 * (y * x))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4.7e+82) or not (z <= 3e-45): tmp = (y / (x * z)) + (0.5 * ((y * x) / z)) else: tmp = ((y / x) + (0.5 * (y * x))) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4.7e+82) || !(z <= 3e-45)) tmp = Float64(Float64(y / Float64(x * z)) + Float64(0.5 * Float64(Float64(y * x) / z))); else tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(y * x))) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -4.7e+82) || ~((z <= 3e-45))) tmp = (y / (x * z)) + (0.5 * ((y * x) / z)); else tmp = ((y / x) + (0.5 * (y * x))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4.7e+82], N[Not[LessEqual[z, 3e-45]], $MachinePrecision]], N[(N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.7 \cdot 10^{+82} \lor \neg \left(z \leq 3 \cdot 10^{-45}\right):\\
\;\;\;\;\frac{y}{x \cdot z} + 0.5 \cdot \frac{y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(y \cdot x\right)}{z}\\
\end{array}
\end{array}
if z < -4.7e82 or 3.00000000000000011e-45 < z Initial program 75.6%
associate-*l/75.5%
Simplified75.5%
Taylor expanded in x around 0 66.1%
if -4.7e82 < z < 3.00000000000000011e-45Initial program 90.9%
Taylor expanded in x around 0 80.1%
Final simplification74.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x (/ z 0.5)))))
(if (<= x -1.45)
t_0
(if (<= x 5.2e-248) (/ y (* x z)) (if (<= x 1.45) (/ (/ y z) x) t_0)))))
double code(double x, double y, double z) {
double t_0 = y * (x / (z / 0.5));
double tmp;
if (x <= -1.45) {
tmp = t_0;
} else if (x <= 5.2e-248) {
tmp = y / (x * z);
} else if (x <= 1.45) {
tmp = (y / 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 = y * (x / (z / 0.5d0))
if (x <= (-1.45d0)) then
tmp = t_0
else if (x <= 5.2d-248) then
tmp = y / (x * z)
else if (x <= 1.45d0) then
tmp = (y / 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 = y * (x / (z / 0.5));
double tmp;
if (x <= -1.45) {
tmp = t_0;
} else if (x <= 5.2e-248) {
tmp = y / (x * z);
} else if (x <= 1.45) {
tmp = (y / z) / x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / (z / 0.5)) tmp = 0 if x <= -1.45: tmp = t_0 elif x <= 5.2e-248: tmp = y / (x * z) elif x <= 1.45: tmp = (y / z) / x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x / Float64(z / 0.5))) tmp = 0.0 if (x <= -1.45) tmp = t_0; elseif (x <= 5.2e-248) tmp = Float64(y / Float64(x * z)); elseif (x <= 1.45) tmp = Float64(Float64(y / z) / x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x / (z / 0.5)); tmp = 0.0; if (x <= -1.45) tmp = t_0; elseif (x <= 5.2e-248) tmp = y / (x * z); elseif (x <= 1.45) tmp = (y / z) / x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x / N[(z / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45], t$95$0, If[LessEqual[x, 5.2e-248], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.45], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{\frac{z}{0.5}}\\
\mathbf{if}\;x \leq -1.45:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-248}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\mathbf{elif}\;x \leq 1.45:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.44999999999999996 or 1.44999999999999996 < x Initial program 78.9%
Taylor expanded in x around 0 48.4%
Taylor expanded in x around inf 48.4%
associate-*l/46.1%
*-commutative46.1%
associate-*r*46.1%
*-commutative46.1%
associate-*r*46.1%
associate-*r/46.1%
*-commutative46.1%
associate-/l*46.1%
Simplified46.1%
if -1.44999999999999996 < x < 5.20000000000000013e-248Initial program 88.7%
associate-*l/88.7%
Simplified88.7%
Taylor expanded in x around 0 95.3%
if 5.20000000000000013e-248 < x < 1.44999999999999996Initial program 90.7%
associate-*l/90.5%
Simplified90.5%
associate-*r/97.9%
associate-*l/97.9%
Applied egg-rr97.9%
Taylor expanded in x around 0 96.9%
Final simplification71.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (* y (* x 0.5)) z)))
(if (<= x -1.45)
t_0
(if (<= x 1e-252) (/ y (* x z)) (if (<= x 1.45) (/ (/ y z) x) t_0)))))
double code(double x, double y, double z) {
double t_0 = (y * (x * 0.5)) / z;
double tmp;
if (x <= -1.45) {
tmp = t_0;
} else if (x <= 1e-252) {
tmp = y / (x * z);
} else if (x <= 1.45) {
tmp = (y / 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 = (y * (x * 0.5d0)) / z
if (x <= (-1.45d0)) then
tmp = t_0
else if (x <= 1d-252) then
tmp = y / (x * z)
else if (x <= 1.45d0) then
tmp = (y / 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 = (y * (x * 0.5)) / z;
double tmp;
if (x <= -1.45) {
tmp = t_0;
} else if (x <= 1e-252) {
tmp = y / (x * z);
} else if (x <= 1.45) {
tmp = (y / z) / x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (y * (x * 0.5)) / z tmp = 0 if x <= -1.45: tmp = t_0 elif x <= 1e-252: tmp = y / (x * z) elif x <= 1.45: tmp = (y / z) / x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(y * Float64(x * 0.5)) / z) tmp = 0.0 if (x <= -1.45) tmp = t_0; elseif (x <= 1e-252) tmp = Float64(y / Float64(x * z)); elseif (x <= 1.45) tmp = Float64(Float64(y / z) / x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y * (x * 0.5)) / z; tmp = 0.0; if (x <= -1.45) tmp = t_0; elseif (x <= 1e-252) tmp = y / (x * z); elseif (x <= 1.45) tmp = (y / z) / x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y * N[(x * 0.5), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[x, -1.45], t$95$0, If[LessEqual[x, 1e-252], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.45], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y \cdot \left(x \cdot 0.5\right)}{z}\\
\mathbf{if}\;x \leq -1.45:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 10^{-252}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\mathbf{elif}\;x \leq 1.45:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.44999999999999996 or 1.44999999999999996 < x Initial program 78.9%
Taylor expanded in x around 0 48.4%
Taylor expanded in x around inf 48.4%
associate-*r*48.4%
*-commutative48.4%
Simplified48.4%
if -1.44999999999999996 < x < 9.99999999999999943e-253Initial program 88.7%
associate-*l/88.7%
Simplified88.7%
Taylor expanded in x around 0 95.3%
if 9.99999999999999943e-253 < x < 1.44999999999999996Initial program 90.7%
associate-*l/90.5%
Simplified90.5%
associate-*r/97.9%
associate-*l/97.9%
Applied egg-rr97.9%
Taylor expanded in x around 0 96.9%
Final simplification72.1%
(FPCore (x y z) :precision binary64 (+ (* 0.5 (* y (/ x z))) (/ y (* x z))))
double code(double x, double y, double z) {
return (0.5 * (y * (x / z))) + (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 = (0.5d0 * (y * (x / z))) + (y / (x * z))
end function
public static double code(double x, double y, double z) {
return (0.5 * (y * (x / z))) + (y / (x * z));
}
def code(x, y, z): return (0.5 * (y * (x / z))) + (y / (x * z))
function code(x, y, z) return Float64(Float64(0.5 * Float64(y * Float64(x / z))) + Float64(y / Float64(x * z))) end
function tmp = code(x, y, z) tmp = (0.5 * (y * (x / z))) + (y / (x * z)); end
code[x_, y_, z_] := N[(N[(0.5 * N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \left(y \cdot \frac{x}{z}\right) + \frac{y}{x \cdot z}
\end{array}
Initial program 84.2%
associate-*l/84.2%
Simplified84.2%
Taylor expanded in x around 0 70.6%
associate-/l*66.5%
associate-/r/69.5%
Applied egg-rr69.5%
Final simplification69.5%
(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 84.2%
Taylor expanded in x around 0 68.8%
Taylor expanded in y around 0 68.7%
Final simplification68.7%
(FPCore (x y z) :precision binary64 (/ (+ (/ y x) (* 0.5 (* y x))) z))
double code(double x, double y, double z) {
return ((y / x) + (0.5 * (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) + (0.5d0 * (y * x))) / z
end function
public static double code(double x, double y, double z) {
return ((y / x) + (0.5 * (y * x))) / z;
}
def code(x, y, z): return ((y / x) + (0.5 * (y * x))) / z
function code(x, y, z) return Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(y * x))) / z) end
function tmp = code(x, y, z) tmp = ((y / x) + (0.5 * (y * x))) / z; end
code[x_, y_, z_] := N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{x} + 0.5 \cdot \left(y \cdot x\right)}{z}
\end{array}
Initial program 84.2%
Taylor expanded in x around 0 68.8%
Final simplification68.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -8e+26) (not (<= y 1.9e-64))) (/ (/ y z) x) (/ (/ y x) z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -8e+26) || !(y <= 1.9e-64)) {
tmp = (y / z) / x;
} else {
tmp = (y / x) / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-8d+26)) .or. (.not. (y <= 1.9d-64))) then
tmp = (y / z) / x
else
tmp = (y / x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -8e+26) || !(y <= 1.9e-64)) {
tmp = (y / z) / x;
} else {
tmp = (y / x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -8e+26) or not (y <= 1.9e-64): tmp = (y / z) / x else: tmp = (y / x) / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -8e+26) || !(y <= 1.9e-64)) tmp = Float64(Float64(y / z) / x); else tmp = Float64(Float64(y / x) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -8e+26) || ~((y <= 1.9e-64))) tmp = (y / z) / x; else tmp = (y / x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -8e+26], N[Not[LessEqual[y, 1.9e-64]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision], N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+26} \lor \neg \left(y \leq 1.9 \cdot 10^{-64}\right):\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\
\end{array}
\end{array}
if y < -8.00000000000000038e26 or 1.9000000000000001e-64 < y Initial program 90.6%
associate-*l/90.6%
Simplified90.6%
associate-*r/99.8%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 65.3%
if -8.00000000000000038e26 < y < 1.9000000000000001e-64Initial program 76.4%
Taylor expanded in x around 0 51.7%
Final simplification59.1%
(FPCore (x y z) :precision binary64 (if (<= y -2.9e-60) (/ y (* x z)) (/ (/ y x) z)))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.9e-60) {
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 <= (-2.9d-60)) 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 <= -2.9e-60) {
tmp = y / (x * z);
} else {
tmp = (y / x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.9e-60: tmp = y / (x * z) else: tmp = (y / x) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.9e-60) 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 <= -2.9e-60) tmp = y / (x * z); else tmp = (y / x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.9e-60], 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.9 \cdot 10^{-60}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\
\end{array}
\end{array}
if y < -2.8999999999999999e-60Initial program 89.7%
associate-*l/89.7%
Simplified89.7%
Taylor expanded in x around 0 51.8%
if -2.8999999999999999e-60 < y Initial program 81.2%
Taylor expanded in x around 0 52.9%
Final simplification52.5%
(FPCore (x y z) :precision binary64 (/ y (* x z)))
double code(double x, double y, double z) {
return y / (x * z);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y / (x * z)
end function
public static double code(double x, double y, double z) {
return y / (x * z);
}
def code(x, y, z): return y / (x * z)
function code(x, y, z) return Float64(y / Float64(x * z)) end
function tmp = code(x, y, z) tmp = y / (x * z); end
code[x_, y_, z_] := N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{x \cdot z}
\end{array}
Initial program 84.2%
associate-*l/84.2%
Simplified84.2%
Taylor expanded in x around 0 50.7%
Final simplification50.7%
(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 2023308
(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))