
(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 18 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 (<= t_0 2e+210) (/ t_0 z) (* y (/ (/ (cosh x) z) x)))))
double code(double x, double y, double z) {
double t_0 = cosh(x) * (y / x);
double tmp;
if (t_0 <= 2e+210) {
tmp = t_0 / z;
} else {
tmp = y * ((cosh(x) / z) / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = cosh(x) * (y / x)
if (t_0 <= 2d+210) then
tmp = t_0 / z
else
tmp = y * ((cosh(x) / z) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.cosh(x) * (y / x);
double tmp;
if (t_0 <= 2e+210) {
tmp = t_0 / z;
} else {
tmp = y * ((Math.cosh(x) / z) / x);
}
return tmp;
}
def code(x, y, z): t_0 = math.cosh(x) * (y / x) tmp = 0 if t_0 <= 2e+210: tmp = t_0 / z else: tmp = y * ((math.cosh(x) / z) / x) return tmp
function code(x, y, z) t_0 = Float64(cosh(x) * Float64(y / x)) tmp = 0.0 if (t_0 <= 2e+210) tmp = Float64(t_0 / z); else tmp = Float64(y * Float64(Float64(cosh(x) / z) / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = cosh(x) * (y / x); tmp = 0.0; if (t_0 <= 2e+210) tmp = t_0 / z; else tmp = y * ((cosh(x) / z) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e+210], N[(t$95$0 / z), $MachinePrecision], N[(y * N[(N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cosh x \cdot \frac{y}{x}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{+210}:\\
\;\;\;\;\frac{t_0}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{\cosh x}{z}}{x}\\
\end{array}
\end{array}
if (*.f64 (cosh.f64 x) (/.f64 y x)) < 1.99999999999999985e210Initial program 98.6%
if 1.99999999999999985e210 < (*.f64 (cosh.f64 x) (/.f64 y x)) Initial program 68.7%
associate-*r/60.2%
associate-/r*69.5%
Simplified69.5%
associate-*r/84.7%
*-commutative84.7%
frac-times68.8%
expm1-log1p-u32.3%
expm1-udef29.6%
frac-times40.7%
*-commutative40.7%
associate-*r/35.0%
associate-/r*27.7%
Applied egg-rr27.7%
expm1-def30.4%
expm1-log1p60.2%
associate-*r/68.7%
associate-*l/68.8%
*-commutative68.8%
associate-*l/99.9%
associate-*r/99.9%
Simplified99.9%
Final simplification99.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(/
(/
y
(/ (+ (* x 0.5) (/ -1.0 x)) (+ (* x (* x 0.25)) (/ -1.0 (* x x)))))
z))
(t_1 (* y (/ (cosh x) (* x z)))))
(if (<= x -1.45e+191)
t_0
(if (<= x -1.65e-76)
t_1
(if (<= x -1.8e-222)
(* (/ y x) (/ 1.0 z))
(if (<= x 2.7e+154) t_1 t_0))))))
double code(double x, double y, double z) {
double t_0 = (y / (((x * 0.5) + (-1.0 / x)) / ((x * (x * 0.25)) + (-1.0 / (x * x))))) / z;
double t_1 = y * (cosh(x) / (x * z));
double tmp;
if (x <= -1.45e+191) {
tmp = t_0;
} else if (x <= -1.65e-76) {
tmp = t_1;
} else if (x <= -1.8e-222) {
tmp = (y / x) * (1.0 / z);
} else if (x <= 2.7e+154) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = (y / (((x * 0.5d0) + ((-1.0d0) / x)) / ((x * (x * 0.25d0)) + ((-1.0d0) / (x * x))))) / z
t_1 = y * (cosh(x) / (x * z))
if (x <= (-1.45d+191)) then
tmp = t_0
else if (x <= (-1.65d-76)) then
tmp = t_1
else if (x <= (-1.8d-222)) then
tmp = (y / x) * (1.0d0 / z)
else if (x <= 2.7d+154) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y / (((x * 0.5) + (-1.0 / x)) / ((x * (x * 0.25)) + (-1.0 / (x * x))))) / z;
double t_1 = y * (Math.cosh(x) / (x * z));
double tmp;
if (x <= -1.45e+191) {
tmp = t_0;
} else if (x <= -1.65e-76) {
tmp = t_1;
} else if (x <= -1.8e-222) {
tmp = (y / x) * (1.0 / z);
} else if (x <= 2.7e+154) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (y / (((x * 0.5) + (-1.0 / x)) / ((x * (x * 0.25)) + (-1.0 / (x * x))))) / z t_1 = y * (math.cosh(x) / (x * z)) tmp = 0 if x <= -1.45e+191: tmp = t_0 elif x <= -1.65e-76: tmp = t_1 elif x <= -1.8e-222: tmp = (y / x) * (1.0 / z) elif x <= 2.7e+154: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(y / Float64(Float64(Float64(x * 0.5) + Float64(-1.0 / x)) / Float64(Float64(x * Float64(x * 0.25)) + Float64(-1.0 / Float64(x * x))))) / z) t_1 = Float64(y * Float64(cosh(x) / Float64(x * z))) tmp = 0.0 if (x <= -1.45e+191) tmp = t_0; elseif (x <= -1.65e-76) tmp = t_1; elseif (x <= -1.8e-222) tmp = Float64(Float64(y / x) * Float64(1.0 / z)); elseif (x <= 2.7e+154) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y / (((x * 0.5) + (-1.0 / x)) / ((x * (x * 0.25)) + (-1.0 / (x * x))))) / z; t_1 = y * (cosh(x) / (x * z)); tmp = 0.0; if (x <= -1.45e+191) tmp = t_0; elseif (x <= -1.65e-76) tmp = t_1; elseif (x <= -1.8e-222) tmp = (y / x) * (1.0 / z); elseif (x <= 2.7e+154) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y / N[(N[(N[(x * 0.5), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision] / N[(N[(x * N[(x * 0.25), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(N[Cosh[x], $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45e+191], t$95$0, If[LessEqual[x, -1.65e-76], t$95$1, If[LessEqual[x, -1.8e-222], N[(N[(y / x), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.7e+154], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{\frac{x \cdot 0.5 + \frac{-1}{x}}{x \cdot \left(x \cdot 0.25\right) + \frac{-1}{x \cdot x}}}}{z}\\
t_1 := y \cdot \frac{\cosh x}{x \cdot z}\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{+191}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.65 \cdot 10^{-76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-222}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{z}\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.4500000000000001e191 or 2.70000000000000006e154 < x Initial program 63.5%
Taylor expanded in x around 0 48.3%
Taylor expanded in y around 0 48.3%
distribute-lft-in48.3%
flip-+45.3%
*-commutative45.3%
*-commutative45.3%
un-div-inv45.3%
un-div-inv45.3%
*-commutative45.3%
un-div-inv45.3%
Applied egg-rr45.3%
Taylor expanded in y around 0 100.0%
associate-/l*100.0%
*-commutative100.0%
*-commutative100.0%
unpow2100.0%
associate-*l*100.0%
unpow2100.0%
Simplified100.0%
if -1.4500000000000001e191 < x < -1.64999999999999992e-76 or -1.79999999999999987e-222 < x < 2.70000000000000006e154Initial program 91.4%
associate-*r/85.1%
associate-/r*86.3%
Simplified86.3%
associate-*r/91.4%
*-commutative91.4%
frac-times91.4%
expm1-log1p-u55.0%
expm1-udef39.8%
frac-times41.4%
*-commutative41.4%
associate-*r/38.5%
associate-/r*36.3%
Applied egg-rr36.3%
expm1-def51.5%
expm1-log1p85.1%
associate-*r/91.4%
associate-*l/91.4%
*-commutative91.4%
*-rgt-identity91.4%
associate-*r/91.3%
associate-*r*97.6%
associate-*r/97.7%
associate-*r/97.6%
associate-*l/97.7%
*-lft-identity97.7%
associate-/l/91.4%
Simplified91.4%
if -1.64999999999999992e-76 < x < -1.79999999999999987e-222Initial program 96.5%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in x around 0 96.6%
Final simplification93.8%
(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(y * Float64(Float64(cosh(x) / z) / x)) end
function tmp = code(x, y, z) tmp = y * ((cosh(x) / z) / x); end
code[x_, y_, z_] := N[(y * N[(N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \frac{\frac{\cosh x}{z}}{x}
\end{array}
Initial program 86.4%
associate-*r/80.1%
associate-/r*78.7%
Simplified78.7%
associate-*r/85.4%
*-commutative85.4%
frac-times86.3%
expm1-log1p-u48.8%
expm1-udef36.7%
frac-times38.0%
*-commutative38.0%
associate-*r/35.2%
associate-/r*33.9%
Applied egg-rr33.9%
expm1-def46.1%
expm1-log1p80.1%
associate-*r/86.4%
associate-*l/86.3%
*-commutative86.3%
associate-*l/97.3%
associate-*r/96.3%
Simplified96.3%
Final simplification96.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(*
(/ y z)
(/ (+ (* x (* x 0.25)) (/ -1.0 (* x x))) (+ (* x 0.5) (/ -1.0 x))))))
(if (<= x -7e+163)
t_0
(if (<= x 2.8e+25)
(/ (+ (/ y x) (* 0.5 (* x y))) z)
(if (<= x 7.4e+184)
(* y (/ (- (* z (* (* x 0.5) (- x))) z) (* x (* z (- z)))))
t_0)))))
double code(double x, double y, double z) {
double t_0 = (y / z) * (((x * (x * 0.25)) + (-1.0 / (x * x))) / ((x * 0.5) + (-1.0 / x)));
double tmp;
if (x <= -7e+163) {
tmp = t_0;
} else if (x <= 2.8e+25) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else if (x <= 7.4e+184) {
tmp = y * (((z * ((x * 0.5) * -x)) - z) / (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 = (y / z) * (((x * (x * 0.25d0)) + ((-1.0d0) / (x * x))) / ((x * 0.5d0) + ((-1.0d0) / x)))
if (x <= (-7d+163)) then
tmp = t_0
else if (x <= 2.8d+25) then
tmp = ((y / x) + (0.5d0 * (x * y))) / z
else if (x <= 7.4d+184) then
tmp = y * (((z * ((x * 0.5d0) * -x)) - z) / (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 = (y / z) * (((x * (x * 0.25)) + (-1.0 / (x * x))) / ((x * 0.5) + (-1.0 / x)));
double tmp;
if (x <= -7e+163) {
tmp = t_0;
} else if (x <= 2.8e+25) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else if (x <= 7.4e+184) {
tmp = y * (((z * ((x * 0.5) * -x)) - z) / (x * (z * -z)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (y / z) * (((x * (x * 0.25)) + (-1.0 / (x * x))) / ((x * 0.5) + (-1.0 / x))) tmp = 0 if x <= -7e+163: tmp = t_0 elif x <= 2.8e+25: tmp = ((y / x) + (0.5 * (x * y))) / z elif x <= 7.4e+184: tmp = y * (((z * ((x * 0.5) * -x)) - z) / (x * (z * -z))) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(y / z) * Float64(Float64(Float64(x * Float64(x * 0.25)) + Float64(-1.0 / Float64(x * x))) / Float64(Float64(x * 0.5) + Float64(-1.0 / x)))) tmp = 0.0 if (x <= -7e+163) tmp = t_0; elseif (x <= 2.8e+25) tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z); elseif (x <= 7.4e+184) tmp = Float64(y * Float64(Float64(Float64(z * Float64(Float64(x * 0.5) * Float64(-x))) - z) / Float64(x * Float64(z * Float64(-z))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y / z) * (((x * (x * 0.25)) + (-1.0 / (x * x))) / ((x * 0.5) + (-1.0 / x))); tmp = 0.0; if (x <= -7e+163) tmp = t_0; elseif (x <= 2.8e+25) tmp = ((y / x) + (0.5 * (x * y))) / z; elseif (x <= 7.4e+184) tmp = y * (((z * ((x * 0.5) * -x)) - z) / (x * (z * -z))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y / z), $MachinePrecision] * N[(N[(N[(x * N[(x * 0.25), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x * 0.5), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7e+163], t$95$0, If[LessEqual[x, 2.8e+25], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 7.4e+184], N[(y * N[(N[(N[(z * N[(N[(x * 0.5), $MachinePrecision] * (-x)), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / N[(x * N[(z * (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{z} \cdot \frac{x \cdot \left(x \cdot 0.25\right) + \frac{-1}{x \cdot x}}{x \cdot 0.5 + \frac{-1}{x}}\\
\mathbf{if}\;x \leq -7 \cdot 10^{+163}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+25}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\mathbf{elif}\;x \leq 7.4 \cdot 10^{+184}:\\
\;\;\;\;y \cdot \frac{z \cdot \left(\left(x \cdot 0.5\right) \cdot \left(-x\right)\right) - z}{x \cdot \left(z \cdot \left(-z\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -7.0000000000000005e163 or 7.3999999999999995e184 < x Initial program 66.0%
Taylor expanded in x around 0 52.1%
Taylor expanded in y around 0 52.1%
distribute-lft-in52.1%
flip-+46.9%
*-commutative46.9%
*-commutative46.9%
un-div-inv46.9%
un-div-inv46.9%
*-commutative46.9%
un-div-inv46.9%
Applied egg-rr46.9%
Taylor expanded in y around 0 66.0%
times-frac90.0%
*-commutative90.0%
unpow290.0%
associate-*l*90.0%
unpow290.0%
*-commutative90.0%
Simplified90.0%
if -7.0000000000000005e163 < x < 2.8000000000000002e25Initial program 94.7%
Taylor expanded in x around 0 73.6%
if 2.8000000000000002e25 < x < 7.3999999999999995e184Initial program 75.0%
associate-*r/61.1%
associate-/r*75.0%
Simplified75.0%
associate-*r/86.1%
*-commutative86.1%
frac-times75.0%
expm1-log1p-u47.2%
expm1-udef47.2%
frac-times55.6%
*-commutative55.6%
associate-*r/47.2%
associate-/r*36.1%
Applied egg-rr36.1%
expm1-def36.1%
expm1-log1p61.1%
associate-*r/75.0%
associate-*l/75.0%
*-commutative75.0%
associate-*l/100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around 0 30.4%
associate-*r/30.4%
*-commutative30.4%
frac-2neg30.4%
metadata-eval30.4%
frac-add40.0%
distribute-rgt-neg-in40.0%
distribute-rgt-neg-in40.0%
Applied egg-rr40.0%
*-commutative40.0%
associate-*l*40.0%
*-commutative40.0%
neg-mul-140.0%
unsub-neg40.0%
associate-*r*47.9%
*-commutative47.9%
*-commutative47.9%
*-commutative47.9%
Simplified47.9%
Final simplification73.2%
(FPCore (x y z)
:precision binary64
(if (or (<= x -2.7e-133) (not (<= x 2.1e+154)))
(/
(/ y (/ (+ (* x 0.5) (/ -1.0 x)) (+ (* x (* x 0.25)) (/ -1.0 (* x x)))))
z)
(+ (* y (/ 1.0 (* x z))) (* y (* 0.5 (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.7e-133) || !(x <= 2.1e+154)) {
tmp = (y / (((x * 0.5) + (-1.0 / x)) / ((x * (x * 0.25)) + (-1.0 / (x * x))))) / z;
} else {
tmp = (y * (1.0 / (x * z))) + (y * (0.5 * (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 <= (-2.7d-133)) .or. (.not. (x <= 2.1d+154))) then
tmp = (y / (((x * 0.5d0) + ((-1.0d0) / x)) / ((x * (x * 0.25d0)) + ((-1.0d0) / (x * x))))) / z
else
tmp = (y * (1.0d0 / (x * z))) + (y * (0.5d0 * (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -2.7e-133) || !(x <= 2.1e+154)) {
tmp = (y / (((x * 0.5) + (-1.0 / x)) / ((x * (x * 0.25)) + (-1.0 / (x * x))))) / z;
} else {
tmp = (y * (1.0 / (x * z))) + (y * (0.5 * (x / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.7e-133) or not (x <= 2.1e+154): tmp = (y / (((x * 0.5) + (-1.0 / x)) / ((x * (x * 0.25)) + (-1.0 / (x * x))))) / z else: tmp = (y * (1.0 / (x * z))) + (y * (0.5 * (x / z))) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.7e-133) || !(x <= 2.1e+154)) tmp = Float64(Float64(y / Float64(Float64(Float64(x * 0.5) + Float64(-1.0 / x)) / Float64(Float64(x * Float64(x * 0.25)) + Float64(-1.0 / Float64(x * x))))) / z); else tmp = Float64(Float64(y * Float64(1.0 / Float64(x * z))) + Float64(y * Float64(0.5 * Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -2.7e-133) || ~((x <= 2.1e+154))) tmp = (y / (((x * 0.5) + (-1.0 / x)) / ((x * (x * 0.25)) + (-1.0 / (x * x))))) / z; else tmp = (y * (1.0 / (x * z))) + (y * (0.5 * (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.7e-133], N[Not[LessEqual[x, 2.1e+154]], $MachinePrecision]], N[(N[(y / N[(N[(N[(x * 0.5), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision] / N[(N[(x * N[(x * 0.25), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y * N[(1.0 / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(0.5 * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{-133} \lor \neg \left(x \leq 2.1 \cdot 10^{+154}\right):\\
\;\;\;\;\frac{\frac{y}{\frac{x \cdot 0.5 + \frac{-1}{x}}{x \cdot \left(x \cdot 0.25\right) + \frac{-1}{x \cdot x}}}}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{1}{x \cdot z} + y \cdot \left(0.5 \cdot \frac{x}{z}\right)\\
\end{array}
\end{array}
if x < -2.6999999999999999e-133 or 2.09999999999999994e154 < x Initial program 83.3%
Taylor expanded in x around 0 56.3%
Taylor expanded in y around 0 56.3%
distribute-lft-in56.3%
flip-+41.6%
*-commutative41.6%
*-commutative41.6%
un-div-inv41.7%
un-div-inv41.6%
*-commutative41.6%
un-div-inv41.7%
Applied egg-rr41.7%
Taylor expanded in y around 0 78.1%
associate-/l*78.1%
*-commutative78.1%
*-commutative78.1%
unpow278.1%
associate-*l*78.1%
unpow278.1%
Simplified78.1%
if -2.6999999999999999e-133 < x < 2.09999999999999994e154Initial program 89.7%
associate-*r/85.6%
associate-/r*87.5%
Simplified87.5%
associate-*r/89.9%
*-commutative89.9%
frac-times89.6%
expm1-log1p-u58.7%
expm1-udef41.1%
frac-times42.1%
*-commutative42.1%
associate-*r/39.6%
associate-/r*37.9%
Applied egg-rr37.9%
expm1-def55.5%
expm1-log1p85.6%
associate-*r/89.7%
associate-*l/89.6%
*-commutative89.6%
associate-*l/94.5%
associate-*r/93.9%
Simplified93.9%
Taylor expanded in x around 0 70.3%
+-commutative70.3%
distribute-rgt-in70.3%
*-commutative70.3%
Applied egg-rr70.3%
Final simplification74.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -4.5e+15) (not (<= x 2.8e+25))) (* y (/ (- (* z (* (* x 0.5) (- x))) z) (* x (* z (- z))))) (/ (+ (/ y x) (* 0.5 (* x y))) z)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -4.5e+15) || !(x <= 2.8e+25)) {
tmp = y * (((z * ((x * 0.5) * -x)) - z) / (x * (z * -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 ((x <= (-4.5d+15)) .or. (.not. (x <= 2.8d+25))) then
tmp = y * (((z * ((x * 0.5d0) * -x)) - z) / (x * (z * -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 ((x <= -4.5e+15) || !(x <= 2.8e+25)) {
tmp = y * (((z * ((x * 0.5) * -x)) - z) / (x * (z * -z)));
} else {
tmp = ((y / x) + (0.5 * (x * y))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -4.5e+15) or not (x <= 2.8e+25): tmp = y * (((z * ((x * 0.5) * -x)) - z) / (x * (z * -z))) else: tmp = ((y / x) + (0.5 * (x * y))) / z return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -4.5e+15) || !(x <= 2.8e+25)) tmp = Float64(y * Float64(Float64(Float64(z * Float64(Float64(x * 0.5) * Float64(-x))) - z) / Float64(x * Float64(z * Float64(-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 ((x <= -4.5e+15) || ~((x <= 2.8e+25))) tmp = y * (((z * ((x * 0.5) * -x)) - z) / (x * (z * -z))); else tmp = ((y / x) + (0.5 * (x * y))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -4.5e+15], N[Not[LessEqual[x, 2.8e+25]], $MachinePrecision]], N[(y * N[(N[(N[(z * N[(N[(x * 0.5), $MachinePrecision] * (-x)), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / N[(x * N[(z * (-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}\;x \leq -4.5 \cdot 10^{+15} \lor \neg \left(x \leq 2.8 \cdot 10^{+25}\right):\\
\;\;\;\;y \cdot \frac{z \cdot \left(\left(x \cdot 0.5\right) \cdot \left(-x\right)\right) - z}{x \cdot \left(z \cdot \left(-z\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\end{array}
\end{array}
if x < -4.5e15 or 2.8000000000000002e25 < x Initial program 77.2%
associate-*r/65.0%
associate-/r*65.0%
Simplified65.0%
associate-*r/78.0%
*-commutative78.0%
frac-times77.2%
expm1-log1p-u36.6%
expm1-udef36.6%
frac-times39.8%
*-commutative39.8%
associate-*r/34.1%
associate-/r*30.9%
Applied egg-rr30.9%
expm1-def30.9%
expm1-log1p65.0%
associate-*r/77.2%
associate-*l/77.2%
*-commutative77.2%
associate-*l/100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around 0 39.9%
associate-*r/39.9%
*-commutative39.9%
frac-2neg39.9%
metadata-eval39.9%
frac-add47.9%
distribute-rgt-neg-in47.9%
distribute-rgt-neg-in47.9%
Applied egg-rr47.9%
*-commutative47.9%
associate-*l*48.7%
*-commutative48.7%
neg-mul-148.7%
unsub-neg48.7%
associate-*r*51.8%
*-commutative51.8%
*-commutative51.8%
*-commutative51.8%
Simplified51.8%
if -4.5e15 < x < 2.8000000000000002e25Initial program 94.8%
Taylor expanded in x around 0 83.7%
Final simplification68.4%
(FPCore (x y z)
:precision binary64
(if (<= x -1.3e+232)
(* y (/ (+ (* z (* x 0.5)) (/ z x)) (* z z)))
(if (<= x 1.05e+26)
(/ (+ (/ y x) (* 0.5 (* x y))) z)
(* y (/ (+ z (* (* x 0.5) (* x z))) (* z (* x z)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.3e+232) {
tmp = y * (((z * (x * 0.5)) + (z / x)) / (z * z));
} else if (x <= 1.05e+26) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = y * ((z + ((x * 0.5) * (x * z))) / (z * (x * z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.3d+232)) then
tmp = y * (((z * (x * 0.5d0)) + (z / x)) / (z * z))
else if (x <= 1.05d+26) then
tmp = ((y / x) + (0.5d0 * (x * y))) / z
else
tmp = y * ((z + ((x * 0.5d0) * (x * z))) / (z * (x * z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.3e+232) {
tmp = y * (((z * (x * 0.5)) + (z / x)) / (z * z));
} else if (x <= 1.05e+26) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = y * ((z + ((x * 0.5) * (x * z))) / (z * (x * z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.3e+232: tmp = y * (((z * (x * 0.5)) + (z / x)) / (z * z)) elif x <= 1.05e+26: tmp = ((y / x) + (0.5 * (x * y))) / z else: tmp = y * ((z + ((x * 0.5) * (x * z))) / (z * (x * z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.3e+232) tmp = Float64(y * Float64(Float64(Float64(z * Float64(x * 0.5)) + Float64(z / x)) / Float64(z * z))); elseif (x <= 1.05e+26) tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z); else tmp = Float64(y * Float64(Float64(z + Float64(Float64(x * 0.5) * Float64(x * z))) / Float64(z * Float64(x * z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.3e+232) tmp = y * (((z * (x * 0.5)) + (z / x)) / (z * z)); elseif (x <= 1.05e+26) tmp = ((y / x) + (0.5 * (x * y))) / z; else tmp = y * ((z + ((x * 0.5) * (x * z))) / (z * (x * z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.3e+232], N[(y * N[(N[(N[(z * N[(x * 0.5), $MachinePrecision]), $MachinePrecision] + N[(z / x), $MachinePrecision]), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.05e+26], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y * N[(N[(z + N[(N[(x * 0.5), $MachinePrecision] * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{+232}:\\
\;\;\;\;y \cdot \frac{z \cdot \left(x \cdot 0.5\right) + \frac{z}{x}}{z \cdot z}\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+26}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z + \left(x \cdot 0.5\right) \cdot \left(x \cdot z\right)}{z \cdot \left(x \cdot z\right)}\\
\end{array}
\end{array}
if x < -1.29999999999999987e232Initial program 47.1%
associate-*r/35.3%
associate-/r*35.3%
Simplified35.3%
associate-*r/58.8%
*-commutative58.8%
frac-times47.1%
expm1-log1p-u29.4%
expm1-udef29.4%
frac-times35.3%
*-commutative35.3%
associate-*r/29.4%
associate-/r*23.5%
Applied egg-rr23.5%
expm1-def23.5%
expm1-log1p35.3%
associate-*r/47.1%
associate-*l/47.1%
*-commutative47.1%
associate-*l/100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around 0 65.7%
associate-*r/65.7%
*-commutative65.7%
associate-/r*65.7%
frac-add76.5%
div-inv76.5%
Applied egg-rr76.5%
if -1.29999999999999987e232 < x < 1.05e26Initial program 94.0%
Taylor expanded in x around 0 71.9%
if 1.05e26 < x Initial program 73.2%
associate-*r/62.5%
associate-/r*69.6%
Simplified69.6%
associate-*r/78.6%
*-commutative78.6%
frac-times73.2%
expm1-log1p-u39.3%
expm1-udef39.3%
frac-times46.4%
*-commutative46.4%
associate-*r/39.3%
associate-/r*32.1%
Applied egg-rr32.1%
expm1-def32.1%
expm1-log1p62.5%
associate-*r/73.2%
associate-*l/73.2%
*-commutative73.2%
associate-*l/100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around 0 38.2%
+-commutative38.2%
associate-*r/38.2%
*-commutative38.2%
frac-add47.1%
*-un-lft-identity47.1%
Applied egg-rr47.1%
Final simplification66.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -5.5e+232) (not (<= x 1.3e+17))) (* y (/ (+ (* z (* x 0.5)) (/ z x)) (* z z))) (/ (+ (/ y x) (* 0.5 (* x y))) z)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -5.5e+232) || !(x <= 1.3e+17)) {
tmp = y * (((z * (x * 0.5)) + (z / x)) / (z * 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 ((x <= (-5.5d+232)) .or. (.not. (x <= 1.3d+17))) then
tmp = y * (((z * (x * 0.5d0)) + (z / x)) / (z * 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 ((x <= -5.5e+232) || !(x <= 1.3e+17)) {
tmp = y * (((z * (x * 0.5)) + (z / x)) / (z * z));
} else {
tmp = ((y / x) + (0.5 * (x * y))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -5.5e+232) or not (x <= 1.3e+17): tmp = y * (((z * (x * 0.5)) + (z / x)) / (z * z)) else: tmp = ((y / x) + (0.5 * (x * y))) / z return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -5.5e+232) || !(x <= 1.3e+17)) tmp = Float64(y * Float64(Float64(Float64(z * Float64(x * 0.5)) + Float64(z / x)) / Float64(z * 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 ((x <= -5.5e+232) || ~((x <= 1.3e+17))) tmp = y * (((z * (x * 0.5)) + (z / x)) / (z * z)); else tmp = ((y / x) + (0.5 * (x * y))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -5.5e+232], N[Not[LessEqual[x, 1.3e+17]], $MachinePrecision]], N[(y * N[(N[(N[(z * N[(x * 0.5), $MachinePrecision]), $MachinePrecision] + N[(z / x), $MachinePrecision]), $MachinePrecision] / N[(z * z), $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}\;x \leq -5.5 \cdot 10^{+232} \lor \neg \left(x \leq 1.3 \cdot 10^{+17}\right):\\
\;\;\;\;y \cdot \frac{z \cdot \left(x \cdot 0.5\right) + \frac{z}{x}}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\end{array}
\end{array}
if x < -5.49999999999999997e232 or 1.3e17 < x Initial program 68.4%
associate-*r/57.9%
associate-/r*63.2%
Simplified63.2%
associate-*r/75.0%
*-commutative75.0%
frac-times68.4%
expm1-log1p-u38.2%
expm1-udef38.2%
frac-times44.7%
*-commutative44.7%
associate-*r/38.2%
associate-/r*31.6%
Applied egg-rr31.6%
expm1-def31.6%
expm1-log1p57.9%
associate-*r/68.4%
associate-*l/68.4%
*-commutative68.4%
associate-*l/100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around 0 43.0%
associate-*r/43.0%
*-commutative43.0%
associate-/r*43.0%
frac-add48.7%
div-inv48.7%
Applied egg-rr48.7%
if -5.49999999999999997e232 < x < 1.3e17Initial program 93.9%
Taylor expanded in x around 0 73.0%
Final simplification65.8%
(FPCore (x y z)
:precision binary64
(if (<= y -1.15e-290)
(/ (+ (/ y x) (* 0.5 (* x y))) z)
(if (<= y 2.8e+233)
(/ (- y) (/ z (+ (* x -0.5) (/ -1.0 x))))
(/ (* y (+ (* x 0.5) (/ 1.0 x))) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.15e-290) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else if (y <= 2.8e+233) {
tmp = -y / (z / ((x * -0.5) + (-1.0 / x)));
} else {
tmp = (y * ((x * 0.5) + (1.0 / x))) / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1.15d-290)) then
tmp = ((y / x) + (0.5d0 * (x * y))) / z
else if (y <= 2.8d+233) then
tmp = -y / (z / ((x * (-0.5d0)) + ((-1.0d0) / x)))
else
tmp = (y * ((x * 0.5d0) + (1.0d0 / x))) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.15e-290) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else if (y <= 2.8e+233) {
tmp = -y / (z / ((x * -0.5) + (-1.0 / x)));
} else {
tmp = (y * ((x * 0.5) + (1.0 / x))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.15e-290: tmp = ((y / x) + (0.5 * (x * y))) / z elif y <= 2.8e+233: tmp = -y / (z / ((x * -0.5) + (-1.0 / x))) else: tmp = (y * ((x * 0.5) + (1.0 / x))) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.15e-290) tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z); elseif (y <= 2.8e+233) tmp = Float64(Float64(-y) / Float64(z / Float64(Float64(x * -0.5) + Float64(-1.0 / x)))); else tmp = Float64(Float64(y * Float64(Float64(x * 0.5) + Float64(1.0 / x))) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.15e-290) tmp = ((y / x) + (0.5 * (x * y))) / z; elseif (y <= 2.8e+233) tmp = -y / (z / ((x * -0.5) + (-1.0 / x))); else tmp = (y * ((x * 0.5) + (1.0 / x))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.15e-290], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 2.8e+233], N[((-y) / N[(z / N[(N[(x * -0.5), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(N[(x * 0.5), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{-290}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+233}:\\
\;\;\;\;\frac{-y}{\frac{z}{x \cdot -0.5 + \frac{-1}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(x \cdot 0.5 + \frac{1}{x}\right)}{z}\\
\end{array}
\end{array}
if y < -1.15e-290Initial program 88.4%
Taylor expanded in x around 0 55.9%
if -1.15e-290 < y < 2.8000000000000001e233Initial program 83.0%
associate-*r/80.6%
associate-/r*84.1%
Simplified84.1%
associate-*r/92.2%
*-commutative92.2%
frac-times83.0%
expm1-log1p-u50.6%
expm1-udef35.2%
frac-times39.5%
*-commutative39.5%
associate-*r/36.3%
associate-/r*32.8%
Applied egg-rr32.8%
expm1-def48.1%
expm1-log1p80.6%
associate-*r/83.0%
associate-*l/83.0%
*-commutative83.0%
associate-*l/97.5%
associate-*r/96.1%
Simplified96.1%
Taylor expanded in x around 0 66.5%
Taylor expanded in z around -inf 61.7%
mul-1-neg61.7%
associate-/l*65.7%
*-commutative65.7%
Simplified65.7%
if 2.8000000000000001e233 < y Initial program 95.6%
Taylor expanded in x around 0 95.6%
Taylor expanded in y around 0 95.6%
Final simplification63.8%
(FPCore (x y z) :precision binary64 (if (<= x -3.7e-222) (/ (+ (/ y x) (* 0.5 (* x y))) z) (* y (+ (/ 1.0 (* x z)) (* 0.5 (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.7e-222) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = y * ((1.0 / (x * z)) + (0.5 * (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 <= (-3.7d-222)) then
tmp = ((y / x) + (0.5d0 * (x * y))) / z
else
tmp = y * ((1.0d0 / (x * z)) + (0.5d0 * (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.7e-222) {
tmp = ((y / x) + (0.5 * (x * y))) / z;
} else {
tmp = y * ((1.0 / (x * z)) + (0.5 * (x / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.7e-222: tmp = ((y / x) + (0.5 * (x * y))) / z else: tmp = y * ((1.0 / (x * z)) + (0.5 * (x / z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.7e-222) tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z); else tmp = Float64(y * Float64(Float64(1.0 / Float64(x * z)) + Float64(0.5 * Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.7e-222) tmp = ((y / x) + (0.5 * (x * y))) / z; else tmp = y * ((1.0 / (x * z)) + (0.5 * (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.7e-222], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y * N[(N[(1.0 / N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7 \cdot 10^{-222}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\frac{1}{x \cdot z} + 0.5 \cdot \frac{x}{z}\right)\\
\end{array}
\end{array}
if x < -3.6999999999999999e-222Initial program 88.9%
Taylor expanded in x around 0 64.6%
if -3.6999999999999999e-222 < x Initial program 83.8%
associate-*r/79.1%
associate-/r*83.8%
Simplified83.8%
associate-*r/87.7%
*-commutative87.7%
frac-times83.7%
expm1-log1p-u51.7%
expm1-udef37.7%
frac-times42.2%
*-commutative42.2%
associate-*r/39.1%
associate-/r*34.6%
Applied egg-rr34.6%
expm1-def48.6%
expm1-log1p79.1%
associate-*r/83.8%
associate-*l/83.7%
*-commutative83.7%
associate-*l/96.2%
associate-*r/97.0%
Simplified97.0%
Taylor expanded in x around 0 62.9%
Final simplification63.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.6) (not (<= x 1.4))) (* 0.5 (* x (/ y z))) (/ (/ y z) x)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.6) || !(x <= 1.4)) {
tmp = 0.5 * (x * (y / z));
} else {
tmp = (y / z) / x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.6d0)) .or. (.not. (x <= 1.4d0))) then
tmp = 0.5d0 * (x * (y / z))
else
tmp = (y / z) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.6) || !(x <= 1.4)) {
tmp = 0.5 * (x * (y / z));
} else {
tmp = (y / z) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.6) or not (x <= 1.4): tmp = 0.5 * (x * (y / z)) else: tmp = (y / z) / x return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.6) || !(x <= 1.4)) tmp = Float64(0.5 * Float64(x * Float64(y / z))); else tmp = Float64(Float64(y / z) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.6) || ~((x <= 1.4))) tmp = 0.5 * (x * (y / z)); else tmp = (y / z) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.6], N[Not[LessEqual[x, 1.4]], $MachinePrecision]], N[(0.5 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \lor \neg \left(x \leq 1.4\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\end{array}
\end{array}
if x < -1.6000000000000001 or 1.3999999999999999 < x Initial program 79.8%
Taylor expanded in x around 0 35.7%
Taylor expanded in x around inf 35.7%
associate-/l*29.0%
associate-/r/37.2%
Simplified37.2%
Taylor expanded in x around 0 35.7%
*-commutative35.7%
associate-*l/29.0%
*-commutative29.0%
Simplified29.0%
if -1.6000000000000001 < x < 1.3999999999999999Initial program 94.1%
associate-*l/94.0%
Simplified94.0%
Taylor expanded in x around 0 91.7%
associate-*r/91.8%
associate-*l/91.9%
*-un-lft-identity91.9%
Applied egg-rr91.9%
Final simplification57.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.6) (not (<= x 1.4))) (* 0.5 (* y (/ x z))) (/ (/ y z) x)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.6) || !(x <= 1.4)) {
tmp = 0.5 * (y * (x / z));
} else {
tmp = (y / z) / x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.6d0)) .or. (.not. (x <= 1.4d0))) then
tmp = 0.5d0 * (y * (x / z))
else
tmp = (y / z) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.6) || !(x <= 1.4)) {
tmp = 0.5 * (y * (x / z));
} else {
tmp = (y / z) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.6) or not (x <= 1.4): tmp = 0.5 * (y * (x / z)) else: tmp = (y / z) / x return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.6) || !(x <= 1.4)) tmp = Float64(0.5 * Float64(y * Float64(x / z))); else tmp = Float64(Float64(y / z) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.6) || ~((x <= 1.4))) tmp = 0.5 * (y * (x / z)); else tmp = (y / z) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.6], N[Not[LessEqual[x, 1.4]], $MachinePrecision]], N[(0.5 * N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \lor \neg \left(x \leq 1.4\right):\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\end{array}
\end{array}
if x < -1.6000000000000001 or 1.3999999999999999 < x Initial program 79.8%
Taylor expanded in x around 0 35.7%
Taylor expanded in x around inf 35.7%
associate-/l*29.0%
associate-/r/37.2%
Simplified37.2%
if -1.6000000000000001 < x < 1.3999999999999999Initial program 94.1%
associate-*l/94.0%
Simplified94.0%
Taylor expanded in x around 0 91.7%
associate-*r/91.8%
associate-*l/91.9%
*-un-lft-identity91.9%
Applied egg-rr91.9%
Final simplification62.2%
(FPCore (x y z) :precision binary64 (if (<= x -1.6) (/ (* 0.5 (* x y)) z) (if (<= x 1.4) (/ (/ y z) x) (* 0.5 (* y (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.6) {
tmp = (0.5 * (x * y)) / z;
} else if (x <= 1.4) {
tmp = (y / z) / x;
} else {
tmp = 0.5 * (y * (x / z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.6d0)) then
tmp = (0.5d0 * (x * y)) / z
else if (x <= 1.4d0) then
tmp = (y / z) / x
else
tmp = 0.5d0 * (y * (x / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.6) {
tmp = (0.5 * (x * y)) / z;
} else if (x <= 1.4) {
tmp = (y / z) / x;
} else {
tmp = 0.5 * (y * (x / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.6: tmp = (0.5 * (x * y)) / z elif x <= 1.4: tmp = (y / z) / x else: tmp = 0.5 * (y * (x / z)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.6) tmp = Float64(Float64(0.5 * Float64(x * y)) / z); elseif (x <= 1.4) tmp = Float64(Float64(y / z) / x); else tmp = Float64(0.5 * Float64(y * Float64(x / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.6) tmp = (0.5 * (x * y)) / z; elseif (x <= 1.4) tmp = (y / z) / x; else tmp = 0.5 * (y * (x / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.6], N[(N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 1.4], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision], N[(0.5 * N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6:\\
\;\;\;\;\frac{0.5 \cdot \left(x \cdot y\right)}{z}\\
\mathbf{elif}\;x \leq 1.4:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{z}\right)\\
\end{array}
\end{array}
if x < -1.6000000000000001Initial program 82.2%
Taylor expanded in x around 0 40.5%
Taylor expanded in x around inf 40.5%
*-commutative40.5%
associate-*r/40.5%
Simplified40.5%
if -1.6000000000000001 < x < 1.3999999999999999Initial program 94.1%
associate-*l/94.0%
Simplified94.0%
Taylor expanded in x around 0 91.7%
associate-*r/91.8%
associate-*l/91.9%
*-un-lft-identity91.9%
Applied egg-rr91.9%
if 1.3999999999999999 < x Initial program 77.2%
Taylor expanded in x around 0 30.5%
Taylor expanded in x around inf 30.5%
associate-/l*24.8%
associate-/r/34.8%
Simplified34.8%
Final simplification62.5%
(FPCore (x y z) :precision binary64 (/ (* y (+ (* x 0.5) (/ 1.0 x))) z))
double code(double x, double y, double z) {
return (y * ((x * 0.5) + (1.0 / x))) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (y * ((x * 0.5d0) + (1.0d0 / x))) / z
end function
public static double code(double x, double y, double z) {
return (y * ((x * 0.5) + (1.0 / x))) / z;
}
def code(x, y, z): return (y * ((x * 0.5) + (1.0 / x))) / z
function code(x, y, z) return Float64(Float64(y * Float64(Float64(x * 0.5) + Float64(1.0 / x))) / z) end
function tmp = code(x, y, z) tmp = (y * ((x * 0.5) + (1.0 / x))) / z; end
code[x_, y_, z_] := N[(N[(y * N[(N[(x * 0.5), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{y \cdot \left(x \cdot 0.5 + \frac{1}{x}\right)}{z}
\end{array}
Initial program 86.4%
Taylor expanded in x around 0 61.9%
Taylor expanded in y around 0 61.8%
Final simplification61.8%
(FPCore (x y z) :precision binary64 (/ (+ (/ y x) (* 0.5 (* x y))) z))
double code(double x, double y, double z) {
return ((y / x) + (0.5 * (x * y))) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((y / x) + (0.5d0 * (x * y))) / z
end function
public static double code(double x, double y, double z) {
return ((y / x) + (0.5 * (x * y))) / z;
}
def code(x, y, z): return ((y / x) + (0.5 * (x * y))) / z
function code(x, y, z) return Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z) end
function tmp = code(x, y, z) tmp = ((y / x) + (0.5 * (x * y))) / z; end
code[x_, y_, z_] := N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}
\end{array}
Initial program 86.4%
Taylor expanded in x around 0 61.9%
Final simplification61.9%
(FPCore (x y z) :precision binary64 (if (<= z -1e-167) (/ y (* x z)) (/ (/ y x) z)))
double code(double x, double y, double z) {
double tmp;
if (z <= -1e-167) {
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 (z <= (-1d-167)) 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 (z <= -1e-167) {
tmp = y / (x * z);
} else {
tmp = (y / x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1e-167: tmp = y / (x * z) else: tmp = (y / x) / z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1e-167) 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 (z <= -1e-167) tmp = y / (x * z); else tmp = (y / x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1e-167], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-167}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\
\end{array}
\end{array}
if z < -1e-167Initial program 88.8%
associate-*r/77.5%
associate-/r*76.4%
Simplified76.4%
Taylor expanded in x around 0 46.6%
if -1e-167 < z Initial program 84.6%
associate-*r/81.9%
associate-/r*80.4%
Simplified80.4%
Taylor expanded in x around 0 44.7%
associate-/r*49.5%
Simplified49.5%
Final simplification48.3%
(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 86.4%
associate-*r/80.1%
associate-/r*78.7%
Simplified78.7%
Taylor expanded in x around 0 45.5%
Final simplification45.5%
(FPCore (x y z) :precision binary64 (/ (/ y z) x))
double code(double x, double y, double z) {
return (y / z) / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (y / z) / x
end function
public static double code(double x, double y, double z) {
return (y / z) / x;
}
def code(x, y, z): return (y / z) / x
function code(x, y, z) return Float64(Float64(y / z) / x) end
function tmp = code(x, y, z) tmp = (y / z) / x; end
code[x_, y_, z_] := N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{z}}{x}
\end{array}
Initial program 86.4%
associate-*l/86.3%
Simplified86.3%
Taylor expanded in x around 0 46.4%
associate-*r/48.7%
associate-*l/48.7%
*-un-lft-identity48.7%
Applied egg-rr48.7%
Final simplification48.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ (/ y z) x) (cosh x))))
(if (< y -4.618902267687042e-52)
t_0
(if (< y 1.038530535935153e-39) (/ (/ (* (cosh x) y) x) z) t_0))))
double code(double x, double y, double z) {
double t_0 = ((y / z) / x) * cosh(x);
double tmp;
if (y < -4.618902267687042e-52) {
tmp = t_0;
} else if (y < 1.038530535935153e-39) {
tmp = ((cosh(x) * y) / x) / z;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((y / z) / x) * cosh(x)
if (y < (-4.618902267687042d-52)) then
tmp = t_0
else if (y < 1.038530535935153d-39) then
tmp = ((cosh(x) * y) / x) / z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((y / z) / x) * Math.cosh(x);
double tmp;
if (y < -4.618902267687042e-52) {
tmp = t_0;
} else if (y < 1.038530535935153e-39) {
tmp = ((Math.cosh(x) * y) / x) / z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((y / z) / x) * math.cosh(x) tmp = 0 if y < -4.618902267687042e-52: tmp = t_0 elif y < 1.038530535935153e-39: tmp = ((math.cosh(x) * y) / x) / z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(y / z) / x) * cosh(x)) tmp = 0.0 if (y < -4.618902267687042e-52) tmp = t_0; elseif (y < 1.038530535935153e-39) tmp = Float64(Float64(Float64(cosh(x) * y) / x) / z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((y / z) / x) * cosh(x); tmp = 0.0; if (y < -4.618902267687042e-52) tmp = t_0; elseif (y < 1.038530535935153e-39) tmp = ((cosh(x) * y) / x) / z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision] * N[Cosh[x], $MachinePrecision]), $MachinePrecision]}, If[Less[y, -4.618902267687042e-52], t$95$0, If[Less[y, 1.038530535935153e-39], N[(N[(N[(N[Cosh[x], $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision] / z), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{z}}{x} \cdot \cosh x\\
\mathbf{if}\;y < -4.618902267687042 \cdot 10^{-52}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y < 1.038530535935153 \cdot 10^{-39}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
herbie shell --seed 2023293
(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))