
(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
(let* ((t_0 (/ (* (cosh x) (/ y x)) z)))
(if (<= t_0 (- INFINITY))
(* y (/ (/ (cosh x) z) x))
(if (<= t_0 1e+302) t_0 (/ y (* z (/ x (cosh x))))))))
double code(double x, double y, double z) {
double t_0 = (cosh(x) * (y / x)) / z;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = y * ((cosh(x) / z) / x);
} else if (t_0 <= 1e+302) {
tmp = t_0;
} else {
tmp = y / (z * (x / cosh(x)));
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = (Math.cosh(x) * (y / x)) / z;
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = y * ((Math.cosh(x) / z) / x);
} else if (t_0 <= 1e+302) {
tmp = t_0;
} else {
tmp = y / (z * (x / Math.cosh(x)));
}
return tmp;
}
def code(x, y, z): t_0 = (math.cosh(x) * (y / x)) / z tmp = 0 if t_0 <= -math.inf: tmp = y * ((math.cosh(x) / z) / x) elif t_0 <= 1e+302: tmp = t_0 else: tmp = y / (z * (x / math.cosh(x))) return tmp
function code(x, y, z) t_0 = Float64(Float64(cosh(x) * Float64(y / x)) / z) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(y * Float64(Float64(cosh(x) / z) / x)); elseif (t_0 <= 1e+302) tmp = t_0; else tmp = Float64(y / Float64(z * Float64(x / cosh(x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (cosh(x) * (y / x)) / z; tmp = 0.0; if (t_0 <= -Inf) tmp = y * ((cosh(x) / z) / x); elseif (t_0 <= 1e+302) tmp = t_0; else tmp = y / (z * (x / cosh(x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(y * N[(N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+302], t$95$0, N[(y / N[(z * N[(x / N[Cosh[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\cosh x \cdot \frac{y}{x}}{z}\\
\mathbf{if}\;t_0 \leq -\infty:\\
\;\;\;\;y \cdot \frac{\frac{\cosh x}{z}}{x}\\
\mathbf{elif}\;t_0 \leq 10^{+302}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{x}{\cosh x}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < -inf.0Initial program 93.5%
associate-*r/81.0%
associate-/r*81.9%
Simplified81.9%
associate-*r/83.3%
*-commutative83.3%
frac-times93.5%
expm1-log1p-u0.0%
expm1-udef0.0%
frac-times0.0%
*-commutative0.0%
associate-*r/0.0%
associate-/r*0.0%
Applied egg-rr0.0%
expm1-def0.0%
expm1-log1p81.0%
associate-*r/93.5%
associate-*l/93.5%
*-commutative93.5%
associate-*l/100.0%
associate-*r/100.0%
Simplified100.0%
if -inf.0 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 1.0000000000000001e302Initial program 99.6%
if 1.0000000000000001e302 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 64.3%
associate-*r/57.5%
associate-/r*71.5%
Simplified71.5%
associate-*r/84.0%
*-commutative84.0%
frac-times64.3%
expm1-log1p-u64.3%
expm1-udef64.3%
frac-times72.9%
*-commutative72.9%
associate-*r/66.0%
associate-/r*57.5%
Applied egg-rr57.5%
expm1-def57.5%
expm1-log1p57.5%
associate-*r/64.3%
associate-*l/64.3%
*-commutative64.3%
associate-*l/99.9%
associate-*r/99.9%
Simplified99.9%
clear-num99.9%
un-div-inv99.9%
associate-/r/99.9%
Applied egg-rr99.9%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -7.2e-121) (not (<= y -3.2e-223))) (* y (/ (/ (cosh x) z) x)) (/ (+ (/ y x) (* 0.5 (* x y))) z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -7.2e-121) || !(y <= -3.2e-223)) {
tmp = y * ((cosh(x) / z) / x);
} 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 <= (-7.2d-121)) .or. (.not. (y <= (-3.2d-223)))) then
tmp = y * ((cosh(x) / z) / x)
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 <= -7.2e-121) || !(y <= -3.2e-223)) {
tmp = y * ((Math.cosh(x) / z) / x);
} else {
tmp = ((y / x) + (0.5 * (x * y))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -7.2e-121) or not (y <= -3.2e-223): tmp = y * ((math.cosh(x) / z) / x) else: tmp = ((y / x) + (0.5 * (x * y))) / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -7.2e-121) || !(y <= -3.2e-223)) tmp = Float64(y * Float64(Float64(cosh(x) / z) / x)); 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 <= -7.2e-121) || ~((y <= -3.2e-223))) tmp = y * ((cosh(x) / z) / x); else tmp = ((y / x) + (0.5 * (x * y))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -7.2e-121], N[Not[LessEqual[y, -3.2e-223]], $MachinePrecision]], N[(y * N[(N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision] / x), $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 -7.2 \cdot 10^{-121} \lor \neg \left(y \leq -3.2 \cdot 10^{-223}\right):\\
\;\;\;\;y \cdot \frac{\frac{\cosh x}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\end{array}
\end{array}
if y < -7.19999999999999967e-121 or -3.2000000000000001e-223 < y Initial program 84.5%
associate-*r/78.1%
associate-/r*80.5%
Simplified80.5%
associate-*r/85.6%
*-commutative85.6%
frac-times84.4%
expm1-log1p-u48.2%
expm1-udef34.5%
frac-times36.0%
*-commutative36.0%
associate-*r/33.4%
associate-/r*32.0%
Applied egg-rr32.0%
expm1-def45.7%
expm1-log1p78.1%
associate-*r/84.5%
associate-*l/84.4%
*-commutative84.4%
associate-*l/95.4%
associate-*r/96.7%
Simplified96.7%
if -7.19999999999999967e-121 < y < -3.2000000000000001e-223Initial program 100.0%
Taylor expanded in x around 0 95.5%
Final simplification96.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (cosh x) z)))
(if (or (<= y -1.1e+38) (not (<= y -3.2e-227)))
(* y (/ t_0 x))
(* (/ y x) t_0))))
double code(double x, double y, double z) {
double t_0 = cosh(x) / z;
double tmp;
if ((y <= -1.1e+38) || !(y <= -3.2e-227)) {
tmp = y * (t_0 / x);
} else {
tmp = (y / x) * t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = cosh(x) / z
if ((y <= (-1.1d+38)) .or. (.not. (y <= (-3.2d-227)))) then
tmp = y * (t_0 / x)
else
tmp = (y / x) * t_0
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 ((y <= -1.1e+38) || !(y <= -3.2e-227)) {
tmp = y * (t_0 / x);
} else {
tmp = (y / x) * t_0;
}
return tmp;
}
def code(x, y, z): t_0 = math.cosh(x) / z tmp = 0 if (y <= -1.1e+38) or not (y <= -3.2e-227): tmp = y * (t_0 / x) else: tmp = (y / x) * t_0 return tmp
function code(x, y, z) t_0 = Float64(cosh(x) / z) tmp = 0.0 if ((y <= -1.1e+38) || !(y <= -3.2e-227)) tmp = Float64(y * Float64(t_0 / x)); else tmp = Float64(Float64(y / x) * t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = cosh(x) / z; tmp = 0.0; if ((y <= -1.1e+38) || ~((y <= -3.2e-227))) tmp = y * (t_0 / x); else tmp = (y / x) * t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]}, If[Or[LessEqual[y, -1.1e+38], N[Not[LessEqual[y, -3.2e-227]], $MachinePrecision]], N[(y * N[(t$95$0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\cosh x}{z}\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{+38} \lor \neg \left(y \leq -3.2 \cdot 10^{-227}\right):\\
\;\;\;\;y \cdot \frac{t_0}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x} \cdot t_0\\
\end{array}
\end{array}
if y < -1.10000000000000003e38 or -3.2000000000000001e-227 < y Initial program 82.4%
associate-*r/76.9%
associate-/r*80.6%
Simplified80.6%
associate-*r/86.1%
*-commutative86.1%
frac-times82.3%
expm1-log1p-u47.7%
expm1-udef33.1%
frac-times36.2%
*-commutative36.2%
associate-*r/33.7%
associate-/r*31.6%
Applied egg-rr31.6%
expm1-def46.2%
expm1-log1p76.9%
associate-*r/82.4%
associate-*l/82.3%
*-commutative82.3%
associate-*l/95.1%
associate-*r/97.1%
Simplified97.1%
if -1.10000000000000003e38 < y < -3.2000000000000001e-227Initial program 98.1%
associate-*l/97.9%
Simplified97.9%
Final simplification97.2%
(FPCore (x y z) :precision binary64 (if (<= z -7.3e+254) (+ (* 0.5 (/ (* x y) z)) (/ y (* x z))) (* y (/ (cosh x) (* x z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -7.3e+254) {
tmp = (0.5 * ((x * y) / z)) + (y / (x * z));
} else {
tmp = y * (cosh(x) / (x * z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-7.3d+254)) then
tmp = (0.5d0 * ((x * y) / z)) + (y / (x * z))
else
tmp = y * (cosh(x) / (x * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -7.3e+254) {
tmp = (0.5 * ((x * y) / z)) + (y / (x * z));
} else {
tmp = y * (Math.cosh(x) / (x * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -7.3e+254: tmp = (0.5 * ((x * y) / z)) + (y / (x * z)) else: tmp = y * (math.cosh(x) / (x * z)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -7.3e+254) tmp = Float64(Float64(0.5 * Float64(Float64(x * y) / z)) + Float64(y / Float64(x * z))); else tmp = Float64(y * Float64(cosh(x) / Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -7.3e+254) tmp = (0.5 * ((x * y) / z)) + (y / (x * z)); else tmp = y * (cosh(x) / (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -7.3e+254], N[(N[(0.5 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[Cosh[x], $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.3 \cdot 10^{+254}:\\
\;\;\;\;0.5 \cdot \frac{x \cdot y}{z} + \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\cosh x}{x \cdot z}\\
\end{array}
\end{array}
if z < -7.3000000000000002e254Initial program 77.6%
associate-*r/48.1%
associate-/r*46.9%
Simplified46.9%
Taylor expanded in x around 0 71.1%
if -7.3000000000000002e254 < z Initial program 86.3%
associate-*r/82.1%
associate-/r*83.2%
Simplified83.2%
associate-*r/88.2%
*-commutative88.2%
frac-times86.3%
expm1-log1p-u51.5%
expm1-udef35.9%
frac-times36.9%
*-commutative36.9%
associate-*r/34.4%
associate-/r*33.8%
Applied egg-rr33.8%
expm1-def49.5%
expm1-log1p82.1%
associate-*r/86.3%
associate-*l/86.3%
*-commutative86.3%
*-rgt-identity86.3%
associate-*r/86.2%
associate-*r*94.3%
associate-*r/94.4%
associate-*r/94.3%
associate-*l/94.4%
*-lft-identity94.4%
associate-/l/87.2%
Simplified87.2%
Final simplification86.2%
(FPCore (x y z) :precision binary64 (/ y (* z (/ x (cosh x)))))
double code(double x, double y, double z) {
return y / (z * (x / cosh(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 / cosh(x)))
end function
public static double code(double x, double y, double z) {
return y / (z * (x / Math.cosh(x)));
}
def code(x, y, z): return y / (z * (x / math.cosh(x)))
function code(x, y, z) return Float64(y / Float64(z * Float64(x / cosh(x)))) end
function tmp = code(x, y, z) tmp = y / (z * (x / cosh(x))); end
code[x_, y_, z_] := N[(y / N[(z * N[(x / N[Cosh[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{z \cdot \frac{x}{\cosh 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%
expm1-log1p-u50.1%
expm1-udef34.7%
frac-times35.5%
*-commutative35.5%
associate-*r/33.2%
associate-/r*32.4%
Applied egg-rr32.4%
expm1-def47.7%
expm1-log1p79.9%
associate-*r/85.7%
associate-*l/85.7%
*-commutative85.7%
associate-*l/94.8%
associate-*r/94.7%
Simplified94.7%
clear-num94.7%
un-div-inv95.6%
associate-/r/95.6%
Applied egg-rr95.6%
Final simplification95.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (/ z x) y)) (t_1 (/ z (* x y))))
(if (<= x -0.0088)
(/ (+ (* (/ y x) t_1) (* z 0.5)) (* z t_1))
(if (<= x -5e-264)
(/ (/ y z) x)
(if (<= x 110.0)
(+ (/ y (* x z)) (* 0.5 (* x (/ y z))))
(/ (- (* z (* (/ x y) -0.5)) t_0) (/ (- x) (/ (/ y z) t_0))))))))
double code(double x, double y, double z) {
double t_0 = (z / x) / y;
double t_1 = z / (x * y);
double tmp;
if (x <= -0.0088) {
tmp = (((y / x) * t_1) + (z * 0.5)) / (z * t_1);
} else if (x <= -5e-264) {
tmp = (y / z) / x;
} else if (x <= 110.0) {
tmp = (y / (x * z)) + (0.5 * (x * (y / z)));
} else {
tmp = ((z * ((x / y) * -0.5)) - t_0) / (-x / ((y / z) / 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) :: t_1
real(8) :: tmp
t_0 = (z / x) / y
t_1 = z / (x * y)
if (x <= (-0.0088d0)) then
tmp = (((y / x) * t_1) + (z * 0.5d0)) / (z * t_1)
else if (x <= (-5d-264)) then
tmp = (y / z) / x
else if (x <= 110.0d0) then
tmp = (y / (x * z)) + (0.5d0 * (x * (y / z)))
else
tmp = ((z * ((x / y) * (-0.5d0))) - t_0) / (-x / ((y / z) / t_0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z / x) / y;
double t_1 = z / (x * y);
double tmp;
if (x <= -0.0088) {
tmp = (((y / x) * t_1) + (z * 0.5)) / (z * t_1);
} else if (x <= -5e-264) {
tmp = (y / z) / x;
} else if (x <= 110.0) {
tmp = (y / (x * z)) + (0.5 * (x * (y / z)));
} else {
tmp = ((z * ((x / y) * -0.5)) - t_0) / (-x / ((y / z) / t_0));
}
return tmp;
}
def code(x, y, z): t_0 = (z / x) / y t_1 = z / (x * y) tmp = 0 if x <= -0.0088: tmp = (((y / x) * t_1) + (z * 0.5)) / (z * t_1) elif x <= -5e-264: tmp = (y / z) / x elif x <= 110.0: tmp = (y / (x * z)) + (0.5 * (x * (y / z))) else: tmp = ((z * ((x / y) * -0.5)) - t_0) / (-x / ((y / z) / t_0)) return tmp
function code(x, y, z) t_0 = Float64(Float64(z / x) / y) t_1 = Float64(z / Float64(x * y)) tmp = 0.0 if (x <= -0.0088) tmp = Float64(Float64(Float64(Float64(y / x) * t_1) + Float64(z * 0.5)) / Float64(z * t_1)); elseif (x <= -5e-264) tmp = Float64(Float64(y / z) / x); elseif (x <= 110.0) tmp = Float64(Float64(y / Float64(x * z)) + Float64(0.5 * Float64(x * Float64(y / z)))); else tmp = Float64(Float64(Float64(z * Float64(Float64(x / y) * -0.5)) - t_0) / Float64(Float64(-x) / Float64(Float64(y / z) / t_0))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z / x) / y; t_1 = z / (x * y); tmp = 0.0; if (x <= -0.0088) tmp = (((y / x) * t_1) + (z * 0.5)) / (z * t_1); elseif (x <= -5e-264) tmp = (y / z) / x; elseif (x <= 110.0) tmp = (y / (x * z)) + (0.5 * (x * (y / z))); else tmp = ((z * ((x / y) * -0.5)) - t_0) / (-x / ((y / z) / t_0)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z / x), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$1 = N[(z / N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.0088], N[(N[(N[(N[(y / x), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] / N[(z * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5e-264], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 110.0], N[(N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * N[(N[(x / y), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] / N[((-x) / N[(N[(y / z), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{z}{x}}{y}\\
t_1 := \frac{z}{x \cdot y}\\
\mathbf{if}\;x \leq -0.0088:\\
\;\;\;\;\frac{\frac{y}{x} \cdot t_1 + z \cdot 0.5}{z \cdot t_1}\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-264}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\mathbf{elif}\;x \leq 110:\\
\;\;\;\;\frac{y}{x \cdot z} + 0.5 \cdot \left(x \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(\frac{x}{y} \cdot -0.5\right) - t_0}{\frac{-x}{\frac{\frac{y}{z}}{t_0}}}\\
\end{array}
\end{array}
if x < -0.00880000000000000053Initial program 88.6%
associate-*r/75.4%
associate-/r*67.9%
Simplified67.9%
Taylor expanded in x around 0 43.1%
clear-num43.1%
un-div-inv43.1%
*-commutative43.1%
Applied egg-rr43.1%
+-commutative43.1%
associate-/r*43.1%
frac-add51.9%
*-commutative51.9%
*-commutative51.9%
Applied egg-rr51.9%
if -0.00880000000000000053 < x < -5.0000000000000001e-264Initial program 91.1%
associate-*l/91.1%
Simplified91.1%
Taylor expanded in x around 0 91.1%
associate-*r/94.0%
associate-*l/94.0%
*-un-lft-identity94.0%
Applied egg-rr94.0%
if -5.0000000000000001e-264 < x < 110Initial program 89.8%
associate-*r/89.7%
associate-/r*95.8%
Simplified95.8%
Taylor expanded in x around 0 93.3%
div-inv93.3%
associate-*l*93.3%
*-commutative93.3%
associate-*l/93.3%
*-un-lft-identity93.3%
Applied egg-rr93.3%
if 110 < x Initial program 69.8%
associate-*r/54.7%
associate-/r*60.4%
Simplified60.4%
Taylor expanded in x around 0 34.6%
clear-num34.6%
un-div-inv34.6%
*-commutative34.6%
Applied egg-rr34.6%
frac-2neg34.6%
associate-/l/34.6%
clear-num34.6%
frac-add20.6%
metadata-eval20.6%
*-commutative20.6%
*-commutative20.6%
Applied egg-rr20.6%
fma-def20.6%
associate-/l*28.1%
*-rgt-identity28.1%
fma-neg28.1%
*-commutative28.1%
associate-*l/35.2%
*-commutative35.2%
associate-*l*35.2%
associate-/r*35.2%
associate-*r/42.7%
*-commutative42.7%
distribute-rgt-neg-out42.7%
distribute-lft-neg-out42.7%
associate-/l*49.8%
associate-/r*48.0%
Simplified48.0%
Final simplification75.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (* 0.5 (/ (* x y) z)) (/ y (* x z)))))
(if (<= z -1.7e+93)
t_0
(if (<= z 2.2e-68)
(/ (+ (/ y x) (* 0.5 (* x y))) z)
(if (<= z 1.15e+42)
(/ (* z (+ y (* y (* 0.5 (* x x))))) (* x (* z z)))
t_0)))))
double code(double x, double y, double z) {
double t_0 = (0.5 * ((x * y) / z)) + (y / (x * z));
double tmp;
if (z <= -1.7e+93) {
tmp = t_0;
} else if (z <= 2.2e-68) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else if (z <= 1.15e+42) {
tmp = (z * (y + (y * (0.5 * (x * x))))) / (x * (z * 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 = (0.5d0 * ((x * y) / z)) + (y / (x * z))
if (z <= (-1.7d+93)) then
tmp = t_0
else if (z <= 2.2d-68) then
tmp = ((y / x) + (0.5d0 * (x * y))) / z
else if (z <= 1.15d+42) then
tmp = (z * (y + (y * (0.5d0 * (x * x))))) / (x * (z * z))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (0.5 * ((x * y) / z)) + (y / (x * z));
double tmp;
if (z <= -1.7e+93) {
tmp = t_0;
} else if (z <= 2.2e-68) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else if (z <= 1.15e+42) {
tmp = (z * (y + (y * (0.5 * (x * x))))) / (x * (z * z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (0.5 * ((x * y) / z)) + (y / (x * z)) tmp = 0 if z <= -1.7e+93: tmp = t_0 elif z <= 2.2e-68: tmp = ((y / x) + (0.5 * (x * y))) / z elif z <= 1.15e+42: tmp = (z * (y + (y * (0.5 * (x * x))))) / (x * (z * z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(0.5 * Float64(Float64(x * y) / z)) + Float64(y / Float64(x * z))) tmp = 0.0 if (z <= -1.7e+93) tmp = t_0; elseif (z <= 2.2e-68) tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z); elseif (z <= 1.15e+42) tmp = Float64(Float64(z * Float64(y + Float64(y * Float64(0.5 * Float64(x * x))))) / Float64(x * Float64(z * z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (0.5 * ((x * y) / z)) + (y / (x * z)); tmp = 0.0; if (z <= -1.7e+93) tmp = t_0; elseif (z <= 2.2e-68) tmp = ((y / x) + (0.5 * (x * y))) / z; elseif (z <= 1.15e+42) tmp = (z * (y + (y * (0.5 * (x * x))))) / (x * (z * z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(0.5 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+93], t$95$0, If[LessEqual[z, 2.2e-68], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.15e+42], N[(N[(z * N[(y + N[(y * N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \frac{x \cdot y}{z} + \frac{y}{x \cdot z}\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+93}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-68}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+42}:\\
\;\;\;\;\frac{z \cdot \left(y + y \cdot \left(0.5 \cdot \left(x \cdot x\right)\right)\right)}{x \cdot \left(z \cdot z\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1.7e93 or 1.15e42 < z Initial program 80.9%
associate-*r/67.0%
associate-/r*72.0%
Simplified72.0%
Taylor expanded in x around 0 70.7%
if -1.7e93 < z < 2.20000000000000002e-68Initial program 88.2%
Taylor expanded in x around 0 78.0%
if 2.20000000000000002e-68 < z < 1.15e42Initial program 92.5%
associate-*r/92.5%
associate-/r*95.0%
Simplified95.0%
Taylor expanded in x around 0 63.3%
associate-*r/63.3%
frac-add78.5%
*-commutative78.5%
associate-*r*78.5%
Applied egg-rr78.5%
*-commutative78.5%
associate-*l*78.5%
+-commutative78.5%
*-commutative78.5%
associate-*r*78.5%
distribute-rgt-out78.5%
associate-*l*82.1%
*-commutative82.1%
associate-*l*82.1%
Simplified82.1%
Final simplification75.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -4.6e-54) (not (<= z 5.7e-291))) (+ (/ y (* x z)) (* 0.5 (* y (/ x z)))) (/ (+ (/ y x) (* 0.5 (* x y))) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4.6e-54) || !(z <= 5.7e-291)) {
tmp = (y / (x * z)) + (0.5 * (y * (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 ((z <= (-4.6d-54)) .or. (.not. (z <= 5.7d-291))) then
tmp = (y / (x * z)) + (0.5d0 * (y * (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 ((z <= -4.6e-54) || !(z <= 5.7e-291)) {
tmp = (y / (x * z)) + (0.5 * (y * (x / z)));
} else {
tmp = ((y / x) + (0.5 * (x * y))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4.6e-54) or not (z <= 5.7e-291): tmp = (y / (x * z)) + (0.5 * (y * (x / z))) else: tmp = ((y / x) + (0.5 * (x * y))) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4.6e-54) || !(z <= 5.7e-291)) tmp = Float64(Float64(y / Float64(x * z)) + Float64(0.5 * Float64(y * 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 ((z <= -4.6e-54) || ~((z <= 5.7e-291))) tmp = (y / (x * z)) + (0.5 * (y * (x / z))); else tmp = ((y / x) + (0.5 * (x * y))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4.6e-54], N[Not[LessEqual[z, 5.7e-291]], $MachinePrecision]], N[(N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(y * 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}\;z \leq -4.6 \cdot 10^{-54} \lor \neg \left(z \leq 5.7 \cdot 10^{-291}\right):\\
\;\;\;\;\frac{y}{x \cdot z} + 0.5 \cdot \left(y \cdot \frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\end{array}
\end{array}
if z < -4.5999999999999998e-54 or 5.70000000000000034e-291 < z Initial program 84.0%
associate-*r/76.6%
associate-/r*79.7%
Simplified79.7%
Taylor expanded in x around 0 68.7%
associate-/l*65.9%
associate-/r/68.7%
Applied egg-rr68.7%
if -4.5999999999999998e-54 < z < 5.70000000000000034e-291Initial program 92.3%
Taylor expanded in x around 0 87.4%
Final simplification72.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ y (* x z))))
(if (<= z -1.7e+93)
(+ (* 0.5 (/ (* x y) z)) t_0)
(if (<= z 2.35e-290)
(/ (+ (/ y x) (* 0.5 (* x y))) z)
(+ t_0 (* 0.5 (* y (/ x z))))))))
double code(double x, double y, double z) {
double t_0 = y / (x * z);
double tmp;
if (z <= -1.7e+93) {
tmp = (0.5 * ((x * y) / z)) + t_0;
} else if (z <= 2.35e-290) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = t_0 + (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) :: t_0
real(8) :: tmp
t_0 = y / (x * z)
if (z <= (-1.7d+93)) then
tmp = (0.5d0 * ((x * y) / z)) + t_0
else if (z <= 2.35d-290) then
tmp = ((y / x) + (0.5d0 * (x * y))) / z
else
tmp = t_0 + (0.5d0 * (y * (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y / (x * z);
double tmp;
if (z <= -1.7e+93) {
tmp = (0.5 * ((x * y) / z)) + t_0;
} else if (z <= 2.35e-290) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = t_0 + (0.5 * (y * (x / z)));
}
return tmp;
}
def code(x, y, z): t_0 = y / (x * z) tmp = 0 if z <= -1.7e+93: tmp = (0.5 * ((x * y) / z)) + t_0 elif z <= 2.35e-290: tmp = ((y / x) + (0.5 * (x * y))) / z else: tmp = t_0 + (0.5 * (y * (x / z))) return tmp
function code(x, y, z) t_0 = Float64(y / Float64(x * z)) tmp = 0.0 if (z <= -1.7e+93) tmp = Float64(Float64(0.5 * Float64(Float64(x * y) / z)) + t_0); elseif (z <= 2.35e-290) tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z); else tmp = Float64(t_0 + Float64(0.5 * Float64(y * Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y / (x * z); tmp = 0.0; if (z <= -1.7e+93) tmp = (0.5 * ((x * y) / z)) + t_0; elseif (z <= 2.35e-290) tmp = ((y / x) + (0.5 * (x * y))) / z; else tmp = t_0 + (0.5 * (y * (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+93], N[(N[(0.5 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[z, 2.35e-290], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(t$95$0 + N[(0.5 * N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot z}\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+93}:\\
\;\;\;\;0.5 \cdot \frac{x \cdot y}{z} + t_0\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-290}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0 + 0.5 \cdot \left(y \cdot \frac{x}{z}\right)\\
\end{array}
\end{array}
if z < -1.7e93Initial program 80.2%
associate-*r/65.6%
associate-/r*72.5%
Simplified72.5%
Taylor expanded in x around 0 71.3%
if -1.7e93 < z < 2.3500000000000001e-290Initial program 89.1%
Taylor expanded in x around 0 79.0%
if 2.3500000000000001e-290 < z Initial program 85.6%
associate-*r/79.9%
associate-/r*82.3%
Simplified82.3%
Taylor expanded in x around 0 68.8%
associate-/l*67.3%
associate-/r/71.1%
Applied egg-rr71.1%
Final simplification73.7%
(FPCore (x y z) :precision binary64 (if (<= z -6.2e+92) (+ (/ y (* x z)) (* 0.5 (* x (/ y z)))) (/ (+ (/ y x) (* 0.5 (* x y))) z)))
double code(double x, double y, double z) {
double tmp;
if (z <= -6.2e+92) {
tmp = (y / (x * z)) + (0.5 * (x * (y / 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 (z <= (-6.2d+92)) then
tmp = (y / (x * z)) + (0.5d0 * (x * (y / 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 (z <= -6.2e+92) {
tmp = (y / (x * z)) + (0.5 * (x * (y / z)));
} else {
tmp = ((y / x) + (0.5 * (x * y))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -6.2e+92: tmp = (y / (x * z)) + (0.5 * (x * (y / z))) else: tmp = ((y / x) + (0.5 * (x * y))) / z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -6.2e+92) tmp = Float64(Float64(y / Float64(x * z)) + Float64(0.5 * Float64(x * Float64(y / 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 (z <= -6.2e+92) tmp = (y / (x * z)) + (0.5 * (x * (y / z))); else tmp = ((y / x) + (0.5 * (x * y))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -6.2e+92], N[(N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(x * N[(y / 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}\;z \leq -6.2 \cdot 10^{+92}:\\
\;\;\;\;\frac{y}{x \cdot z} + 0.5 \cdot \left(x \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\end{array}
\end{array}
if z < -6.2000000000000004e92Initial program 80.2%
associate-*r/65.6%
associate-/r*72.5%
Simplified72.5%
Taylor expanded in x around 0 71.3%
div-inv71.3%
associate-*l*63.4%
*-commutative63.4%
associate-*l/63.4%
*-un-lft-identity63.4%
Applied egg-rr63.4%
if -6.2000000000000004e92 < z Initial program 87.0%
Taylor expanded in x around 0 72.0%
Final simplification70.4%
(FPCore (x y z) :precision binary64 (if (<= z -4.7e+195) (/ y (* x z)) (/ (+ (/ y x) (* 0.5 (* x y))) z)))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.7e+195) {
tmp = y / (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 (z <= (-4.7d+195)) then
tmp = y / (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 (z <= -4.7e+195) {
tmp = y / (x * z);
} else {
tmp = ((y / x) + (0.5 * (x * y))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.7e+195: tmp = y / (x * z) else: tmp = ((y / x) + (0.5 * (x * y))) / z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.7e+195) tmp = Float64(y / 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 (z <= -4.7e+195) tmp = y / (x * z); else tmp = ((y / x) + (0.5 * (x * y))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.7e+195], N[(y / N[(x * z), $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}\;z \leq -4.7 \cdot 10^{+195}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\end{array}
\end{array}
if z < -4.6999999999999999e195Initial program 72.5%
associate-*r/56.3%
associate-/r*70.6%
Simplified70.6%
Taylor expanded in x around 0 67.9%
if -4.6999999999999999e195 < z Initial program 87.6%
Taylor expanded in x around 0 70.2%
Final simplification69.9%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.4) (not (<= x 1.4))) (* 0.5 (/ x (/ z y))) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4) || !(x <= 1.4)) {
tmp = 0.5 * (x / (z / y));
} 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 / (z / y))
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 / (z / y));
} 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 / (z / y)) 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(z / y))); 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 / (z / y)); 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[(z / y), $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 \frac{x}{\frac{z}{y}}\\
\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%
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%
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 (<= y -7.2e+37) (not (<= y 3.6e-67))) (/ (/ y z) x) (/ (/ y x) z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -7.2e+37) || !(y <= 3.6e-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 <= (-7.2d+37)) .or. (.not. (y <= 3.6d-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 <= -7.2e+37) || !(y <= 3.6e-67)) {
tmp = (y / z) / x;
} else {
tmp = (y / x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -7.2e+37) or not (y <= 3.6e-67): tmp = (y / z) / x else: tmp = (y / x) / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -7.2e+37) || !(y <= 3.6e-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 <= -7.2e+37) || ~((y <= 3.6e-67))) tmp = (y / z) / x; else tmp = (y / x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -7.2e+37], N[Not[LessEqual[y, 3.6e-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 -7.2 \cdot 10^{+37} \lor \neg \left(y \leq 3.6 \cdot 10^{-67}\right):\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\
\end{array}
\end{array}
if y < -7.19999999999999995e37 or 3.59999999999999999e-67 < y Initial program 89.3%
associate-*l/89.2%
Simplified89.2%
Taylor expanded in x around 0 51.8%
associate-*r/68.0%
associate-*l/68.1%
*-un-lft-identity68.1%
Applied egg-rr68.1%
if -7.19999999999999995e37 < y < 3.59999999999999999e-67Initial program 81.9%
associate-*r/76.2%
associate-/r*74.7%
Simplified74.7%
Taylor expanded in x around 0 51.5%
associate-/r*59.5%
Simplified59.5%
Final simplification64.0%
(FPCore (x y z) :precision binary64 (if (<= y -1.9e-41) (/ y (* x z)) (/ (/ y x) z)))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.9e-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.9d-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.9e-41) {
tmp = y / (x * z);
} else {
tmp = (y / x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.9e-41: tmp = y / (x * z) else: tmp = (y / x) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.9e-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.9e-41) tmp = y / (x * z); else tmp = (y / x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.9e-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.9 \cdot 10^{-41}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\
\end{array}
\end{array}
if y < -1.8999999999999999e-41Initial program 87.2%
associate-*r/84.8%
associate-/r*91.3%
Simplified91.3%
Taylor expanded in x around 0 60.4%
if -1.8999999999999999e-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-/r*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))