
(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (cosh(x) * (y / x)) / z
end function
public static double code(double x, double y, double z) {
return (Math.cosh(x) * (y / x)) / z;
}
def code(x, y, z): return (math.cosh(x) * (y / x)) / z
function code(x, y, z) return Float64(Float64(cosh(x) * Float64(y / x)) / z) end
function tmp = code(x, y, z) tmp = (cosh(x) * (y / x)) / z; end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cosh x \cdot \frac{y}{x}}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (cosh(x) * (y / x)) / z
end function
public static double code(double x, double y, double z) {
return (Math.cosh(x) * (y / x)) / z;
}
def code(x, y, z): return (math.cosh(x) * (y / x)) / z
function code(x, y, z) return Float64(Float64(cosh(x) * Float64(y / x)) / z) end
function tmp = code(x, y, z) tmp = (cosh(x) * (y / x)) / z; end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cosh x \cdot \frac{y}{x}}{z}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= y 7.4e-16) (/ (* y (/ (cosh x) x)) z) (/ (* y (/ (cosh x) z)) x)))
double code(double x, double y, double z) {
double tmp;
if (y <= 7.4e-16) {
tmp = (y * (cosh(x) / x)) / z;
} 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 <= 7.4d-16) then
tmp = (y * (cosh(x) / x)) / z
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 <= 7.4e-16) {
tmp = (y * (Math.cosh(x) / x)) / z;
} else {
tmp = (y * (Math.cosh(x) / z)) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 7.4e-16: tmp = (y * (math.cosh(x) / x)) / z else: tmp = (y * (math.cosh(x) / z)) / x return tmp
function code(x, y, z) tmp = 0.0 if (y <= 7.4e-16) tmp = Float64(Float64(y * Float64(cosh(x) / x)) / z); else tmp = Float64(Float64(y * Float64(cosh(x) / z)) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 7.4e-16) tmp = (y * (cosh(x) / x)) / z; else tmp = (y * (cosh(x) / z)) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 7.4e-16], N[(N[(y * N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y * N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.4 \cdot 10^{-16}:\\
\;\;\;\;\frac{y \cdot \frac{\cosh x}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{\cosh x}{z}}{x}\\
\end{array}
\end{array}
if y < 7.3999999999999999e-16Initial program 86.8%
associate-*r/82.5%
associate-/r*78.7%
Simplified78.7%
associate-*r/84.5%
*-commutative84.5%
frac-times86.7%
expm1-log1p-u50.9%
expm1-udef36.9%
frac-times37.2%
*-commutative37.2%
associate-*r/35.1%
associate-/r*35.3%
Applied egg-rr35.3%
expm1-def49.4%
expm1-log1p82.5%
associate-/r*78.7%
associate-*r/84.5%
*-rgt-identity84.5%
associate-*r/84.3%
*-commutative84.3%
associate-/r*85.3%
associate-*r*85.3%
*-commutative85.3%
associate-/r*84.3%
associate-*l/84.3%
*-lft-identity84.3%
Simplified84.3%
*-commutative84.3%
associate-/r*95.8%
associate-*l/98.8%
Applied egg-rr98.8%
if 7.3999999999999999e-16 < y Initial program 88.6%
associate-*r/88.5%
associate-/r*86.3%
Simplified86.3%
associate-*r/84.9%
*-commutative84.9%
frac-times90.0%
associate-*l/99.9%
Applied egg-rr99.9%
Final simplification99.1%
(FPCore (x y z) :precision binary64 (let* ((t_0 (/ (cosh x) z))) (if (<= (/ (* (cosh x) (/ y x)) z) 2e-56) (* t_0 (/ y x)) (/ (* y t_0) x))))
double code(double x, double y, double z) {
double t_0 = cosh(x) / z;
double tmp;
if (((cosh(x) * (y / x)) / z) <= 2e-56) {
tmp = t_0 * (y / x);
} else {
tmp = (y * t_0) / 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) / z
if (((cosh(x) * (y / x)) / z) <= 2d-56) then
tmp = t_0 * (y / x)
else
tmp = (y * t_0) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.cosh(x) / z;
double tmp;
if (((Math.cosh(x) * (y / x)) / z) <= 2e-56) {
tmp = t_0 * (y / x);
} else {
tmp = (y * t_0) / x;
}
return tmp;
}
def code(x, y, z): t_0 = math.cosh(x) / z tmp = 0 if ((math.cosh(x) * (y / x)) / z) <= 2e-56: tmp = t_0 * (y / x) else: tmp = (y * t_0) / x return tmp
function code(x, y, z) t_0 = Float64(cosh(x) / z) tmp = 0.0 if (Float64(Float64(cosh(x) * Float64(y / x)) / z) <= 2e-56) tmp = Float64(t_0 * Float64(y / x)); else tmp = Float64(Float64(y * t_0) / x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = cosh(x) / z; tmp = 0.0; if (((cosh(x) * (y / x)) / z) <= 2e-56) tmp = t_0 * (y / x); else tmp = (y * t_0) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], 2e-56], N[(t$95$0 * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(y * t$95$0), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\cosh x}{z}\\
\mathbf{if}\;\frac{\cosh x \cdot \frac{y}{x}}{z} \leq 2 \cdot 10^{-56}:\\
\;\;\;\;t_0 \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot t_0}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 2.0000000000000001e-56Initial program 97.1%
associate-*l/97.8%
Simplified97.8%
if 2.0000000000000001e-56 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 75.8%
associate-*r/73.3%
associate-/r*72.7%
Simplified72.7%
associate-*r/80.2%
*-commutative80.2%
frac-times75.8%
associate-*l/99.9%
Applied egg-rr99.9%
Final simplification98.7%
(FPCore (x y z)
:precision binary64
(if (<= x -2.15e-218)
(* y (/ (cosh x) (* x z)))
(if (<= x 1.15e-159)
(/ (/ 1.0 x) (/ z y))
(if (<= x 8.3e+183)
(* (/ (cosh x) z) (/ y x))
(* y (/ (+ (* z (* x 0.5)) (/ z x)) (* z z)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.15e-218) {
tmp = y * (cosh(x) / (x * z));
} else if (x <= 1.15e-159) {
tmp = (1.0 / x) / (z / y);
} else if (x <= 8.3e+183) {
tmp = (cosh(x) / z) * (y / x);
} else {
tmp = y * (((z * (x * 0.5)) + (z / x)) / (z * 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 <= (-2.15d-218)) then
tmp = y * (cosh(x) / (x * z))
else if (x <= 1.15d-159) then
tmp = (1.0d0 / x) / (z / y)
else if (x <= 8.3d+183) then
tmp = (cosh(x) / z) * (y / x)
else
tmp = y * (((z * (x * 0.5d0)) + (z / x)) / (z * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2.15e-218) {
tmp = y * (Math.cosh(x) / (x * z));
} else if (x <= 1.15e-159) {
tmp = (1.0 / x) / (z / y);
} else if (x <= 8.3e+183) {
tmp = (Math.cosh(x) / z) * (y / x);
} else {
tmp = y * (((z * (x * 0.5)) + (z / x)) / (z * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.15e-218: tmp = y * (math.cosh(x) / (x * z)) elif x <= 1.15e-159: tmp = (1.0 / x) / (z / y) elif x <= 8.3e+183: tmp = (math.cosh(x) / z) * (y / x) else: tmp = y * (((z * (x * 0.5)) + (z / x)) / (z * z)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.15e-218) tmp = Float64(y * Float64(cosh(x) / Float64(x * z))); elseif (x <= 1.15e-159) tmp = Float64(Float64(1.0 / x) / Float64(z / y)); elseif (x <= 8.3e+183) tmp = Float64(Float64(cosh(x) / z) * Float64(y / x)); else tmp = Float64(y * Float64(Float64(Float64(z * Float64(x * 0.5)) + Float64(z / x)) / Float64(z * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.15e-218) tmp = y * (cosh(x) / (x * z)); elseif (x <= 1.15e-159) tmp = (1.0 / x) / (z / y); elseif (x <= 8.3e+183) tmp = (cosh(x) / z) * (y / x); else tmp = y * (((z * (x * 0.5)) + (z / x)) / (z * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.15e-218], N[(y * N[(N[Cosh[x], $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.15e-159], N[(N[(1.0 / x), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.3e+183], N[(N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(N[(z * N[(x * 0.5), $MachinePrecision]), $MachinePrecision] + N[(z / x), $MachinePrecision]), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.15 \cdot 10^{-218}:\\
\;\;\;\;y \cdot \frac{\cosh x}{x \cdot z}\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-159}:\\
\;\;\;\;\frac{\frac{1}{x}}{\frac{z}{y}}\\
\mathbf{elif}\;x \leq 8.3 \cdot 10^{+183}:\\
\;\;\;\;\frac{\cosh x}{z} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z \cdot \left(x \cdot 0.5\right) + \frac{z}{x}}{z \cdot z}\\
\end{array}
\end{array}
if x < -2.15e-218Initial program 83.7%
associate-*r/78.5%
associate-/r*79.6%
Simplified79.6%
associate-*r/85.7%
*-commutative85.7%
frac-times83.6%
expm1-log1p-u53.7%
expm1-udef41.4%
frac-times44.4%
*-commutative44.4%
associate-*r/42.3%
associate-/r*39.4%
Applied egg-rr39.4%
expm1-def51.7%
expm1-log1p78.5%
associate-/r*79.6%
associate-*r/85.7%
*-rgt-identity85.7%
associate-*r/85.6%
*-commutative85.6%
associate-/r*85.5%
associate-*r*85.6%
*-commutative85.6%
associate-/r*85.6%
associate-*l/85.6%
*-lft-identity85.6%
Simplified85.6%
if -2.15e-218 < x < 1.14999999999999989e-159Initial program 88.6%
associate-*r/88.6%
associate-/r*90.7%
Simplified90.7%
Taylor expanded in x around 0 90.7%
clear-num90.7%
associate-/r/90.1%
associate-/r*90.0%
Applied egg-rr90.0%
associate-/r*90.1%
*-commutative90.1%
div-inv90.7%
associate-/l/98.1%
div-inv98.1%
clear-num98.0%
associate-*l/98.1%
*-un-lft-identity98.1%
Applied egg-rr98.1%
if 1.14999999999999989e-159 < x < 8.2999999999999997e183Initial program 97.4%
associate-*l/98.5%
Simplified98.5%
if 8.2999999999999997e183 < x Initial program 60.0%
associate-*r/60.0%
associate-/r*35.0%
Simplified35.0%
associate-*r/45.0%
*-commutative45.0%
frac-times60.0%
expm1-log1p-u20.0%
expm1-udef20.0%
frac-times15.0%
*-commutative15.0%
associate-*r/10.0%
associate-/r*20.0%
Applied egg-rr20.0%
expm1-def20.0%
expm1-log1p60.0%
associate-/r*35.0%
associate-*r/45.0%
*-rgt-identity45.0%
associate-*r/45.0%
*-commutative45.0%
associate-/r*50.0%
associate-*r*50.0%
*-commutative50.0%
associate-/r*45.0%
associate-*l/45.0%
*-lft-identity45.0%
Simplified45.0%
Taylor expanded in x around 0 47.4%
associate-*r/47.4%
associate-/r*47.4%
frac-add80.2%
div-inv80.2%
Applied egg-rr80.2%
Final simplification92.1%
(FPCore (x y z) :precision binary64 (* y (/ (cosh x) (* x z))))
double code(double x, double y, double z) {
return y * (cosh(x) / (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 * (cosh(x) / (x * z))
end function
public static double code(double x, double y, double z) {
return y * (Math.cosh(x) / (x * z));
}
def code(x, y, z): return y * (math.cosh(x) / (x * z))
function code(x, y, z) return Float64(y * Float64(cosh(x) / Float64(x * z))) end
function tmp = code(x, y, z) tmp = y * (cosh(x) / (x * z)); end
code[x_, y_, z_] := N[(y * N[(N[Cosh[x], $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \frac{\cosh x}{x \cdot z}
\end{array}
Initial program 87.2%
associate-*r/84.1%
associate-/r*80.7%
Simplified80.7%
associate-*r/84.6%
*-commutative84.6%
frac-times87.5%
expm1-log1p-u49.4%
expm1-udef38.2%
frac-times37.8%
*-commutative37.8%
associate-*r/36.3%
associate-/r*37.0%
Applied egg-rr37.0%
expm1-def48.2%
expm1-log1p84.1%
associate-/r*80.7%
associate-*r/84.6%
*-rgt-identity84.6%
associate-*r/84.4%
*-commutative84.4%
associate-/r*85.1%
associate-*r*85.5%
*-commutative85.5%
associate-/r*84.8%
associate-*l/84.8%
*-lft-identity84.8%
Simplified84.8%
Final simplification84.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 0.5 (* y x))) (t_1 (+ (/ y (* x z)) (/ 0.5 (/ z (* y x))))))
(if (<= z -5e+34)
t_1
(if (<= z 6.5e-229)
(/ (+ (/ y x) t_0) z)
(if (<= z 2.6e+25)
(* y (/ (+ z (* (* x z) (* x 0.5))) (* z (* x z))))
(if (<= z 5.6e+125) (/ (+ (* z (/ y x)) (* z t_0)) (* z z)) t_1))))))
double code(double x, double y, double z) {
double t_0 = 0.5 * (y * x);
double t_1 = (y / (x * z)) + (0.5 / (z / (y * x)));
double tmp;
if (z <= -5e+34) {
tmp = t_1;
} else if (z <= 6.5e-229) {
tmp = ((y / x) + t_0) / z;
} else if (z <= 2.6e+25) {
tmp = y * ((z + ((x * z) * (x * 0.5))) / (z * (x * z)));
} else if (z <= 5.6e+125) {
tmp = ((z * (y / x)) + (z * t_0)) / (z * 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 = 0.5d0 * (y * x)
t_1 = (y / (x * z)) + (0.5d0 / (z / (y * x)))
if (z <= (-5d+34)) then
tmp = t_1
else if (z <= 6.5d-229) then
tmp = ((y / x) + t_0) / z
else if (z <= 2.6d+25) then
tmp = y * ((z + ((x * z) * (x * 0.5d0))) / (z * (x * z)))
else if (z <= 5.6d+125) then
tmp = ((z * (y / x)) + (z * t_0)) / (z * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 0.5 * (y * x);
double t_1 = (y / (x * z)) + (0.5 / (z / (y * x)));
double tmp;
if (z <= -5e+34) {
tmp = t_1;
} else if (z <= 6.5e-229) {
tmp = ((y / x) + t_0) / z;
} else if (z <= 2.6e+25) {
tmp = y * ((z + ((x * z) * (x * 0.5))) / (z * (x * z)));
} else if (z <= 5.6e+125) {
tmp = ((z * (y / x)) + (z * t_0)) / (z * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 0.5 * (y * x) t_1 = (y / (x * z)) + (0.5 / (z / (y * x))) tmp = 0 if z <= -5e+34: tmp = t_1 elif z <= 6.5e-229: tmp = ((y / x) + t_0) / z elif z <= 2.6e+25: tmp = y * ((z + ((x * z) * (x * 0.5))) / (z * (x * z))) elif z <= 5.6e+125: tmp = ((z * (y / x)) + (z * t_0)) / (z * z) else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(0.5 * Float64(y * x)) t_1 = Float64(Float64(y / Float64(x * z)) + Float64(0.5 / Float64(z / Float64(y * x)))) tmp = 0.0 if (z <= -5e+34) tmp = t_1; elseif (z <= 6.5e-229) tmp = Float64(Float64(Float64(y / x) + t_0) / z); elseif (z <= 2.6e+25) tmp = Float64(y * Float64(Float64(z + Float64(Float64(x * z) * Float64(x * 0.5))) / Float64(z * Float64(x * z)))); elseif (z <= 5.6e+125) tmp = Float64(Float64(Float64(z * Float64(y / x)) + Float64(z * t_0)) / Float64(z * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 0.5 * (y * x); t_1 = (y / (x * z)) + (0.5 / (z / (y * x))); tmp = 0.0; if (z <= -5e+34) tmp = t_1; elseif (z <= 6.5e-229) tmp = ((y / x) + t_0) / z; elseif (z <= 2.6e+25) tmp = y * ((z + ((x * z) * (x * 0.5))) / (z * (x * z))); elseif (z <= 5.6e+125) tmp = ((z * (y / x)) + (z * t_0)) / (z * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.5 * N[(y * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(0.5 / N[(z / N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e+34], t$95$1, If[LessEqual[z, 6.5e-229], N[(N[(N[(y / x), $MachinePrecision] + t$95$0), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 2.6e+25], N[(y * N[(N[(z + N[(N[(x * z), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e+125], N[(N[(N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision] + N[(z * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(y \cdot x\right)\\
t_1 := \frac{y}{x \cdot z} + \frac{0.5}{\frac{z}{y \cdot x}}\\
\mathbf{if}\;z \leq -5 \cdot 10^{+34}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-229}:\\
\;\;\;\;\frac{\frac{y}{x} + t_0}{z}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+25}:\\
\;\;\;\;y \cdot \frac{z + \left(x \cdot z\right) \cdot \left(x \cdot 0.5\right)}{z \cdot \left(x \cdot z\right)}\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+125}:\\
\;\;\;\;\frac{z \cdot \frac{y}{x} + z \cdot t_0}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.9999999999999998e34 or 5.6000000000000002e125 < z Initial program 79.5%
associate-*r/73.1%
associate-/r*68.3%
Simplified68.3%
associate-*r/72.6%
*-commutative72.6%
frac-times80.4%
expm1-log1p-u54.3%
expm1-udef37.3%
frac-times35.3%
*-commutative35.3%
associate-*r/33.2%
associate-/r*34.1%
Applied egg-rr34.1%
expm1-def51.2%
expm1-log1p73.1%
associate-/r*68.3%
associate-*r/72.6%
*-rgt-identity72.6%
associate-*r/72.5%
*-commutative72.5%
associate-/r*74.5%
associate-*r*75.5%
*-commutative75.5%
associate-/r*73.5%
associate-*l/73.5%
*-lft-identity73.5%
Simplified73.5%
Taylor expanded in x around 0 56.0%
+-commutative56.0%
distribute-lft-in56.0%
div-inv56.1%
associate-*r*56.1%
Applied egg-rr56.1%
associate-*r/64.0%
*-commutative64.0%
associate-*r*64.0%
associate-/l*64.0%
Applied egg-rr64.0%
if -4.9999999999999998e34 < z < 6.5e-229Initial program 91.8%
Taylor expanded in x around 0 83.4%
if 6.5e-229 < z < 2.5999999999999998e25Initial program 92.6%
associate-*r/92.6%
associate-/r*96.2%
Simplified96.2%
associate-*r/99.9%
*-commutative99.9%
frac-times92.4%
expm1-log1p-u50.1%
expm1-udef41.3%
frac-times45.0%
*-commutative45.0%
associate-*r/43.2%
associate-/r*41.3%
Applied egg-rr41.3%
expm1-def50.1%
expm1-log1p92.6%
associate-/r*96.2%
associate-*r/99.9%
*-rgt-identity99.9%
associate-*r/99.9%
*-commutative99.9%
associate-/r*99.8%
associate-*r*99.8%
*-commutative99.8%
associate-/r*99.9%
associate-*l/99.9%
*-lft-identity99.9%
Simplified99.9%
Taylor expanded in x around 0 72.1%
+-commutative72.1%
associate-*r/72.1%
frac-add80.6%
*-un-lft-identity80.6%
Applied egg-rr80.6%
if 2.5999999999999998e25 < z < 5.6000000000000002e125Initial program 89.2%
associate-*r/78.7%
associate-/r*68.3%
Simplified68.3%
associate-*r/73.5%
*-commutative73.5%
frac-times89.3%
expm1-log1p-u68.0%
expm1-udef43.2%
frac-times32.6%
*-commutative32.6%
associate-*r/32.6%
associate-/r*43.2%
Applied egg-rr43.2%
expm1-def67.9%
expm1-log1p78.7%
associate-/r*68.3%
associate-*r/73.5%
*-rgt-identity73.5%
associate-*r/73.5%
*-commutative73.5%
associate-/r*73.4%
associate-*r*73.4%
*-commutative73.4%
associate-/r*73.5%
associate-*l/73.5%
*-lft-identity73.5%
Simplified73.5%
Taylor expanded in x around 0 54.6%
+-commutative54.6%
distribute-lft-in54.6%
div-inv54.6%
associate-*r*54.6%
Applied egg-rr54.6%
associate-/r*54.5%
associate-*r/59.3%
*-commutative59.3%
associate-*r*59.3%
frac-add84.3%
Applied egg-rr84.3%
Final simplification75.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -145.0) (not (<= x 3e+222))) (* y (/ (* (* x z) 0.5) (* z z))) (+ (/ y (* x z)) (/ 0.5 (/ z (* y x))))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -145.0) || !(x <= 3e+222)) {
tmp = y * (((x * z) * 0.5) / (z * z));
} else {
tmp = (y / (x * z)) + (0.5 / (z / (y * 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 <= (-145.0d0)) .or. (.not. (x <= 3d+222))) then
tmp = y * (((x * z) * 0.5d0) / (z * z))
else
tmp = (y / (x * z)) + (0.5d0 / (z / (y * x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -145.0) || !(x <= 3e+222)) {
tmp = y * (((x * z) * 0.5) / (z * z));
} else {
tmp = (y / (x * z)) + (0.5 / (z / (y * x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -145.0) or not (x <= 3e+222): tmp = y * (((x * z) * 0.5) / (z * z)) else: tmp = (y / (x * z)) + (0.5 / (z / (y * x))) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -145.0) || !(x <= 3e+222)) tmp = Float64(y * Float64(Float64(Float64(x * z) * 0.5) / Float64(z * z))); else tmp = Float64(Float64(y / Float64(x * z)) + Float64(0.5 / Float64(z / Float64(y * x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -145.0) || ~((x <= 3e+222))) tmp = y * (((x * z) * 0.5) / (z * z)); else tmp = (y / (x * z)) + (0.5 / (z / (y * x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -145.0], N[Not[LessEqual[x, 3e+222]], $MachinePrecision]], N[(y * N[(N[(N[(x * z), $MachinePrecision] * 0.5), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(0.5 / N[(z / N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -145 \lor \neg \left(x \leq 3 \cdot 10^{+222}\right):\\
\;\;\;\;y \cdot \frac{\left(x \cdot z\right) \cdot 0.5}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z} + \frac{0.5}{\frac{z}{y \cdot x}}\\
\end{array}
\end{array}
if x < -145 or 3.00000000000000014e222 < x Initial program 71.8%
associate-*r/64.8%
associate-/r*62.0%
Simplified62.0%
associate-*r/71.8%
*-commutative71.8%
frac-times71.8%
expm1-log1p-u42.3%
expm1-udef42.3%
frac-times45.1%
*-commutative45.1%
associate-*r/40.8%
associate-/r*39.4%
Applied egg-rr39.4%
expm1-def39.4%
expm1-log1p64.8%
associate-/r*62.0%
associate-*r/71.8%
*-rgt-identity71.8%
associate-*r/71.8%
*-commutative71.8%
associate-/r*71.8%
associate-*r*71.8%
*-commutative71.8%
associate-/r*71.8%
associate-*l/71.8%
*-lft-identity71.8%
Simplified71.8%
Taylor expanded in x around 0 40.4%
associate-*r/39.1%
associate-/r*39.1%
frac-add53.3%
div-inv53.3%
Applied egg-rr53.3%
Taylor expanded in x around inf 53.3%
if -145 < x < 3.00000000000000014e222Initial program 93.1%
associate-*r/91.5%
associate-/r*87.8%
Simplified87.8%
associate-*r/89.5%
*-commutative89.5%
frac-times93.6%
expm1-log1p-u52.1%
expm1-udef36.7%
frac-times35.0%
*-commutative35.0%
associate-*r/34.5%
associate-/r*36.1%
Applied egg-rr36.1%
expm1-def51.6%
expm1-log1p91.5%
associate-/r*87.8%
associate-*r/89.5%
*-rgt-identity89.5%
associate-*r/89.2%
*-commutative89.2%
associate-/r*90.2%
associate-*r*90.7%
*-commutative90.7%
associate-/r*89.8%
associate-*l/89.8%
*-lft-identity89.8%
Simplified89.8%
Taylor expanded in x around 0 77.0%
+-commutative77.0%
distribute-lft-in77.0%
div-inv77.2%
associate-*r*77.2%
Applied egg-rr77.2%
associate-*r/79.8%
*-commutative79.8%
associate-*r*79.8%
associate-/l*79.8%
Applied egg-rr79.8%
Final simplification72.4%
(FPCore (x y z) :precision binary64 (if (or (<= x -185.0) (not (<= x 390.0))) (* y (/ (* (* x z) 0.5) (* z z))) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -185.0) || !(x <= 390.0)) {
tmp = y * (((x * z) * 0.5) / (z * 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 <= (-185.0d0)) .or. (.not. (x <= 390.0d0))) then
tmp = y * (((x * z) * 0.5d0) / (z * 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 <= -185.0) || !(x <= 390.0)) {
tmp = y * (((x * z) * 0.5) / (z * z));
} else {
tmp = y / (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -185.0) or not (x <= 390.0): tmp = y * (((x * z) * 0.5) / (z * z)) else: tmp = y / (x * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -185.0) || !(x <= 390.0)) tmp = Float64(y * Float64(Float64(Float64(x * z) * 0.5) / Float64(z * z))); else tmp = Float64(y / Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -185.0) || ~((x <= 390.0))) tmp = y * (((x * z) * 0.5) / (z * z)); else tmp = y / (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -185.0], N[Not[LessEqual[x, 390.0]], $MachinePrecision]], N[(y * N[(N[(N[(x * z), $MachinePrecision] * 0.5), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -185 \lor \neg \left(x \leq 390\right):\\
\;\;\;\;y \cdot \frac{\left(x \cdot z\right) \cdot 0.5}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if x < -185 or 390 < x Initial program 80.8%
associate-*r/73.3%
associate-/r*65.0%
Simplified65.0%
associate-*r/74.2%
*-commutative74.2%
frac-times80.8%
expm1-log1p-u41.7%
expm1-udef41.7%
frac-times39.2%
*-commutative39.2%
associate-*r/35.8%
associate-/r*39.2%
Applied egg-rr39.2%
expm1-def39.2%
expm1-log1p73.3%
associate-/r*65.0%
associate-*r/74.2%
*-rgt-identity74.2%
associate-*r/74.2%
*-commutative74.2%
associate-/r*75.8%
associate-*r*75.8%
*-commutative75.8%
associate-/r*74.2%
associate-*l/74.2%
*-lft-identity74.2%
Simplified74.2%
Taylor expanded in x around 0 38.2%
associate-*r/37.4%
associate-/r*37.4%
frac-add48.7%
div-inv48.7%
Applied egg-rr48.7%
Taylor expanded in x around inf 48.7%
if -185 < x < 390Initial program 92.9%
associate-*r/93.6%
associate-/r*94.5%
Simplified94.5%
Taylor expanded in x around 0 92.1%
Final simplification71.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -165.0) (not (<= x 3.8e+226))) (* y (/ (* (* x z) 0.5) (* z z))) (/ (+ (/ y x) (* 0.5 (* y x))) z)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -165.0) || !(x <= 3.8e+226)) {
tmp = y * (((x * z) * 0.5) / (z * 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 ((x <= (-165.0d0)) .or. (.not. (x <= 3.8d+226))) then
tmp = y * (((x * z) * 0.5d0) / (z * 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 ((x <= -165.0) || !(x <= 3.8e+226)) {
tmp = y * (((x * z) * 0.5) / (z * z));
} else {
tmp = ((y / x) + (0.5 * (y * x))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -165.0) or not (x <= 3.8e+226): tmp = y * (((x * z) * 0.5) / (z * z)) else: tmp = ((y / x) + (0.5 * (y * x))) / z return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -165.0) || !(x <= 3.8e+226)) tmp = Float64(y * Float64(Float64(Float64(x * z) * 0.5) / Float64(z * 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 ((x <= -165.0) || ~((x <= 3.8e+226))) tmp = y * (((x * z) * 0.5) / (z * z)); else tmp = ((y / x) + (0.5 * (y * x))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -165.0], N[Not[LessEqual[x, 3.8e+226]], $MachinePrecision]], N[(y * N[(N[(N[(x * z), $MachinePrecision] * 0.5), $MachinePrecision] / N[(z * 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}\;x \leq -165 \lor \neg \left(x \leq 3.8 \cdot 10^{+226}\right):\\
\;\;\;\;y \cdot \frac{\left(x \cdot z\right) \cdot 0.5}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(y \cdot x\right)}{z}\\
\end{array}
\end{array}
if x < -165 or 3.79999999999999983e226 < x Initial program 71.8%
associate-*r/64.8%
associate-/r*62.0%
Simplified62.0%
associate-*r/71.8%
*-commutative71.8%
frac-times71.8%
expm1-log1p-u42.3%
expm1-udef42.3%
frac-times45.1%
*-commutative45.1%
associate-*r/40.8%
associate-/r*39.4%
Applied egg-rr39.4%
expm1-def39.4%
expm1-log1p64.8%
associate-/r*62.0%
associate-*r/71.8%
*-rgt-identity71.8%
associate-*r/71.8%
*-commutative71.8%
associate-/r*71.8%
associate-*r*71.8%
*-commutative71.8%
associate-/r*71.8%
associate-*l/71.8%
*-lft-identity71.8%
Simplified71.8%
Taylor expanded in x around 0 40.4%
associate-*r/39.1%
associate-/r*39.1%
frac-add53.3%
div-inv53.3%
Applied egg-rr53.3%
Taylor expanded in x around inf 53.3%
if -165 < x < 3.79999999999999983e226Initial program 93.1%
Taylor expanded in x around 0 79.1%
Final simplification72.0%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.4) (not (<= x 1.4))) (* 0.5 (* x (/ y z))) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4) || !(x <= 1.4)) {
tmp = 0.5 * (x * (y / 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.4d0))) then
tmp = 0.5d0 * (x * (y / 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.4)) {
tmp = 0.5 * (x * (y / z));
} else {
tmp = y / (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.4) or not (x <= 1.4): tmp = 0.5 * (x * (y / z)) else: tmp = y / (x * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.4) || !(x <= 1.4)) tmp = Float64(0.5 * Float64(x * Float64(y / z))); else tmp = Float64(y / Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.4) || ~((x <= 1.4))) tmp = 0.5 * (x * (y / 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.4]], $MachinePrecision]], N[(0.5 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \lor \neg \left(x \leq 1.4\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if x < -1.3999999999999999 or 1.3999999999999999 < x Initial program 80.5%
Taylor expanded in x around 0 39.0%
Taylor expanded in x around inf 39.0%
associate-/l*32.1%
Simplified32.1%
div-inv32.1%
clear-num32.1%
Applied egg-rr32.1%
if -1.3999999999999999 < x < 1.3999999999999999Initial program 93.4%
associate-*r/93.4%
associate-/r*94.4%
Simplified94.4%
Taylor expanded in x around 0 94.0%
Final simplification64.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.4) (not (<= x 1.4))) (* 0.5 (* y (/ x z))) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4) || !(x <= 1.4)) {
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.4d0))) 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.4)) {
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.4): 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.4)) tmp = Float64(0.5 * Float64(y * Float64(x / z))); else tmp = Float64(y / Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.4) || ~((x <= 1.4))) 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.4]], $MachinePrecision]], N[(0.5 * N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \lor \neg \left(x \leq 1.4\right):\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if x < -1.3999999999999999 or 1.3999999999999999 < x Initial program 80.5%
Taylor expanded in x around 0 39.0%
Taylor expanded in x around inf 39.0%
associate-/l*32.1%
associate-/r/37.5%
Simplified37.5%
if -1.3999999999999999 < x < 1.3999999999999999Initial program 93.4%
associate-*r/93.4%
associate-/r*94.4%
Simplified94.4%
Taylor expanded in x around 0 94.0%
Final simplification66.8%
(FPCore (x y z) :precision binary64 (if (<= x -1.4) (* 0.5 (* y (/ x z))) (if (<= x 1.4) (/ y (* x z)) (/ (* 0.5 (* y x)) z))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.4) {
tmp = 0.5 * (y * (x / z));
} else if (x <= 1.4) {
tmp = y / (x * z);
} 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 * (x / z))
else if (x <= 1.4d0) then
tmp = y / (x * z)
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 * (x / z));
} else if (x <= 1.4) {
tmp = y / (x * z);
} else {
tmp = (0.5 * (y * x)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.4: tmp = 0.5 * (y * (x / z)) elif x <= 1.4: tmp = y / (x * z) 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(x / z))); elseif (x <= 1.4) tmp = Float64(y / Float64(x * z)); else tmp = Float64(Float64(0.5 * 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 * (x / z)); elseif (x <= 1.4) tmp = y / (x * z); 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[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.4], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(y * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{z}\right)\\
\mathbf{elif}\;x \leq 1.4:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5 \cdot \left(y \cdot x\right)}{z}\\
\end{array}
\end{array}
if x < -1.3999999999999999Initial program 75.8%
Taylor expanded in x around 0 33.7%
Taylor expanded in x around inf 33.7%
associate-/l*30.4%
associate-/r/36.9%
Simplified36.9%
if -1.3999999999999999 < x < 1.3999999999999999Initial program 93.4%
associate-*r/93.4%
associate-/r*94.4%
Simplified94.4%
Taylor expanded in x around 0 94.0%
if 1.3999999999999999 < x Initial program 84.7%
Taylor expanded in x around 0 43.7%
Taylor expanded in x around inf 43.7%
*-commutative43.7%
Simplified43.7%
Final simplification68.3%
(FPCore (x y z) :precision binary64 (if (<= y 3.05e-151) (/ (/ y x) z) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= 3.05e-151) {
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 <= 3.05d-151) 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 <= 3.05e-151) {
tmp = (y / x) / z;
} else {
tmp = y / (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 3.05e-151: tmp = (y / x) / z else: tmp = y / (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 3.05e-151) tmp = Float64(Float64(y / x) / z); else tmp = Float64(y / Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 3.05e-151) tmp = (y / x) / z; else tmp = y / (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 3.05e-151], N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.05 \cdot 10^{-151}:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if y < 3.05e-151Initial program 89.1%
associate-*r/85.9%
associate-/r*80.5%
Simplified80.5%
Taylor expanded in x around 0 51.0%
associate-/r*54.5%
Simplified54.5%
if 3.05e-151 < y Initial program 84.4%
associate-*r/81.3%
associate-/r*81.0%
Simplified81.0%
Taylor expanded in x around 0 53.9%
Final simplification54.2%
(FPCore (x y z) :precision binary64 (if (<= z 4.4e-50) (/ (/ y z) x) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if (z <= 4.4e-50) {
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 (z <= 4.4d-50) 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 (z <= 4.4e-50) {
tmp = (y / z) / x;
} else {
tmp = y / (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 4.4e-50: tmp = (y / z) / x else: tmp = y / (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 4.4e-50) tmp = Float64(Float64(y / z) / x); else tmp = Float64(y / Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 4.4e-50) tmp = (y / z) / x; else tmp = y / (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 4.4e-50], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.4 \cdot 10^{-50}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if z < 4.3999999999999998e-50Initial program 88.0%
associate-*r/86.9%
associate-/r*84.8%
Simplified84.8%
associate-*r/87.7%
*-commutative87.7%
frac-times88.5%
associate-*l/98.6%
Applied egg-rr98.6%
Taylor expanded in x around 0 61.2%
if 4.3999999999999998e-50 < z Initial program 85.5%
associate-*r/78.1%
associate-/r*71.8%
Simplified71.8%
Taylor expanded in x around 0 52.8%
Final simplification58.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 87.2%
associate-*r/84.1%
associate-/r*80.7%
Simplified80.7%
Taylor expanded in x around 0 52.1%
Final simplification52.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ (/ y z) x) (cosh x))))
(if (< y -4.618902267687042e-52)
t_0
(if (< y 1.038530535935153e-39) (/ (/ (* (cosh x) y) x) z) t_0))))
double code(double x, double y, double z) {
double t_0 = ((y / z) / x) * cosh(x);
double tmp;
if (y < -4.618902267687042e-52) {
tmp = t_0;
} else if (y < 1.038530535935153e-39) {
tmp = ((cosh(x) * y) / x) / z;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((y / z) / x) * cosh(x)
if (y < (-4.618902267687042d-52)) then
tmp = t_0
else if (y < 1.038530535935153d-39) then
tmp = ((cosh(x) * y) / x) / z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((y / z) / x) * Math.cosh(x);
double tmp;
if (y < -4.618902267687042e-52) {
tmp = t_0;
} else if (y < 1.038530535935153e-39) {
tmp = ((Math.cosh(x) * y) / x) / z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((y / z) / x) * math.cosh(x) tmp = 0 if y < -4.618902267687042e-52: tmp = t_0 elif y < 1.038530535935153e-39: tmp = ((math.cosh(x) * y) / x) / z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(y / z) / x) * cosh(x)) tmp = 0.0 if (y < -4.618902267687042e-52) tmp = t_0; elseif (y < 1.038530535935153e-39) tmp = Float64(Float64(Float64(cosh(x) * y) / x) / z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((y / z) / x) * cosh(x); tmp = 0.0; if (y < -4.618902267687042e-52) tmp = t_0; elseif (y < 1.038530535935153e-39) tmp = ((cosh(x) * y) / x) / z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision] * N[Cosh[x], $MachinePrecision]), $MachinePrecision]}, If[Less[y, -4.618902267687042e-52], t$95$0, If[Less[y, 1.038530535935153e-39], N[(N[(N[(N[Cosh[x], $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision] / z), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{z}}{x} \cdot \cosh x\\
\mathbf{if}\;y < -4.618902267687042 \cdot 10^{-52}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y < 1.038530535935153 \cdot 10^{-39}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
herbie shell --seed 2023271
(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))