
(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 (or (<= z -1e-94) (not (<= z 1.9e-82))) (* y (/ (/ (cosh x) z) x)) (/ (cosh x) (* x (/ z y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1e-94) || !(z <= 1.9e-82)) {
tmp = y * ((cosh(x) / z) / 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 <= (-1d-94)) .or. (.not. (z <= 1.9d-82))) then
tmp = y * ((cosh(x) / z) / 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 <= -1e-94) || !(z <= 1.9e-82)) {
tmp = y * ((Math.cosh(x) / z) / x);
} else {
tmp = Math.cosh(x) / (x * (z / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1e-94) or not (z <= 1.9e-82): tmp = y * ((math.cosh(x) / z) / x) else: tmp = math.cosh(x) / (x * (z / y)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1e-94) || !(z <= 1.9e-82)) tmp = Float64(y * Float64(Float64(cosh(x) / z) / 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 <= -1e-94) || ~((z <= 1.9e-82))) tmp = y * ((cosh(x) / z) / x); else tmp = cosh(x) / (x * (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1e-94], N[Not[LessEqual[z, 1.9e-82]], $MachinePrecision]], N[(y * N[(N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision] / 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 -1 \cdot 10^{-94} \lor \neg \left(z \leq 1.9 \cdot 10^{-82}\right):\\
\;\;\;\;y \cdot \frac{\frac{\cosh x}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x}{x \cdot \frac{z}{y}}\\
\end{array}
\end{array}
if z < -9.9999999999999996e-95 or 1.9000000000000001e-82 < z Initial program 81.8%
associate-/l*67.6%
associate-/r/70.4%
*-commutative70.4%
Simplified70.4%
associate-/l/88.9%
associate-/r/96.3%
associate-/l*80.9%
associate-/r/99.8%
Applied egg-rr99.8%
if -9.9999999999999996e-95 < z < 1.9000000000000001e-82Initial program 90.3%
associate-/l*90.2%
associate-/r/98.8%
*-commutative98.8%
Simplified98.8%
Final simplification99.4%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* (cosh x) (/ y x)))) (if (<= t_0 1e+172) (/ t_0 z) (* y (/ (/ (cosh x) z) x)))))
double code(double x, double y, double z) {
double t_0 = cosh(x) * (y / x);
double tmp;
if (t_0 <= 1e+172) {
tmp = t_0 / 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) :: t_0
real(8) :: tmp
t_0 = cosh(x) * (y / x)
if (t_0 <= 1d+172) then
tmp = t_0 / 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 t_0 = Math.cosh(x) * (y / x);
double tmp;
if (t_0 <= 1e+172) {
tmp = t_0 / z;
} else {
tmp = y * ((Math.cosh(x) / z) / x);
}
return tmp;
}
def code(x, y, z): t_0 = math.cosh(x) * (y / x) tmp = 0 if t_0 <= 1e+172: tmp = t_0 / z else: tmp = y * ((math.cosh(x) / z) / x) return tmp
function code(x, y, z) t_0 = Float64(cosh(x) * Float64(y / x)) tmp = 0.0 if (t_0 <= 1e+172) tmp = Float64(t_0 / z); else tmp = Float64(y * Float64(Float64(cosh(x) / z) / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = cosh(x) * (y / x); tmp = 0.0; if (t_0 <= 1e+172) tmp = t_0 / z; else tmp = y * ((cosh(x) / z) / 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, 1e+172], N[(t$95$0 / z), $MachinePrecision], N[(y * N[(N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cosh x \cdot \frac{y}{x}\\
\mathbf{if}\;t_0 \leq 10^{+172}:\\
\;\;\;\;\frac{t_0}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{\cosh x}{z}}{x}\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 y x)) < 1.0000000000000001e172Initial program 97.0%
if 1.0000000000000001e172 < (*.f64 (cosh.f64 x) (/.f64 y x)) Initial program 70.8%
associate-/l*59.7%
associate-/r/72.0%
*-commutative72.0%
Simplified72.0%
associate-/l/91.4%
associate-/r/99.9%
associate-/l*69.9%
associate-/r/100.0%
Applied egg-rr100.0%
Final simplification98.4%
(FPCore (x y z) :precision binary64 (if (or (<= x -0.0005) (not (<= x 1e-38))) (* y (/ (/ (cosh x) z) x)) (/ (/ y z) x)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -0.0005) || !(x <= 1e-38)) {
tmp = y * ((cosh(x) / 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 <= (-0.0005d0)) .or. (.not. (x <= 1d-38))) then
tmp = y * ((cosh(x) / 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 <= -0.0005) || !(x <= 1e-38)) {
tmp = y * ((Math.cosh(x) / z) / x);
} else {
tmp = (y / z) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -0.0005) or not (x <= 1e-38): tmp = y * ((math.cosh(x) / z) / x) else: tmp = (y / z) / x return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -0.0005) || !(x <= 1e-38)) tmp = Float64(y * Float64(Float64(cosh(x) / z) / x)); else tmp = Float64(Float64(y / z) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -0.0005) || ~((x <= 1e-38))) tmp = y * ((cosh(x) / z) / x); else tmp = (y / z) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -0.0005], N[Not[LessEqual[x, 1e-38]], $MachinePrecision]], N[(y * N[(N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.0005 \lor \neg \left(x \leq 10^{-38}\right):\\
\;\;\;\;y \cdot \frac{\frac{\cosh x}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\end{array}
\end{array}
if x < -5.0000000000000001e-4 or 9.9999999999999996e-39 < x Initial program 80.1%
associate-/l*63.8%
associate-/r/69.5%
*-commutative69.5%
Simplified69.5%
associate-/l/91.5%
associate-/r/100.0%
associate-/l*78.0%
associate-/r/100.0%
Applied egg-rr100.0%
if -5.0000000000000001e-4 < x < 9.9999999999999996e-39Initial program 90.7%
associate-*l/90.7%
Simplified90.7%
Taylor expanded in x around 0 90.7%
associate-*r/94.7%
associate-*l/94.9%
*-un-lft-identity94.9%
Applied egg-rr94.9%
Final simplification97.7%
(FPCore (x y z) :precision binary64 (* (/ y x) (/ (cosh x) z)))
double code(double x, double y, double z) {
return (y / x) * (cosh(x) / z);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (y / x) * (cosh(x) / z)
end function
public static double code(double x, double y, double z) {
return (y / x) * (Math.cosh(x) / z);
}
def code(x, y, z): return (y / x) * (math.cosh(x) / z)
function code(x, y, z) return Float64(Float64(y / x) * Float64(cosh(x) / z)) end
function tmp = code(x, y, z) tmp = (y / x) * (cosh(x) / z); end
code[x_, y_, z_] := N[(N[(y / x), $MachinePrecision] * N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{x} \cdot \frac{\cosh x}{z}
\end{array}
Initial program 84.9%
associate-*l/84.9%
Simplified84.9%
Final simplification84.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (/ (+ (* (* x z) (* x 0.5)) (/ (* y z) y)) (/ z y)) (* x z)))
(t_1 (+ (* 0.5 (/ (* x y) z)) (/ y (* x z)))))
(if (<= z -1.9e+90)
t_1
(if (<= z -9e-99)
t_0
(if (<= z 7.2e-74)
(/ (+ (/ y x) (* 0.5 (* x y))) z)
(if (<= z 3.7e+69) t_0 t_1))))))
double code(double x, double y, double z) {
double t_0 = ((((x * z) * (x * 0.5)) + ((y * z) / y)) / (z / y)) / (x * z);
double t_1 = (0.5 * ((x * y) / z)) + (y / (x * z));
double tmp;
if (z <= -1.9e+90) {
tmp = t_1;
} else if (z <= -9e-99) {
tmp = t_0;
} else if (z <= 7.2e-74) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else if (z <= 3.7e+69) {
tmp = t_0;
} 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 = ((((x * z) * (x * 0.5d0)) + ((y * z) / y)) / (z / y)) / (x * z)
t_1 = (0.5d0 * ((x * y) / z)) + (y / (x * z))
if (z <= (-1.9d+90)) then
tmp = t_1
else if (z <= (-9d-99)) then
tmp = t_0
else if (z <= 7.2d-74) then
tmp = ((y / x) + (0.5d0 * (x * y))) / z
else if (z <= 3.7d+69) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((((x * z) * (x * 0.5)) + ((y * z) / y)) / (z / y)) / (x * z);
double t_1 = (0.5 * ((x * y) / z)) + (y / (x * z));
double tmp;
if (z <= -1.9e+90) {
tmp = t_1;
} else if (z <= -9e-99) {
tmp = t_0;
} else if (z <= 7.2e-74) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else if (z <= 3.7e+69) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = ((((x * z) * (x * 0.5)) + ((y * z) / y)) / (z / y)) / (x * z) t_1 = (0.5 * ((x * y) / z)) + (y / (x * z)) tmp = 0 if z <= -1.9e+90: tmp = t_1 elif z <= -9e-99: tmp = t_0 elif z <= 7.2e-74: tmp = ((y / x) + (0.5 * (x * y))) / z elif z <= 3.7e+69: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(x * z) * Float64(x * 0.5)) + Float64(Float64(y * z) / y)) / Float64(z / y)) / Float64(x * z)) t_1 = Float64(Float64(0.5 * Float64(Float64(x * y) / z)) + Float64(y / Float64(x * z))) tmp = 0.0 if (z <= -1.9e+90) tmp = t_1; elseif (z <= -9e-99) tmp = t_0; elseif (z <= 7.2e-74) tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z); elseif (z <= 3.7e+69) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((((x * z) * (x * 0.5)) + ((y * z) / y)) / (z / y)) / (x * z); t_1 = (0.5 * ((x * y) / z)) + (y / (x * z)); tmp = 0.0; if (z <= -1.9e+90) tmp = t_1; elseif (z <= -9e-99) tmp = t_0; elseif (z <= 7.2e-74) tmp = ((y / x) + (0.5 * (x * y))) / z; elseif (z <= 3.7e+69) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(x * z), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.5 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e+90], t$95$1, If[LessEqual[z, -9e-99], t$95$0, If[LessEqual[z, 7.2e-74], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 3.7e+69], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{\left(x \cdot z\right) \cdot \left(x \cdot 0.5\right) + \frac{y \cdot z}{y}}{\frac{z}{y}}}{x \cdot z}\\
t_1 := 0.5 \cdot \frac{x \cdot y}{z} + \frac{y}{x \cdot z}\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+90}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-99}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-74}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+69}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.9000000000000001e90 or 3.6999999999999999e69 < z Initial program 79.5%
associate-*l/79.5%
Simplified79.5%
Taylor expanded in x around 0 59.8%
if -1.9000000000000001e90 < z < -9.0000000000000006e-99 or 7.2000000000000005e-74 < z < 3.6999999999999999e69Initial program 83.9%
associate-*l/83.9%
Simplified83.9%
Taylor expanded in x around 0 57.2%
associate-/l*57.2%
*-un-lft-identity57.2%
div-inv57.2%
times-frac57.2%
Applied egg-rr57.2%
frac-times57.2%
*-un-lft-identity57.2%
div-inv57.2%
associate-*r/57.2%
*-commutative57.2%
frac-add60.4%
associate-/r*73.8%
*-commutative73.8%
*-commutative73.8%
associate-*l/74.0%
*-commutative74.0%
Applied egg-rr74.0%
if -9.0000000000000006e-99 < z < 7.2000000000000005e-74Initial program 90.5%
Taylor expanded in x around 0 84.1%
Final simplification73.0%
(FPCore (x y z) :precision binary64 (if (<= y 1.7e+105) (/ (+ (/ y x) (* 0.5 (* x y))) z) (/ (+ z (/ (* (* x z) (* x (* y 0.5))) y)) (* z (* x (/ z y))))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.7e+105) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = (z + (((x * z) * (x * (y * 0.5))) / y)) / (z * (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 (y <= 1.7d+105) then
tmp = ((y / x) + (0.5d0 * (x * y))) / z
else
tmp = (z + (((x * z) * (x * (y * 0.5d0))) / y)) / (z * (x * (z / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 1.7e+105) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = (z + (((x * z) * (x * (y * 0.5))) / y)) / (z * (x * (z / y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.7e+105: tmp = ((y / x) + (0.5 * (x * y))) / z else: tmp = (z + (((x * z) * (x * (y * 0.5))) / y)) / (z * (x * (z / y))) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.7e+105) tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z); else tmp = Float64(Float64(z + Float64(Float64(Float64(x * z) * Float64(x * Float64(y * 0.5))) / y)) / Float64(z * Float64(x * Float64(z / y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 1.7e+105) tmp = ((y / x) + (0.5 * (x * y))) / z; else tmp = (z + (((x * z) * (x * (y * 0.5))) / y)) / (z * (x * (z / y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.7e+105], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(z + N[(N[(N[(x * z), $MachinePrecision] * N[(x * N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / N[(z * N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.7 \cdot 10^{+105}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{\left(x \cdot z\right) \cdot \left(x \cdot \left(y \cdot 0.5\right)\right)}{y}}{z \cdot \left(x \cdot \frac{z}{y}\right)}\\
\end{array}
\end{array}
if y < 1.7e105Initial program 84.9%
Taylor expanded in x around 0 63.1%
if 1.7e105 < y Initial program 84.8%
associate-*l/84.8%
Simplified84.8%
Taylor expanded in x around 0 84.6%
+-commutative84.6%
clear-num84.6%
*-commutative84.6%
associate-*l/84.4%
associate-*r/84.4%
*-commutative84.4%
*-commutative84.4%
associate-*r*84.4%
frac-add70.3%
*-un-lft-identity70.3%
*-commutative70.3%
associate-*r*70.3%
*-commutative70.3%
associate-*l*70.3%
*-commutative70.3%
Applied egg-rr70.3%
associate-*r/79.6%
associate-*l/88.5%
*-commutative88.5%
Applied egg-rr88.5%
Final simplification67.3%
(FPCore (x y z) :precision binary64 (if (<= y -8.2e-255) (/ (+ (/ y x) (* 0.5 (* x y))) z) (+ (/ y (* x z)) (* 0.5 (/ 1.0 (/ (/ 1.0 y) (/ x z)))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -8.2e-255) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = (y / (x * z)) + (0.5 * (1.0 / ((1.0 / 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 <= (-8.2d-255)) then
tmp = ((y / x) + (0.5d0 * (x * y))) / z
else
tmp = (y / (x * z)) + (0.5d0 * (1.0d0 / ((1.0d0 / y) / (x / z))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -8.2e-255) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = (y / (x * z)) + (0.5 * (1.0 / ((1.0 / y) / (x / z))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -8.2e-255: tmp = ((y / x) + (0.5 * (x * y))) / z else: tmp = (y / (x * z)) + (0.5 * (1.0 / ((1.0 / y) / (x / z)))) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -8.2e-255) tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z); else tmp = Float64(Float64(y / Float64(x * z)) + Float64(0.5 * Float64(1.0 / Float64(Float64(1.0 / y) / Float64(x / z))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -8.2e-255) tmp = ((y / x) + (0.5 * (x * y))) / z; else tmp = (y / (x * z)) + (0.5 * (1.0 / ((1.0 / y) / (x / z)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -8.2e-255], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(1.0 / N[(N[(1.0 / y), $MachinePrecision] / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{-255}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z} + 0.5 \cdot \frac{1}{\frac{\frac{1}{y}}{\frac{x}{z}}}\\
\end{array}
\end{array}
if y < -8.2e-255Initial program 91.6%
Taylor expanded in x around 0 69.7%
if -8.2e-255 < y Initial program 77.9%
associate-*l/77.9%
Simplified77.9%
Taylor expanded in x around 0 62.0%
associate-/l*59.7%
*-un-lft-identity59.7%
div-inv59.7%
times-frac62.0%
Applied egg-rr62.0%
associate-*r/63.6%
clear-num63.6%
associate-*l/63.6%
*-un-lft-identity63.6%
Applied egg-rr63.6%
Final simplification66.7%
(FPCore (x y z) :precision binary64 (if (<= y -5.6e-255) (/ (+ (/ y x) (* 0.5 (* x y))) z) (* y (+ (* 0.5 (/ x z)) (/ 1.0 (* x z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -5.6e-255) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = y * ((0.5 * (x / z)) + (1.0 / (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 <= (-5.6d-255)) then
tmp = ((y / x) + (0.5d0 * (x * y))) / z
else
tmp = y * ((0.5d0 * (x / z)) + (1.0d0 / (x * z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -5.6e-255) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = y * ((0.5 * (x / z)) + (1.0 / (x * z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5.6e-255: tmp = ((y / x) + (0.5 * (x * y))) / z else: tmp = y * ((0.5 * (x / z)) + (1.0 / (x * z))) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5.6e-255) tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z); else tmp = Float64(y * Float64(Float64(0.5 * Float64(x / z)) + Float64(1.0 / Float64(x * z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -5.6e-255) tmp = ((y / x) + (0.5 * (x * y))) / z; else tmp = y * ((0.5 * (x / z)) + (1.0 / (x * z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5.6e-255], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y * N[(N[(0.5 * N[(x / z), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{-255}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(0.5 \cdot \frac{x}{z} + \frac{1}{x \cdot z}\right)\\
\end{array}
\end{array}
if y < -5.60000000000000023e-255Initial program 91.6%
Taylor expanded in x around 0 69.7%
if -5.60000000000000023e-255 < y Initial program 77.9%
associate-/l*71.4%
associate-/r/78.4%
*-commutative78.4%
Simplified78.4%
associate-/l/89.7%
associate-/r/96.1%
associate-/l*77.6%
associate-/r/98.3%
Applied egg-rr98.3%
Taylor expanded in x around 0 63.5%
Final simplification66.7%
(FPCore (x y z) :precision binary64 (if (<= y 1.55e-227) (/ (+ (/ y x) (* 0.5 (* x y))) z) (+ (* 0.5 (/ (* x y) z)) (/ y (* x z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.55e-227) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = (0.5 * ((x * y) / 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 (y <= 1.55d-227) then
tmp = ((y / x) + (0.5d0 * (x * y))) / z
else
tmp = (0.5d0 * ((x * y) / z)) + (y / (x * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 1.55e-227) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = (0.5 * ((x * y) / z)) + (y / (x * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.55e-227: tmp = ((y / x) + (0.5 * (x * y))) / z else: tmp = (0.5 * ((x * y) / z)) + (y / (x * z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.55e-227) tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z); else tmp = Float64(Float64(0.5 * Float64(Float64(x * y) / z)) + Float64(y / Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 1.55e-227) tmp = ((y / x) + (0.5 * (x * y))) / z; else tmp = (0.5 * ((x * y) / z)) + (y / (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.55e-227], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(0.5 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.55 \cdot 10^{-227}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x \cdot y}{z} + \frac{y}{x \cdot z}\\
\end{array}
\end{array}
if y < 1.5499999999999999e-227Initial program 85.6%
Taylor expanded in x around 0 66.2%
if 1.5499999999999999e-227 < y Initial program 84.0%
associate-*l/84.0%
Simplified84.0%
Taylor expanded in x around 0 67.4%
Final simplification66.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.42) (not (<= x 1.45))) (* x (/ y (* z 2.0))) (/ (/ y z) x)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.42) || !(x <= 1.45)) {
tmp = x * (y / (z * 2.0));
} 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.42d0)) .or. (.not. (x <= 1.45d0))) then
tmp = x * (y / (z * 2.0d0))
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.42) || !(x <= 1.45)) {
tmp = x * (y / (z * 2.0));
} else {
tmp = (y / z) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.42) or not (x <= 1.45): tmp = x * (y / (z * 2.0)) else: tmp = (y / z) / x return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.42) || !(x <= 1.45)) tmp = Float64(x * Float64(y / Float64(z * 2.0))); else tmp = Float64(Float64(y / z) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.42) || ~((x <= 1.45))) tmp = x * (y / (z * 2.0)); else tmp = (y / z) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.42], N[Not[LessEqual[x, 1.45]], $MachinePrecision]], N[(x * N[(y / N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.42 \lor \neg \left(x \leq 1.45\right):\\
\;\;\;\;x \cdot \frac{y}{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\end{array}
\end{array}
if x < -1.4199999999999999 or 1.44999999999999996 < x Initial program 79.3%
associate-*l/79.3%
Simplified79.3%
Taylor expanded in x around 0 40.8%
associate-/l*33.8%
*-un-lft-identity33.8%
div-inv33.8%
times-frac40.8%
Applied egg-rr40.8%
Taylor expanded in x around inf 40.8%
associate-*r/40.8%
associate-*l/40.8%
metadata-eval40.8%
associate-/r*40.8%
*-commutative40.8%
associate-*l/40.8%
*-lft-identity40.8%
associate-*r/33.8%
Simplified33.8%
if -1.4199999999999999 < x < 1.44999999999999996Initial program 91.2%
associate-*l/91.1%
Simplified91.1%
Taylor expanded in x around 0 89.6%
associate-*r/93.4%
associate-*l/93.5%
*-un-lft-identity93.5%
Applied egg-rr93.5%
Final simplification62.0%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.42) (not (<= x 1.45))) (* y (/ x (* z 2.0))) (/ (/ y z) x)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.42) || !(x <= 1.45)) {
tmp = y * (x / (z * 2.0));
} 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.42d0)) .or. (.not. (x <= 1.45d0))) then
tmp = y * (x / (z * 2.0d0))
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.42) || !(x <= 1.45)) {
tmp = y * (x / (z * 2.0));
} else {
tmp = (y / z) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.42) or not (x <= 1.45): tmp = y * (x / (z * 2.0)) else: tmp = (y / z) / x return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.42) || !(x <= 1.45)) tmp = Float64(y * Float64(x / Float64(z * 2.0))); else tmp = Float64(Float64(y / z) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.42) || ~((x <= 1.45))) tmp = y * (x / (z * 2.0)); else tmp = (y / z) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.42], N[Not[LessEqual[x, 1.45]], $MachinePrecision]], N[(y * N[(x / N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.42 \lor \neg \left(x \leq 1.45\right):\\
\;\;\;\;y \cdot \frac{x}{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\end{array}
\end{array}
if x < -1.4199999999999999 or 1.44999999999999996 < x Initial program 79.3%
associate-*l/79.3%
Simplified79.3%
Taylor expanded in x around 0 40.8%
Taylor expanded in x around inf 40.8%
associate-*r/40.8%
associate-*l/40.8%
associate-*r*40.8%
*-commutative40.8%
associate-*l/40.8%
*-commutative40.8%
/-rgt-identity40.8%
associate-/l*40.8%
metadata-eval40.8%
associate-/l/40.8%
Simplified40.8%
if -1.4199999999999999 < x < 1.44999999999999996Initial program 91.2%
associate-*l/91.1%
Simplified91.1%
Taylor expanded in x around 0 89.6%
associate-*r/93.4%
associate-*l/93.5%
*-un-lft-identity93.5%
Applied egg-rr93.5%
Final simplification65.7%
(FPCore (x y z) :precision binary64 (if (<= x -1.42) (* (* x y) (/ 0.5 z)) (if (<= x 1.45) (/ (/ y z) x) (* y (/ x (* z 2.0))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.42) {
tmp = (x * y) * (0.5 / z);
} else if (x <= 1.45) {
tmp = (y / z) / x;
} else {
tmp = y * (x / (z * 2.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) :: tmp
if (x <= (-1.42d0)) then
tmp = (x * y) * (0.5d0 / z)
else if (x <= 1.45d0) then
tmp = (y / z) / x
else
tmp = y * (x / (z * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.42) {
tmp = (x * y) * (0.5 / z);
} else if (x <= 1.45) {
tmp = (y / z) / x;
} else {
tmp = y * (x / (z * 2.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.42: tmp = (x * y) * (0.5 / z) elif x <= 1.45: tmp = (y / z) / x else: tmp = y * (x / (z * 2.0)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.42) tmp = Float64(Float64(x * y) * Float64(0.5 / z)); elseif (x <= 1.45) tmp = Float64(Float64(y / z) / x); else tmp = Float64(y * Float64(x / Float64(z * 2.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.42) tmp = (x * y) * (0.5 / z); elseif (x <= 1.45) tmp = (y / z) / x; else tmp = y * (x / (z * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.42], N[(N[(x * y), $MachinePrecision] * N[(0.5 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.45], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision], N[(y * N[(x / N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.42:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{0.5}{z}\\
\mathbf{elif}\;x \leq 1.45:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot 2}\\
\end{array}
\end{array}
if x < -1.4199999999999999Initial program 78.2%
Taylor expanded in x around 0 40.6%
Taylor expanded in x around inf 40.6%
associate-*r/40.6%
associate-/l*40.6%
*-commutative40.6%
Simplified40.6%
*-commutative40.6%
associate-/r/40.6%
Applied egg-rr40.6%
if -1.4199999999999999 < x < 1.44999999999999996Initial program 91.2%
associate-*l/91.1%
Simplified91.1%
Taylor expanded in x around 0 89.6%
associate-*r/93.4%
associate-*l/93.5%
*-un-lft-identity93.5%
Applied egg-rr93.5%
if 1.44999999999999996 < x Initial program 80.7%
associate-*l/80.7%
Simplified80.7%
Taylor expanded in x around 0 41.1%
Taylor expanded in x around inf 41.1%
associate-*r/41.1%
associate-*l/41.1%
associate-*r*42.6%
*-commutative42.6%
associate-*l/42.6%
*-commutative42.6%
/-rgt-identity42.6%
associate-/l*42.6%
metadata-eval42.6%
associate-/l/42.6%
Simplified42.6%
Final simplification66.1%
(FPCore (x y z) :precision binary64 (/ (+ (/ y x) (* 0.5 (* x y))) z))
double code(double x, double y, double z) {
return ((y / x) + (0.5 * (x * y))) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((y / x) + (0.5d0 * (x * y))) / z
end function
public static double code(double x, double y, double z) {
return ((y / x) + (0.5 * (x * y))) / z;
}
def code(x, y, z): return ((y / x) + (0.5 * (x * y))) / z
function code(x, y, z) return Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z) end
function tmp = code(x, y, z) tmp = ((y / x) + (0.5 * (x * y))) / z; end
code[x_, y_, z_] := N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}
\end{array}
Initial program 84.9%
Taylor expanded in x around 0 64.1%
Final simplification64.1%
(FPCore (x y z) :precision binary64 (if (<= y 1.7e-226) (/ (/ y x) z) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.7e-226) {
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 <= 1.7d-226) 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 <= 1.7e-226) {
tmp = (y / x) / z;
} else {
tmp = y / (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.7e-226: tmp = (y / x) / z else: tmp = y / (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.7e-226) 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 <= 1.7e-226) tmp = (y / x) / z; else tmp = y / (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.7e-226], N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.7 \cdot 10^{-226}:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if y < 1.70000000000000004e-226Initial program 85.6%
Taylor expanded in x around 0 49.9%
if 1.70000000000000004e-226 < y Initial program 84.0%
associate-*l/84.0%
Simplified84.0%
Taylor expanded in x around 0 46.0%
Final simplification48.2%
(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.9%
associate-*l/84.9%
Simplified84.9%
Taylor expanded in x around 0 45.5%
Final simplification45.5%
(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(Float64(y / z) / x) end
function tmp = code(x, y, z) tmp = (y / z) / x; end
code[x_, y_, z_] := N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{z}}{x}
\end{array}
Initial program 84.9%
associate-*l/84.9%
Simplified84.9%
Taylor expanded in x around 0 45.7%
associate-*r/51.9%
associate-*l/51.9%
*-un-lft-identity51.9%
Applied egg-rr51.9%
Final simplification51.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 2023301
(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))