
(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 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (cosh(x) * (y / x)) / z
end function
public static double code(double x, double y, double z) {
return (Math.cosh(x) * (y / x)) / z;
}
def code(x, y, z): return (math.cosh(x) * (y / x)) / z
function code(x, y, z) return Float64(Float64(cosh(x) * Float64(y / x)) / z) end
function tmp = code(x, y, z) tmp = (cosh(x) * (y / x)) / z; end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cosh x \cdot \frac{y}{x}}{z}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (cosh x) (/ y x))))
(if (or (<= t_0 -1e+304) (not (<= t_0 5e+206)))
(/ (* y (/ (cosh x) z)) x)
(/ t_0 z))))
double code(double x, double y, double z) {
double t_0 = cosh(x) * (y / x);
double tmp;
if ((t_0 <= -1e+304) || !(t_0 <= 5e+206)) {
tmp = (y * (cosh(x) / z)) / x;
} else {
tmp = t_0 / 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 = cosh(x) * (y / x)
if ((t_0 <= (-1d+304)) .or. (.not. (t_0 <= 5d+206))) then
tmp = (y * (cosh(x) / z)) / x
else
tmp = t_0 / z
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+304) || !(t_0 <= 5e+206)) {
tmp = (y * (Math.cosh(x) / z)) / x;
} else {
tmp = t_0 / z;
}
return tmp;
}
def code(x, y, z): t_0 = math.cosh(x) * (y / x) tmp = 0 if (t_0 <= -1e+304) or not (t_0 <= 5e+206): tmp = (y * (math.cosh(x) / z)) / x else: tmp = t_0 / z return tmp
function code(x, y, z) t_0 = Float64(cosh(x) * Float64(y / x)) tmp = 0.0 if ((t_0 <= -1e+304) || !(t_0 <= 5e+206)) tmp = Float64(Float64(y * Float64(cosh(x) / z)) / x); else tmp = Float64(t_0 / z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = cosh(x) * (y / x); tmp = 0.0; if ((t_0 <= -1e+304) || ~((t_0 <= 5e+206))) tmp = (y * (cosh(x) / z)) / x; else tmp = t_0 / z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -1e+304], N[Not[LessEqual[t$95$0, 5e+206]], $MachinePrecision]], N[(N[(y * N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(t$95$0 / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cosh x \cdot \frac{y}{x}\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{+304} \lor \neg \left(t_0 \leq 5 \cdot 10^{+206}\right):\\
\;\;\;\;\frac{y \cdot \frac{\cosh x}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{z}\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 y x)) < -9.9999999999999994e303 or 5.0000000000000002e206 < (*.f64 (cosh.f64 x) (/.f64 y x)) Initial program 76.4%
associate-*r/66.6%
associate-/r*75.1%
Simplified75.1%
associate-*r/82.9%
*-commutative82.9%
frac-times76.4%
associate-*l/99.9%
Applied egg-rr99.9%
if -9.9999999999999994e303 < (*.f64 (cosh.f64 x) (/.f64 y x)) < 5.0000000000000002e206Initial program 99.7%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (<= x 3.1e+222) (* (cosh x) (/ y (* x z))) (/ (+ (* z 0.5) (/ z (* x x))) (* z (/ z (* x y))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 3.1e+222) {
tmp = cosh(x) * (y / (x * z));
} else {
tmp = ((z * 0.5) + (z / (x * x))) / (z * (z / (x * 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 (x <= 3.1d+222) then
tmp = cosh(x) * (y / (x * z))
else
tmp = ((z * 0.5d0) + (z / (x * x))) / (z * (z / (x * y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 3.1e+222) {
tmp = Math.cosh(x) * (y / (x * z));
} else {
tmp = ((z * 0.5) + (z / (x * x))) / (z * (z / (x * y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 3.1e+222: tmp = math.cosh(x) * (y / (x * z)) else: tmp = ((z * 0.5) + (z / (x * x))) / (z * (z / (x * y))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 3.1e+222) tmp = Float64(cosh(x) * Float64(y / Float64(x * z))); else tmp = Float64(Float64(Float64(z * 0.5) + Float64(z / Float64(x * x))) / Float64(z * Float64(z / Float64(x * y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 3.1e+222) tmp = cosh(x) * (y / (x * z)); else tmp = ((z * 0.5) + (z / (x * x))) / (z * (z / (x * y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 3.1e+222], N[(N[Cosh[x], $MachinePrecision] * N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * 0.5), $MachinePrecision] + N[(z / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * N[(z / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.1 \cdot 10^{+222}:\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot 0.5 + \frac{z}{x \cdot x}}{z \cdot \frac{z}{x \cdot y}}\\
\end{array}
\end{array}
if x < 3.0999999999999998e222Initial program 88.1%
associate-*r/83.5%
associate-/r*84.4%
Simplified84.4%
if 3.0999999999999998e222 < x Initial program 52.9%
associate-*r/29.4%
associate-/r*29.4%
Simplified29.4%
Taylor expanded in x around 0 48.9%
associate-/l/48.9%
+-commutative48.9%
associate-/l*32.1%
Simplified32.1%
*-un-lft-identity32.1%
associate-*l/32.1%
+-commutative32.1%
associate-*l/32.1%
*-un-lft-identity32.1%
frac-2neg32.1%
associate-*r/32.1%
frac-add48.1%
Applied egg-rr48.1%
+-commutative48.1%
*-commutative48.1%
distribute-rgt-neg-out48.1%
unsub-neg48.1%
distribute-lft-neg-out48.1%
distribute-rgt-neg-in48.1%
*-commutative48.1%
distribute-rgt-neg-in48.1%
metadata-eval48.1%
associate-*r/48.1%
*-commutative48.1%
*-lft-identity48.1%
times-frac48.1%
/-rgt-identity48.1%
associate-/r*48.1%
associate-*r/30.3%
associate-/l*48.1%
Simplified48.1%
Taylor expanded in y around -inf 30.3%
associate-/l*30.5%
associate-*r/30.5%
neg-mul-130.5%
unpow230.5%
unpow230.5%
associate-*r/54.2%
*-commutative54.2%
Simplified54.2%
Final simplification82.4%
(FPCore (x y z) :precision binary64 (if (<= y -8.2e+125) (* (cosh x) (/ y (* x z))) (* (/ y x) (/ (cosh x) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -8.2e+125) {
tmp = cosh(x) * (y / (x * z));
} else {
tmp = (y / x) * (cosh(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+125)) then
tmp = cosh(x) * (y / (x * z))
else
tmp = (y / x) * (cosh(x) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -8.2e+125) {
tmp = Math.cosh(x) * (y / (x * z));
} else {
tmp = (y / x) * (Math.cosh(x) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -8.2e+125: tmp = math.cosh(x) * (y / (x * z)) else: tmp = (y / x) * (math.cosh(x) / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -8.2e+125) tmp = Float64(cosh(x) * Float64(y / Float64(x * z))); else tmp = Float64(Float64(y / x) * Float64(cosh(x) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -8.2e+125) tmp = cosh(x) * (y / (x * z)); else tmp = (y / x) * (cosh(x) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -8.2e+125], N[(N[Cosh[x], $MachinePrecision] * N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] * N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{+125}:\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{\cosh x}{z}\\
\end{array}
\end{array}
if y < -8.19999999999999983e125Initial program 81.1%
associate-*r/81.1%
associate-/r*93.1%
Simplified93.1%
if -8.19999999999999983e125 < y Initial program 86.7%
associate-*l/86.7%
Simplified86.7%
Final simplification87.8%
(FPCore (x y z) :precision binary64 (if (<= y -6.9e+39) (/ (cosh x) (* x (/ z y))) (* (/ y x) (/ (cosh x) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -6.9e+39) {
tmp = cosh(x) / (x * (z / y));
} else {
tmp = (y / x) * (cosh(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 <= (-6.9d+39)) then
tmp = cosh(x) / (x * (z / y))
else
tmp = (y / x) * (cosh(x) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -6.9e+39) {
tmp = Math.cosh(x) / (x * (z / y));
} else {
tmp = (y / x) * (Math.cosh(x) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -6.9e+39: tmp = math.cosh(x) / (x * (z / y)) else: tmp = (y / x) * (math.cosh(x) / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -6.9e+39) tmp = Float64(cosh(x) / Float64(x * Float64(z / y))); else tmp = Float64(Float64(y / x) * Float64(cosh(x) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -6.9e+39) tmp = cosh(x) / (x * (z / y)); else tmp = (y / x) * (cosh(x) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -6.9e+39], N[(N[Cosh[x], $MachinePrecision] / N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] * N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.9 \cdot 10^{+39}:\\
\;\;\;\;\frac{\cosh x}{x \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{\cosh x}{z}\\
\end{array}
\end{array}
if y < -6.90000000000000005e39Initial program 83.7%
associate-/l*83.6%
Simplified83.6%
associate-/r/99.7%
Applied egg-rr99.7%
if -6.90000000000000005e39 < y Initial program 86.4%
associate-*l/86.4%
Simplified86.4%
Final simplification89.7%
(FPCore (x y z) :precision binary64 (/ (* y (/ (cosh x) z)) x))
double code(double x, double y, double z) {
return (y * (cosh(x) / z)) / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (y * (cosh(x) / z)) / x
end function
public static double code(double x, double y, double z) {
return (y * (Math.cosh(x) / z)) / x;
}
def code(x, y, z): return (y * (math.cosh(x) / z)) / x
function code(x, y, z) return Float64(Float64(y * Float64(cosh(x) / z)) / x) end
function tmp = code(x, y, z) tmp = (y * (cosh(x) / z)) / x; end
code[x_, y_, z_] := N[(N[(y * N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{y \cdot \frac{\cosh x}{z}}{x}
\end{array}
Initial program 85.7%
associate-*r/79.9%
associate-/r*80.8%
Simplified80.8%
associate-*r/85.5%
*-commutative85.5%
frac-times85.7%
associate-*l/94.8%
Applied egg-rr94.8%
Final simplification94.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -9.6e-58) (not (<= z 5e-17))) (* y (- (* 0.5 (/ x z)) (/ -1.0 (* x z)))) (+ (/ (/ y x) z) (* 0.5 (/ y (/ z x))))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -9.6e-58) || !(z <= 5e-17)) {
tmp = y * ((0.5 * (x / z)) - (-1.0 / (x * z)));
} else {
tmp = ((y / x) / z) + (0.5 * (y / (z / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-9.6d-58)) .or. (.not. (z <= 5d-17))) then
tmp = y * ((0.5d0 * (x / z)) - ((-1.0d0) / (x * z)))
else
tmp = ((y / x) / z) + (0.5d0 * (y / (z / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -9.6e-58) || !(z <= 5e-17)) {
tmp = y * ((0.5 * (x / z)) - (-1.0 / (x * z)));
} else {
tmp = ((y / x) / z) + (0.5 * (y / (z / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -9.6e-58) or not (z <= 5e-17): tmp = y * ((0.5 * (x / z)) - (-1.0 / (x * z))) else: tmp = ((y / x) / z) + (0.5 * (y / (z / x))) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -9.6e-58) || !(z <= 5e-17)) tmp = Float64(y * Float64(Float64(0.5 * Float64(x / z)) - Float64(-1.0 / Float64(x * z)))); else tmp = Float64(Float64(Float64(y / x) / z) + Float64(0.5 * Float64(y / Float64(z / x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -9.6e-58) || ~((z <= 5e-17))) tmp = y * ((0.5 * (x / z)) - (-1.0 / (x * z))); else tmp = ((y / x) / z) + (0.5 * (y / (z / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -9.6e-58], N[Not[LessEqual[z, 5e-17]], $MachinePrecision]], N[(y * N[(N[(0.5 * N[(x / z), $MachinePrecision]), $MachinePrecision] - N[(-1.0 / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision] + N[(0.5 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.6 \cdot 10^{-58} \lor \neg \left(z \leq 5 \cdot 10^{-17}\right):\\
\;\;\;\;y \cdot \left(0.5 \cdot \frac{x}{z} - \frac{-1}{x \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x}}{z} + 0.5 \cdot \frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if z < -9.6000000000000002e-58 or 4.9999999999999999e-17 < z Initial program 82.8%
associate-*r/72.7%
associate-/r*76.1%
Simplified76.1%
Taylor expanded in x around 0 68.0%
associate-/l/58.6%
+-commutative58.6%
associate-/l*54.8%
Simplified54.8%
Taylor expanded in y around 0 65.5%
if -9.6000000000000002e-58 < z < 4.9999999999999999e-17Initial program 89.7%
associate-*r/89.7%
associate-/r*87.3%
Simplified87.3%
Taylor expanded in x around 0 71.5%
associate-/l/81.4%
+-commutative81.4%
associate-/l*86.6%
Simplified86.6%
Final simplification74.4%
(FPCore (x y z) :precision binary64 (if (or (<= y -1e-37) (not (<= y 5e-30))) (+ (/ y (* x z)) (* 0.5 (/ (* x y) z))) (+ (* y (/ 0.5 (/ z x))) (/ (/ y x) z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1e-37) || !(y <= 5e-30)) {
tmp = (y / (x * z)) + (0.5 * ((x * y) / z));
} else {
tmp = (y * (0.5 / (z / x))) + ((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 <= (-1d-37)) .or. (.not. (y <= 5d-30))) then
tmp = (y / (x * z)) + (0.5d0 * ((x * y) / z))
else
tmp = (y * (0.5d0 / (z / x))) + ((y / x) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1e-37) || !(y <= 5e-30)) {
tmp = (y / (x * z)) + (0.5 * ((x * y) / z));
} else {
tmp = (y * (0.5 / (z / x))) + ((y / x) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1e-37) or not (y <= 5e-30): tmp = (y / (x * z)) + (0.5 * ((x * y) / z)) else: tmp = (y * (0.5 / (z / x))) + ((y / x) / z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1e-37) || !(y <= 5e-30)) tmp = Float64(Float64(y / Float64(x * z)) + Float64(0.5 * Float64(Float64(x * y) / z))); else tmp = Float64(Float64(y * Float64(0.5 / Float64(z / x))) + Float64(Float64(y / x) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1e-37) || ~((y <= 5e-30))) tmp = (y / (x * z)) + (0.5 * ((x * y) / z)); else tmp = (y * (0.5 / (z / x))) + ((y / x) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1e-37], N[Not[LessEqual[y, 5e-30]], $MachinePrecision]], N[(N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(0.5 / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-37} \lor \neg \left(y \leq 5 \cdot 10^{-30}\right):\\
\;\;\;\;\frac{y}{x \cdot z} + 0.5 \cdot \frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{0.5}{\frac{z}{x}} + \frac{\frac{y}{x}}{z}\\
\end{array}
\end{array}
if y < -1.00000000000000007e-37 or 4.99999999999999972e-30 < y Initial program 89.9%
associate-*r/84.2%
associate-/r*87.8%
Simplified87.8%
Taylor expanded in x around 0 80.0%
if -1.00000000000000007e-37 < y < 4.99999999999999972e-30Initial program 80.7%
associate-*r/74.6%
associate-/r*72.2%
Simplified72.2%
Taylor expanded in x around 0 56.6%
associate-/l/66.0%
+-commutative66.0%
associate-/l*70.9%
Simplified70.9%
clear-num70.9%
un-div-inv70.9%
Applied egg-rr70.9%
associate-/r/73.3%
Applied egg-rr73.3%
Final simplification77.0%
(FPCore (x y z) :precision binary64 (if (<= x -1.4) (* (/ x z) (* y 0.5)) (if (<= x 175.0) (/ y (* x z)) (/ (* z (* y 0.5)) (* z (/ z x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.4) {
tmp = (x / z) * (y * 0.5);
} else if (x <= 175.0) {
tmp = y / (x * z);
} else {
tmp = (z * (y * 0.5)) / (z * (z / x));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.4d0)) then
tmp = (x / z) * (y * 0.5d0)
else if (x <= 175.0d0) then
tmp = y / (x * z)
else
tmp = (z * (y * 0.5d0)) / (z * (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.4) {
tmp = (x / z) * (y * 0.5);
} else if (x <= 175.0) {
tmp = y / (x * z);
} else {
tmp = (z * (y * 0.5)) / (z * (z / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.4: tmp = (x / z) * (y * 0.5) elif x <= 175.0: tmp = y / (x * z) else: tmp = (z * (y * 0.5)) / (z * (z / x)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.4) tmp = Float64(Float64(x / z) * Float64(y * 0.5)); elseif (x <= 175.0) tmp = Float64(y / Float64(x * z)); else tmp = Float64(Float64(z * Float64(y * 0.5)) / Float64(z * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.4) tmp = (x / z) * (y * 0.5); elseif (x <= 175.0) tmp = y / (x * z); else tmp = (z * (y * 0.5)) / (z * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.4], N[(N[(x / z), $MachinePrecision] * N[(y * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 175.0], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y * 0.5), $MachinePrecision]), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4:\\
\;\;\;\;\frac{x}{z} \cdot \left(y \cdot 0.5\right)\\
\mathbf{elif}\;x \leq 175:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot 0.5\right)}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if x < -1.3999999999999999Initial program 88.5%
associate-*r/75.0%
associate-/r*67.3%
Simplified67.3%
Taylor expanded in x around 0 42.7%
associate-/l/42.7%
+-commutative42.7%
associate-/l*44.5%
Simplified44.5%
Taylor expanded in y around 0 46.3%
Taylor expanded in x around inf 42.7%
associate-*r/42.7%
associate-*r*42.7%
associate-*r/46.3%
*-commutative46.3%
Simplified46.3%
if -1.3999999999999999 < x < 175Initial program 90.5%
associate-*r/90.4%
associate-/r*92.6%
Simplified92.6%
Taylor expanded in x around 0 90.1%
if 175 < x Initial program 69.2%
associate-*r/53.8%
associate-/r*59.6%
Simplified59.6%
Taylor expanded in x around 0 35.1%
associate-/l/35.1%
+-commutative35.1%
associate-/l*33.3%
Simplified33.3%
*-un-lft-identity33.3%
associate-*l/33.3%
+-commutative33.3%
associate-*l/33.3%
*-un-lft-identity33.3%
associate-*r/33.3%
frac-add39.8%
Applied egg-rr39.8%
Taylor expanded in x around inf 39.8%
associate-*r*39.8%
*-commutative39.8%
Simplified39.8%
Final simplification71.0%
(FPCore (x y z) :precision binary64 (if (<= x -1.22e-175) (/ (* y (- (* x 0.5) (/ -1.0 x))) z) (if (<= x 195.0) (/ y (* x z)) (/ (* z (* y 0.5)) (* z (/ z x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.22e-175) {
tmp = (y * ((x * 0.5) - (-1.0 / x))) / z;
} else if (x <= 195.0) {
tmp = y / (x * z);
} else {
tmp = (z * (y * 0.5)) / (z * (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.22d-175)) then
tmp = (y * ((x * 0.5d0) - ((-1.0d0) / x))) / z
else if (x <= 195.0d0) then
tmp = y / (x * z)
else
tmp = (z * (y * 0.5d0)) / (z * (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.22e-175) {
tmp = (y * ((x * 0.5) - (-1.0 / x))) / z;
} else if (x <= 195.0) {
tmp = y / (x * z);
} else {
tmp = (z * (y * 0.5)) / (z * (z / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.22e-175: tmp = (y * ((x * 0.5) - (-1.0 / x))) / z elif x <= 195.0: tmp = y / (x * z) else: tmp = (z * (y * 0.5)) / (z * (z / x)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.22e-175) tmp = Float64(Float64(y * Float64(Float64(x * 0.5) - Float64(-1.0 / x))) / z); elseif (x <= 195.0) tmp = Float64(y / Float64(x * z)); else tmp = Float64(Float64(z * Float64(y * 0.5)) / Float64(z * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.22e-175) tmp = (y * ((x * 0.5) - (-1.0 / x))) / z; elseif (x <= 195.0) tmp = y / (x * z); else tmp = (z * (y * 0.5)) / (z * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.22e-175], N[(N[(y * N[(N[(x * 0.5), $MachinePrecision] - N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 195.0], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y * 0.5), $MachinePrecision]), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.22 \cdot 10^{-175}:\\
\;\;\;\;\frac{y \cdot \left(x \cdot 0.5 - \frac{-1}{x}\right)}{z}\\
\mathbf{elif}\;x \leq 195:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot 0.5\right)}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if x < -1.2200000000000001e-175Initial program 92.2%
associate-*r/84.6%
associate-/r*76.6%
Simplified76.6%
Taylor expanded in x around 0 62.1%
associate-/l/65.7%
+-commutative65.7%
associate-/l*66.8%
Simplified66.8%
Taylor expanded in y around 0 63.6%
Taylor expanded in z around 0 65.6%
if -1.2200000000000001e-175 < x < 195Initial program 88.1%
associate-*r/88.1%
associate-/r*93.9%
Simplified93.9%
Taylor expanded in x around 0 91.0%
if 195 < x Initial program 69.2%
associate-*r/53.8%
associate-/r*59.6%
Simplified59.6%
Taylor expanded in x around 0 35.1%
associate-/l/35.1%
+-commutative35.1%
associate-/l*33.3%
Simplified33.3%
*-un-lft-identity33.3%
associate-*l/33.3%
+-commutative33.3%
associate-*l/33.3%
*-un-lft-identity33.3%
associate-*r/33.3%
frac-add39.8%
Applied egg-rr39.8%
Taylor expanded in x around inf 39.8%
associate-*r*39.8%
*-commutative39.8%
Simplified39.8%
Final simplification71.6%
(FPCore (x y z) :precision binary64 (if (<= x -1e-175) (/ (+ (/ y x) (* 0.5 (* x y))) z) (if (<= x 150.0) (/ y (* x z)) (/ (* z (* y 0.5)) (* z (/ z x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1e-175) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else if (x <= 150.0) {
tmp = y / (x * z);
} else {
tmp = (z * (y * 0.5)) / (z * (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 <= (-1d-175)) then
tmp = ((y / x) + (0.5d0 * (x * y))) / z
else if (x <= 150.0d0) then
tmp = y / (x * z)
else
tmp = (z * (y * 0.5d0)) / (z * (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1e-175) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else if (x <= 150.0) {
tmp = y / (x * z);
} else {
tmp = (z * (y * 0.5)) / (z * (z / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1e-175: tmp = ((y / x) + (0.5 * (x * y))) / z elif x <= 150.0: tmp = y / (x * z) else: tmp = (z * (y * 0.5)) / (z * (z / x)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1e-175) tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z); elseif (x <= 150.0) tmp = Float64(y / Float64(x * z)); else tmp = Float64(Float64(z * Float64(y * 0.5)) / Float64(z * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1e-175) tmp = ((y / x) + (0.5 * (x * y))) / z; elseif (x <= 150.0) tmp = y / (x * z); else tmp = (z * (y * 0.5)) / (z * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1e-175], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 150.0], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y * 0.5), $MachinePrecision]), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-175}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\mathbf{elif}\;x \leq 150:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot 0.5\right)}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if x < -1e-175Initial program 92.2%
Taylor expanded in x around 0 65.7%
if -1e-175 < x < 150Initial program 88.1%
associate-*r/88.1%
associate-/r*93.9%
Simplified93.9%
Taylor expanded in x around 0 91.0%
if 150 < x Initial program 69.2%
associate-*r/53.8%
associate-/r*59.6%
Simplified59.6%
Taylor expanded in x around 0 35.1%
associate-/l/35.1%
+-commutative35.1%
associate-/l*33.3%
Simplified33.3%
*-un-lft-identity33.3%
associate-*l/33.3%
+-commutative33.3%
associate-*l/33.3%
*-un-lft-identity33.3%
associate-*r/33.3%
frac-add39.8%
Applied egg-rr39.8%
Taylor expanded in x around inf 39.8%
associate-*r*39.8%
*-commutative39.8%
Simplified39.8%
Final simplification71.6%
(FPCore (x y z) :precision binary64 (if (<= y -2.4e-43) (* y (- (* 0.5 (/ x z)) (/ -1.0 (* x z)))) (/ (+ (/ y x) (* 0.5 (* x y))) z)))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.4e-43) {
tmp = y * ((0.5 * (x / z)) - (-1.0 / (x * z)));
} else {
tmp = ((y / x) + (0.5 * (x * y))) / 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.4d-43)) then
tmp = y * ((0.5d0 * (x / z)) - ((-1.0d0) / (x * z)))
else
tmp = ((y / x) + (0.5d0 * (x * y))) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.4e-43) {
tmp = y * ((0.5 * (x / z)) - (-1.0 / (x * z)));
} else {
tmp = ((y / x) + (0.5 * (x * y))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.4e-43: tmp = y * ((0.5 * (x / z)) - (-1.0 / (x * z))) else: tmp = ((y / x) + (0.5 * (x * y))) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.4e-43) tmp = Float64(y * Float64(Float64(0.5 * Float64(x / z)) - Float64(-1.0 / Float64(x * z)))); else tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.4e-43) tmp = y * ((0.5 * (x / z)) - (-1.0 / (x * z))); else tmp = ((y / x) + (0.5 * (x * y))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.4e-43], N[(y * N[(N[(0.5 * N[(x / z), $MachinePrecision]), $MachinePrecision] - N[(-1.0 / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-43}:\\
\;\;\;\;y \cdot \left(0.5 \cdot \frac{x}{z} - \frac{-1}{x \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\end{array}
\end{array}
if y < -2.4000000000000002e-43Initial program 87.4%
associate-*r/83.7%
associate-/r*90.2%
Simplified90.2%
Taylor expanded in x around 0 77.6%
associate-/l/65.1%
+-commutative65.1%
associate-/l*62.9%
Simplified62.9%
Taylor expanded in y around 0 76.4%
if -2.4000000000000002e-43 < y Initial program 85.0%
Taylor expanded in x around 0 69.7%
Final simplification71.9%
(FPCore (x y z) :precision binary64 (if (<= y -1e-5) (/ (- (/ 1.0 x) (* x -0.5)) (/ z y)) (+ (* y (/ 0.5 (/ z x))) (/ (/ y x) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1e-5) {
tmp = ((1.0 / x) - (x * -0.5)) / (z / y);
} else {
tmp = (y * (0.5 / (z / x))) + ((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 <= (-1d-5)) then
tmp = ((1.0d0 / x) - (x * (-0.5d0))) / (z / y)
else
tmp = (y * (0.5d0 / (z / x))) + ((y / x) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1e-5) {
tmp = ((1.0 / x) - (x * -0.5)) / (z / y);
} else {
tmp = (y * (0.5 / (z / x))) + ((y / x) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1e-5: tmp = ((1.0 / x) - (x * -0.5)) / (z / y) else: tmp = (y * (0.5 / (z / x))) + ((y / x) / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1e-5) tmp = Float64(Float64(Float64(1.0 / x) - Float64(x * -0.5)) / Float64(z / y)); else tmp = Float64(Float64(y * Float64(0.5 / Float64(z / x))) + Float64(Float64(y / x) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1e-5) tmp = ((1.0 / x) - (x * -0.5)) / (z / y); else tmp = (y * (0.5 / (z / x))) + ((y / x) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1e-5], N[(N[(N[(1.0 / x), $MachinePrecision] - N[(x * -0.5), $MachinePrecision]), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(0.5 / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{1}{x} - x \cdot -0.5}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{0.5}{\frac{z}{x}} + \frac{\frac{y}{x}}{z}\\
\end{array}
\end{array}
if y < -1.00000000000000008e-5Initial program 85.3%
associate-*r/83.8%
associate-/r*91.3%
Simplified91.3%
Taylor expanded in x around 0 80.5%
associate-/l/66.0%
+-commutative66.0%
associate-/l*63.4%
Simplified63.4%
Taylor expanded in y around 0 77.9%
Taylor expanded in z around -inf 65.9%
mul-1-neg65.9%
associate-/l*78.0%
*-commutative78.0%
Simplified78.0%
if -1.00000000000000008e-5 < y Initial program 85.9%
associate-*r/78.4%
associate-/r*76.7%
Simplified76.7%
Taylor expanded in x around 0 65.3%
associate-/l/69.1%
+-commutative69.1%
associate-/l*70.1%
Simplified70.1%
clear-num70.1%
un-div-inv70.1%
Applied egg-rr70.1%
associate-/r/71.6%
Applied egg-rr71.6%
Final simplification73.3%
(FPCore (x y z) :precision binary64 (if (<= y -6e-6) (/ (- (/ 1.0 x) (* x -0.5)) (/ z y)) (/ (+ (/ y x) (* 0.5 (* x y))) z)))
double code(double x, double y, double z) {
double tmp;
if (y <= -6e-6) {
tmp = ((1.0 / x) - (x * -0.5)) / (z / y);
} else {
tmp = ((y / x) + (0.5 * (x * y))) / 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 <= (-6d-6)) then
tmp = ((1.0d0 / x) - (x * (-0.5d0))) / (z / y)
else
tmp = ((y / x) + (0.5d0 * (x * y))) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -6e-6) {
tmp = ((1.0 / x) - (x * -0.5)) / (z / y);
} else {
tmp = ((y / x) + (0.5 * (x * y))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -6e-6: tmp = ((1.0 / x) - (x * -0.5)) / (z / y) else: tmp = ((y / x) + (0.5 * (x * y))) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -6e-6) tmp = Float64(Float64(Float64(1.0 / x) - Float64(x * -0.5)) / Float64(z / y)); else tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -6e-6) tmp = ((1.0 / x) - (x * -0.5)) / (z / y); else tmp = ((y / x) + (0.5 * (x * y))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -6e-6], N[(N[(N[(1.0 / x), $MachinePrecision] - N[(x * -0.5), $MachinePrecision]), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{1}{x} - x \cdot -0.5}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\end{array}
\end{array}
if y < -6.0000000000000002e-6Initial program 85.3%
associate-*r/83.8%
associate-/r*91.3%
Simplified91.3%
Taylor expanded in x around 0 80.5%
associate-/l/66.0%
+-commutative66.0%
associate-/l*63.4%
Simplified63.4%
Taylor expanded in y around 0 77.9%
Taylor expanded in z around -inf 65.9%
mul-1-neg65.9%
associate-/l*78.0%
*-commutative78.0%
Simplified78.0%
if -6.0000000000000002e-6 < y Initial program 85.9%
Taylor expanded in x around 0 69.1%
Final simplification71.5%
(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 79.4%
associate-*r/65.4%
associate-/r*64.5%
Simplified64.5%
Taylor expanded in x around 0 38.1%
associate-/l/38.1%
+-commutative38.1%
associate-/l*38.1%
Simplified38.1%
Taylor expanded in y around 0 40.7%
Taylor expanded in x around inf 38.1%
associate-*l/32.8%
Simplified32.8%
if -1.3999999999999999 < x < 1.3999999999999999Initial program 90.3%
associate-*r/90.3%
associate-/r*92.5%
Simplified92.5%
Taylor expanded in x around 0 91.7%
Final simplification67.1%
(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(Float64(x * 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[(N[(x * y), $MachinePrecision] / z), $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 \frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if x < -1.3999999999999999 or 1.3999999999999999 < x Initial program 79.4%
associate-*r/65.4%
associate-/r*64.5%
Simplified64.5%
Taylor expanded in x around 0 38.1%
associate-/l/38.1%
+-commutative38.1%
associate-/l*38.1%
Simplified38.1%
Taylor expanded in y around 0 40.7%
Taylor expanded in x around inf 38.1%
if -1.3999999999999999 < x < 1.3999999999999999Initial program 90.3%
associate-*r/90.3%
associate-/r*92.5%
Simplified92.5%
Taylor expanded in x around 0 91.7%
Final simplification69.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.4) (not (<= x 1.4))) (* (/ x z) (* y 0.5)) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4) || !(x <= 1.4)) {
tmp = (x / z) * (y * 0.5);
} 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 = (x / z) * (y * 0.5d0)
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 = (x / z) * (y * 0.5);
} else {
tmp = y / (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.4) or not (x <= 1.4): tmp = (x / z) * (y * 0.5) else: tmp = y / (x * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.4) || !(x <= 1.4)) tmp = Float64(Float64(x / z) * Float64(y * 0.5)); 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 = (x / z) * (y * 0.5); 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[(N[(x / z), $MachinePrecision] * N[(y * 0.5), $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):\\
\;\;\;\;\frac{x}{z} \cdot \left(y \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if x < -1.3999999999999999 or 1.3999999999999999 < x Initial program 79.4%
associate-*r/65.4%
associate-/r*64.5%
Simplified64.5%
Taylor expanded in x around 0 38.1%
associate-/l/38.1%
+-commutative38.1%
associate-/l*38.1%
Simplified38.1%
Taylor expanded in y around 0 40.7%
Taylor expanded in x around inf 38.1%
associate-*r/38.1%
associate-*r*38.1%
associate-*r/40.7%
*-commutative40.7%
Simplified40.7%
if -1.3999999999999999 < x < 1.3999999999999999Initial program 90.3%
associate-*r/90.3%
associate-/r*92.5%
Simplified92.5%
Taylor expanded in x around 0 91.7%
Final simplification70.4%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.54e+38) (not (<= y 2.3e-67))) (/ (/ y z) x) (/ (/ y x) z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.54e+38) || !(y <= 2.3e-67)) {
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 <= (-1.54d+38)) .or. (.not. (y <= 2.3d-67))) 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 <= -1.54e+38) || !(y <= 2.3e-67)) {
tmp = (y / z) / x;
} else {
tmp = (y / x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.54e+38) or not (y <= 2.3e-67): tmp = (y / z) / x else: tmp = (y / x) / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.54e+38) || !(y <= 2.3e-67)) 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 <= -1.54e+38) || ~((y <= 2.3e-67))) tmp = (y / z) / x; else tmp = (y / x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.54e+38], N[Not[LessEqual[y, 2.3e-67]], $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 -1.54 \cdot 10^{+38} \lor \neg \left(y \leq 2.3 \cdot 10^{-67}\right):\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\
\end{array}
\end{array}
if y < -1.54000000000000004e38 or 2.3e-67 < y Initial program 89.3%
associate-*r/83.2%
associate-/r*86.4%
Simplified86.4%
associate-*r/86.4%
*-commutative86.4%
frac-times89.2%
associate-*l/99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 68.1%
if -1.54000000000000004e38 < y < 2.3e-67Initial program 81.9%
associate-*r/76.2%
associate-/r*74.7%
Simplified74.7%
Taylor expanded in x around 0 51.5%
associate-/l/59.5%
Simplified59.5%
Final simplification64.0%
(FPCore (x y z) :precision binary64 (if (<= y -1.85e-41) (/ y (* x z)) (/ (/ y x) z)))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.85e-41) {
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.85d-41)) 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.85e-41) {
tmp = y / (x * z);
} else {
tmp = (y / x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.85e-41: tmp = y / (x * z) else: tmp = (y / x) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.85e-41) 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 <= -1.85e-41) tmp = y / (x * z); else tmp = (y / x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.85e-41], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-41}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\
\end{array}
\end{array}
if y < -1.8500000000000001e-41Initial program 87.2%
associate-*r/84.8%
associate-/r*91.3%
Simplified91.3%
Taylor expanded in x around 0 60.4%
if -1.8500000000000001e-41 < y Initial program 85.0%
associate-*r/77.6%
associate-/r*75.8%
Simplified75.8%
Taylor expanded in x around 0 55.2%
associate-/l/59.2%
Simplified59.2%
Final simplification59.6%
(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 85.7%
associate-*r/79.9%
associate-/r*80.8%
Simplified80.8%
Taylor expanded in x around 0 56.8%
Final simplification56.8%
(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 2023279
(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))