
(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (cosh(x) * (y / x)) / z
end function
public static double code(double x, double y, double z) {
return (Math.cosh(x) * (y / x)) / z;
}
def code(x, y, z): return (math.cosh(x) * (y / x)) / z
function code(x, y, z) return Float64(Float64(cosh(x) * Float64(y / x)) / z) end
function tmp = code(x, y, z) tmp = (cosh(x) * (y / x)) / z; end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cosh x \cdot \frac{y}{x}}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (cosh(x) * (y / x)) / z
end function
public static double code(double x, double y, double z) {
return (Math.cosh(x) * (y / x)) / z;
}
def code(x, y, z): return (math.cosh(x) * (y / x)) / z
function code(x, y, z) return Float64(Float64(cosh(x) * Float64(y / x)) / z) end
function tmp = code(x, y, z) tmp = (cosh(x) * (y / x)) / z; end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cosh x \cdot \frac{y}{x}}{z}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= (/ (* (cosh x) (/ y x)) z) 2e-5) (* (/ y x) (/ (cosh x) z)) (/ (/ (* (cosh x) y) z) x)))
double code(double x, double y, double z) {
double tmp;
if (((cosh(x) * (y / x)) / z) <= 2e-5) {
tmp = (y / x) * (cosh(x) / z);
} else {
tmp = ((cosh(x) * 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 (((cosh(x) * (y / x)) / z) <= 2d-5) then
tmp = (y / x) * (cosh(x) / z)
else
tmp = ((cosh(x) * y) / z) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (((Math.cosh(x) * (y / x)) / z) <= 2e-5) {
tmp = (y / x) * (Math.cosh(x) / z);
} else {
tmp = ((Math.cosh(x) * y) / z) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if ((math.cosh(x) * (y / x)) / z) <= 2e-5: tmp = (y / x) * (math.cosh(x) / z) else: tmp = ((math.cosh(x) * y) / z) / x return tmp
function code(x, y, z) tmp = 0.0 if (Float64(Float64(cosh(x) * Float64(y / x)) / z) <= 2e-5) tmp = Float64(Float64(y / x) * Float64(cosh(x) / z)); else tmp = Float64(Float64(Float64(cosh(x) * y) / z) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (((cosh(x) * (y / x)) / z) <= 2e-5) tmp = (y / x) * (cosh(x) / z); else tmp = ((cosh(x) * y) / z) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], 2e-5], N[(N[(y / x), $MachinePrecision] * N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Cosh[x], $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y}{x}}{z} \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{\cosh x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 2.00000000000000016e-5Initial program 98.9%
associate-*l/99.0%
Simplified99.0%
if 2.00000000000000016e-5 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 70.0%
associate-*r/61.4%
associate-/r*71.0%
Simplified71.0%
associate-*r/78.2%
*-commutative78.2%
frac-times70.0%
associate-*l/99.9%
Applied egg-rr99.9%
associate-*r/100.0%
Applied egg-rr100.0%
Final simplification99.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (cosh x) z)))
(if (<= (/ (* (cosh x) (/ y x)) z) 4e+113)
(* (/ y x) t_0)
(/ (* y t_0) x))))
double code(double x, double y, double z) {
double t_0 = cosh(x) / z;
double tmp;
if (((cosh(x) * (y / x)) / z) <= 4e+113) {
tmp = (y / x) * t_0;
} else {
tmp = (y * t_0) / x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = cosh(x) / z
if (((cosh(x) * (y / x)) / z) <= 4d+113) then
tmp = (y / x) * t_0
else
tmp = (y * t_0) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.cosh(x) / z;
double tmp;
if (((Math.cosh(x) * (y / x)) / z) <= 4e+113) {
tmp = (y / x) * t_0;
} else {
tmp = (y * t_0) / x;
}
return tmp;
}
def code(x, y, z): t_0 = math.cosh(x) / z tmp = 0 if ((math.cosh(x) * (y / x)) / z) <= 4e+113: tmp = (y / x) * t_0 else: tmp = (y * t_0) / x return tmp
function code(x, y, z) t_0 = Float64(cosh(x) / z) tmp = 0.0 if (Float64(Float64(cosh(x) * Float64(y / x)) / z) <= 4e+113) tmp = Float64(Float64(y / x) * t_0); else tmp = Float64(Float64(y * t_0) / x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = cosh(x) / z; tmp = 0.0; if (((cosh(x) * (y / x)) / z) <= 4e+113) tmp = (y / x) * t_0; else tmp = (y * t_0) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], 4e+113], N[(N[(y / x), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(y * t$95$0), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\cosh x}{z}\\
\mathbf{if}\;\frac{\cosh x \cdot \frac{y}{x}}{z} \leq 4 \cdot 10^{+113}:\\
\;\;\;\;\frac{y}{x} \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot t_0}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 4e113Initial program 99.0%
associate-*l/99.0%
Simplified99.0%
if 4e113 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 67.5%
associate-*r/58.1%
associate-/r*68.5%
Simplified68.5%
associate-*r/76.3%
*-commutative76.3%
frac-times67.5%
associate-*l/99.9%
Applied egg-rr99.9%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.3e+154) (not (<= x 1.95e+121))) (/ (* y (/ 0.5 (/ z (* x x)))) x) (* y (/ (cosh x) (* x z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.3e+154) || !(x <= 1.95e+121)) {
tmp = (y * (0.5 / (z / (x * x)))) / x;
} 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 ((x <= (-1.3d+154)) .or. (.not. (x <= 1.95d+121))) then
tmp = (y * (0.5d0 / (z / (x * x)))) / x
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 ((x <= -1.3e+154) || !(x <= 1.95e+121)) {
tmp = (y * (0.5 / (z / (x * x)))) / x;
} else {
tmp = y * (Math.cosh(x) / (x * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.3e+154) or not (x <= 1.95e+121): tmp = (y * (0.5 / (z / (x * x)))) / x else: tmp = y * (math.cosh(x) / (x * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.3e+154) || !(x <= 1.95e+121)) tmp = Float64(Float64(y * Float64(0.5 / Float64(z / Float64(x * x)))) / x); 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 ((x <= -1.3e+154) || ~((x <= 1.95e+121))) tmp = (y * (0.5 / (z / (x * x)))) / x; else tmp = y * (cosh(x) / (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.3e+154], N[Not[LessEqual[x, 1.95e+121]], $MachinePrecision]], N[(N[(y * N[(0.5 / N[(z / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(y * N[(N[Cosh[x], $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{+154} \lor \neg \left(x \leq 1.95 \cdot 10^{+121}\right):\\
\;\;\;\;\frac{y \cdot \frac{0.5}{\frac{z}{x \cdot x}}}{x}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\cosh x}{x \cdot z}\\
\end{array}
\end{array}
if x < -1.29999999999999994e154 or 1.94999999999999992e121 < x Initial program 56.6%
associate-*r/43.4%
associate-/r*52.6%
Simplified52.6%
associate-*r/59.2%
*-commutative59.2%
frac-times56.6%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 97.4%
unpow250.2%
Simplified97.4%
Taylor expanded in x around inf 97.4%
unpow297.4%
associate-*r/97.4%
associate-/l*97.4%
Simplified97.4%
if -1.29999999999999994e154 < x < 1.94999999999999992e121Initial program 94.5%
associate-*r/90.1%
associate-/r*91.4%
Simplified91.4%
associate-/r*90.1%
associate-*r/94.5%
associate-/l*88.6%
add-log-exp53.4%
*-un-lft-identity53.4%
log-prod53.4%
metadata-eval53.4%
add-log-exp88.6%
associate-/l*94.5%
associate-*r/90.1%
Applied egg-rr90.1%
+-lft-identity90.1%
*-commutative90.1%
associate-/r*91.4%
associate-*l/95.8%
associate-*r/95.0%
Simplified95.0%
Final simplification95.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -3.3e+182) (not (<= x 5.5e+144))) (/ (* y (/ 0.5 (/ z (* x x)))) x) (* (/ y x) (/ (cosh x) z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -3.3e+182) || !(x <= 5.5e+144)) {
tmp = (y * (0.5 / (z / (x * x)))) / x;
} else {
tmp = (y / x) * (cosh(x) / z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-3.3d+182)) .or. (.not. (x <= 5.5d+144))) then
tmp = (y * (0.5d0 / (z / (x * x)))) / x
else
tmp = (y / x) * (cosh(x) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -3.3e+182) || !(x <= 5.5e+144)) {
tmp = (y * (0.5 / (z / (x * x)))) / x;
} else {
tmp = (y / x) * (Math.cosh(x) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -3.3e+182) or not (x <= 5.5e+144): tmp = (y * (0.5 / (z / (x * x)))) / x else: tmp = (y / x) * (math.cosh(x) / z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -3.3e+182) || !(x <= 5.5e+144)) tmp = Float64(Float64(y * Float64(0.5 / Float64(z / Float64(x * x)))) / x); else tmp = Float64(Float64(y / x) * Float64(cosh(x) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -3.3e+182) || ~((x <= 5.5e+144))) tmp = (y * (0.5 / (z / (x * x)))) / x; else tmp = (y / x) * (cosh(x) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -3.3e+182], N[Not[LessEqual[x, 5.5e+144]], $MachinePrecision]], N[(N[(y * N[(0.5 / N[(z / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(y / x), $MachinePrecision] * N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.3 \cdot 10^{+182} \lor \neg \left(x \leq 5.5 \cdot 10^{+144}\right):\\
\;\;\;\;\frac{y \cdot \frac{0.5}{\frac{z}{x \cdot x}}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{\cosh x}{z}\\
\end{array}
\end{array}
if x < -3.3000000000000001e182 or 5.50000000000000022e144 < x Initial program 50.7%
associate-*r/40.3%
associate-/r*53.7%
Simplified53.7%
associate-*r/59.7%
*-commutative59.7%
frac-times50.7%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 100.0%
unpow252.3%
Simplified100.0%
Taylor expanded in x around inf 100.0%
unpow2100.0%
associate-*r/100.0%
associate-/l*100.0%
Simplified100.0%
if -3.3000000000000001e182 < x < 5.50000000000000022e144Initial program 94.8%
associate-*l/94.8%
Simplified94.8%
Final simplification96.1%
(FPCore (x y z)
:precision binary64
(if (<= x -5e+32)
(/ (/ (* y (* x (* x 0.5))) x) z)
(if (<= x 1.45e+47)
(* (+ 1.0 (* 0.5 (* x x))) (/ y (* x z)))
(/ (* y (/ 0.5 (/ z (* x x)))) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -5e+32) {
tmp = ((y * (x * (x * 0.5))) / x) / z;
} else if (x <= 1.45e+47) {
tmp = (1.0 + (0.5 * (x * x))) * (y / (x * z));
} else {
tmp = (y * (0.5 / (z / (x * x)))) / 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 <= (-5d+32)) then
tmp = ((y * (x * (x * 0.5d0))) / x) / z
else if (x <= 1.45d+47) then
tmp = (1.0d0 + (0.5d0 * (x * x))) * (y / (x * z))
else
tmp = (y * (0.5d0 / (z / (x * x)))) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -5e+32) {
tmp = ((y * (x * (x * 0.5))) / x) / z;
} else if (x <= 1.45e+47) {
tmp = (1.0 + (0.5 * (x * x))) * (y / (x * z));
} else {
tmp = (y * (0.5 / (z / (x * x)))) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -5e+32: tmp = ((y * (x * (x * 0.5))) / x) / z elif x <= 1.45e+47: tmp = (1.0 + (0.5 * (x * x))) * (y / (x * z)) else: tmp = (y * (0.5 / (z / (x * x)))) / x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -5e+32) tmp = Float64(Float64(Float64(y * Float64(x * Float64(x * 0.5))) / x) / z); elseif (x <= 1.45e+47) tmp = Float64(Float64(1.0 + Float64(0.5 * Float64(x * x))) * Float64(y / Float64(x * z))); else tmp = Float64(Float64(y * Float64(0.5 / Float64(z / Float64(x * x)))) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -5e+32) tmp = ((y * (x * (x * 0.5))) / x) / z; elseif (x <= 1.45e+47) tmp = (1.0 + (0.5 * (x * x))) * (y / (x * z)); else tmp = (y * (0.5 / (z / (x * x)))) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -5e+32], N[(N[(N[(y * N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 1.45e+47], N[(N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(0.5 / N[(z / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+32}:\\
\;\;\;\;\frac{\frac{y \cdot \left(x \cdot \left(x \cdot 0.5\right)\right)}{x}}{z}\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+47}:\\
\;\;\;\;\left(1 + 0.5 \cdot \left(x \cdot x\right)\right) \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{0.5}{\frac{z}{x \cdot x}}}{x}\\
\end{array}
\end{array}
if x < -4.9999999999999997e32Initial program 77.2%
associate-*r/57.9%
associate-/r*54.4%
Simplified54.4%
Taylor expanded in x around 0 41.2%
unpow241.2%
Simplified41.2%
Taylor expanded in x around inf 41.2%
unpow241.2%
Simplified41.2%
associate-*r/44.6%
associate-/r*77.9%
*-commutative77.9%
*-commutative77.9%
associate-*l*77.9%
Applied egg-rr77.9%
if -4.9999999999999997e32 < x < 1.4499999999999999e47Initial program 95.1%
associate-*r/93.7%
associate-/r*96.1%
Simplified96.1%
Taylor expanded in x around 0 87.5%
unpow287.5%
Simplified87.5%
if 1.4499999999999999e47 < x Initial program 60.3%
associate-*r/51.7%
associate-/r*65.5%
Simplified65.5%
associate-*r/75.9%
*-commutative75.9%
frac-times60.3%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 79.9%
unpow249.1%
Simplified79.9%
Taylor expanded in x around inf 79.9%
unpow279.9%
associate-*r/79.9%
associate-/l*79.9%
Simplified79.9%
Final simplification83.6%
(FPCore (x y z)
:precision binary64
(if (<= x -2e+32)
(/ (/ (* y (* x (* x 0.5))) x) z)
(if (<= x 9.6e+109)
(+ (* 0.5 (/ (* x y) z)) (/ y (* x z)))
(/ (* y (/ 0.5 (/ z (* x x)))) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2e+32) {
tmp = ((y * (x * (x * 0.5))) / x) / z;
} else if (x <= 9.6e+109) {
tmp = (0.5 * ((x * y) / z)) + (y / (x * z));
} else {
tmp = (y * (0.5 / (z / (x * x)))) / 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 <= (-2d+32)) then
tmp = ((y * (x * (x * 0.5d0))) / x) / z
else if (x <= 9.6d+109) then
tmp = (0.5d0 * ((x * y) / z)) + (y / (x * z))
else
tmp = (y * (0.5d0 / (z / (x * x)))) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2e+32) {
tmp = ((y * (x * (x * 0.5))) / x) / z;
} else if (x <= 9.6e+109) {
tmp = (0.5 * ((x * y) / z)) + (y / (x * z));
} else {
tmp = (y * (0.5 / (z / (x * x)))) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2e+32: tmp = ((y * (x * (x * 0.5))) / x) / z elif x <= 9.6e+109: tmp = (0.5 * ((x * y) / z)) + (y / (x * z)) else: tmp = (y * (0.5 / (z / (x * x)))) / x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2e+32) tmp = Float64(Float64(Float64(y * Float64(x * Float64(x * 0.5))) / x) / z); elseif (x <= 9.6e+109) tmp = Float64(Float64(0.5 * Float64(Float64(x * y) / z)) + Float64(y / Float64(x * z))); else tmp = Float64(Float64(y * Float64(0.5 / Float64(z / Float64(x * x)))) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2e+32) tmp = ((y * (x * (x * 0.5))) / x) / z; elseif (x <= 9.6e+109) tmp = (0.5 * ((x * y) / z)) + (y / (x * z)); else tmp = (y * (0.5 / (z / (x * x)))) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2e+32], N[(N[(N[(y * N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 9.6e+109], N[(N[(0.5 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(0.5 / N[(z / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{+32}:\\
\;\;\;\;\frac{\frac{y \cdot \left(x \cdot \left(x \cdot 0.5\right)\right)}{x}}{z}\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{+109}:\\
\;\;\;\;0.5 \cdot \frac{x \cdot y}{z} + \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{0.5}{\frac{z}{x \cdot x}}}{x}\\
\end{array}
\end{array}
if x < -2.00000000000000011e32Initial program 77.2%
associate-*r/57.9%
associate-/r*54.4%
Simplified54.4%
Taylor expanded in x around 0 41.2%
unpow241.2%
Simplified41.2%
Taylor expanded in x around inf 41.2%
unpow241.2%
Simplified41.2%
associate-*r/44.6%
associate-/r*77.9%
*-commutative77.9%
*-commutative77.9%
associate-*l*77.9%
Applied egg-rr77.9%
if -2.00000000000000011e32 < x < 9.59999999999999949e109Initial program 94.8%
associate-*r/92.9%
associate-/r*95.1%
Simplified95.1%
Taylor expanded in x around 0 83.4%
if 9.59999999999999949e109 < x Initial program 52.2%
associate-*r/43.5%
associate-/r*60.9%
Simplified60.9%
associate-*r/71.7%
*-commutative71.7%
frac-times52.2%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 93.6%
unpow254.8%
Simplified93.6%
Taylor expanded in x around inf 93.6%
unpow293.6%
associate-*r/93.6%
associate-/l*93.6%
Simplified93.6%
Final simplification84.0%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.45) (not (<= x 1.4))) (/ (* 0.5 (/ (* x (* x y)) z)) x) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.45) || !(x <= 1.4)) {
tmp = (0.5 * ((x * (x * 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 ((x <= (-1.45d0)) .or. (.not. (x <= 1.4d0))) then
tmp = (0.5d0 * ((x * (x * 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 ((x <= -1.45) || !(x <= 1.4)) {
tmp = (0.5 * ((x * (x * y)) / z)) / x;
} else {
tmp = y / (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.45) or not (x <= 1.4): tmp = (0.5 * ((x * (x * y)) / z)) / x else: tmp = y / (x * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.45) || !(x <= 1.4)) tmp = Float64(Float64(0.5 * Float64(Float64(x * Float64(x * y)) / z)) / x); else tmp = Float64(y / Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.45) || ~((x <= 1.4))) tmp = (0.5 * ((x * (x * y)) / z)) / x; else tmp = y / (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.45], N[Not[LessEqual[x, 1.4]], $MachinePrecision]], N[(N[(0.5 * N[(N[(x * N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \lor \neg \left(x \leq 1.4\right):\\
\;\;\;\;\frac{0.5 \cdot \frac{x \cdot \left(x \cdot y\right)}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if x < -1.44999999999999996 or 1.3999999999999999 < x Initial program 72.1%
associate-*r/58.1%
associate-/r*62.8%
Simplified62.8%
associate-*r/72.9%
*-commutative72.9%
frac-times72.1%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 70.1%
unpow240.8%
Simplified70.1%
Taylor expanded in x around inf 70.9%
unpow270.9%
associate-*l*63.3%
*-commutative63.3%
Simplified63.3%
if -1.44999999999999996 < x < 1.3999999999999999Initial program 94.6%
associate-*r/94.6%
associate-/r*97.2%
Simplified97.2%
Taylor expanded in x around 0 96.6%
Final simplification79.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.45) (not (<= x 1.4))) (/ (* y (/ 0.5 (/ z (* x x)))) x) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.45) || !(x <= 1.4)) {
tmp = (y * (0.5 / (z / (x * x)))) / 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 ((x <= (-1.45d0)) .or. (.not. (x <= 1.4d0))) then
tmp = (y * (0.5d0 / (z / (x * x)))) / 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 ((x <= -1.45) || !(x <= 1.4)) {
tmp = (y * (0.5 / (z / (x * x)))) / x;
} else {
tmp = y / (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.45) or not (x <= 1.4): tmp = (y * (0.5 / (z / (x * x)))) / x else: tmp = y / (x * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.45) || !(x <= 1.4)) tmp = Float64(Float64(y * Float64(0.5 / Float64(z / Float64(x * x)))) / x); else tmp = Float64(y / Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.45) || ~((x <= 1.4))) tmp = (y * (0.5 / (z / (x * x)))) / x; else tmp = y / (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.45], N[Not[LessEqual[x, 1.4]], $MachinePrecision]], N[(N[(y * N[(0.5 / N[(z / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \lor \neg \left(x \leq 1.4\right):\\
\;\;\;\;\frac{y \cdot \frac{0.5}{\frac{z}{x \cdot x}}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if x < -1.44999999999999996 or 1.3999999999999999 < x Initial program 72.1%
associate-*r/58.1%
associate-/r*62.8%
Simplified62.8%
associate-*r/72.9%
*-commutative72.9%
frac-times72.1%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 70.1%
unpow240.8%
Simplified70.1%
Taylor expanded in x around inf 70.1%
unpow270.1%
associate-*r/70.1%
associate-/l*70.1%
Simplified70.1%
if -1.44999999999999996 < x < 1.3999999999999999Initial program 94.6%
associate-*r/94.6%
associate-/r*97.2%
Simplified97.2%
Taylor expanded in x around 0 96.6%
Final simplification83.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ y (* x z))))
(if (<= x -1.45)
(* 0.5 (/ (* x y) z))
(if (<= x 1.4) t_0 (* (* 0.5 (* x x)) t_0)))))
double code(double x, double y, double z) {
double t_0 = y / (x * z);
double tmp;
if (x <= -1.45) {
tmp = 0.5 * ((x * y) / z);
} else if (x <= 1.4) {
tmp = t_0;
} else {
tmp = (0.5 * (x * 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 = y / (x * z)
if (x <= (-1.45d0)) then
tmp = 0.5d0 * ((x * y) / z)
else if (x <= 1.4d0) then
tmp = t_0
else
tmp = (0.5d0 * (x * x)) * t_0
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 (x <= -1.45) {
tmp = 0.5 * ((x * y) / z);
} else if (x <= 1.4) {
tmp = t_0;
} else {
tmp = (0.5 * (x * x)) * t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y / (x * z) tmp = 0 if x <= -1.45: tmp = 0.5 * ((x * y) / z) elif x <= 1.4: tmp = t_0 else: tmp = (0.5 * (x * x)) * t_0 return tmp
function code(x, y, z) t_0 = Float64(y / Float64(x * z)) tmp = 0.0 if (x <= -1.45) tmp = Float64(0.5 * Float64(Float64(x * y) / z)); elseif (x <= 1.4) tmp = t_0; else tmp = Float64(Float64(0.5 * Float64(x * x)) * t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y / (x * z); tmp = 0.0; if (x <= -1.45) tmp = 0.5 * ((x * y) / z); elseif (x <= 1.4) tmp = t_0; else tmp = (0.5 * (x * x)) * t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45], N[(0.5 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.4], t$95$0, N[(N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot z}\\
\mathbf{if}\;x \leq -1.45:\\
\;\;\;\;0.5 \cdot \frac{x \cdot y}{z}\\
\mathbf{elif}\;x \leq 1.4:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \left(x \cdot x\right)\right) \cdot t_0\\
\end{array}
\end{array}
if x < -1.44999999999999996Initial program 79.7%
associate-*r/60.9%
associate-/r*57.8%
Simplified57.8%
Taylor expanded in x around 0 37.1%
unpow237.1%
Simplified37.1%
Taylor expanded in x around inf 45.9%
if -1.44999999999999996 < x < 1.3999999999999999Initial program 94.6%
associate-*r/94.6%
associate-/r*97.2%
Simplified97.2%
Taylor expanded in x around 0 96.6%
if 1.3999999999999999 < x Initial program 64.6%
associate-*r/55.4%
associate-/r*67.7%
Simplified67.7%
Taylor expanded in x around 0 44.4%
unpow244.4%
Simplified44.4%
Taylor expanded in x around inf 44.4%
unpow244.4%
Simplified44.4%
Final simplification70.6%
(FPCore (x y z) :precision binary64 (if (<= x -1.45) (/ (/ (* y (* x (* x 0.5))) x) z) (if (<= x 1.4) (/ y (* x z)) (/ (* y (/ 0.5 (/ z (* x x)))) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.45) {
tmp = ((y * (x * (x * 0.5))) / x) / z;
} else if (x <= 1.4) {
tmp = y / (x * z);
} else {
tmp = (y * (0.5 / (z / (x * x)))) / 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.45d0)) then
tmp = ((y * (x * (x * 0.5d0))) / x) / z
else if (x <= 1.4d0) then
tmp = y / (x * z)
else
tmp = (y * (0.5d0 / (z / (x * x)))) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.45) {
tmp = ((y * (x * (x * 0.5))) / x) / z;
} else if (x <= 1.4) {
tmp = y / (x * z);
} else {
tmp = (y * (0.5 / (z / (x * x)))) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.45: tmp = ((y * (x * (x * 0.5))) / x) / z elif x <= 1.4: tmp = y / (x * z) else: tmp = (y * (0.5 / (z / (x * x)))) / x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.45) tmp = Float64(Float64(Float64(y * Float64(x * Float64(x * 0.5))) / x) / z); elseif (x <= 1.4) tmp = Float64(y / Float64(x * z)); else tmp = Float64(Float64(y * Float64(0.5 / Float64(z / Float64(x * x)))) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.45) tmp = ((y * (x * (x * 0.5))) / x) / z; elseif (x <= 1.4) tmp = y / (x * z); else tmp = (y * (0.5 / (z / (x * x)))) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.45], N[(N[(N[(y * N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 1.4], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(0.5 / N[(z / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45:\\
\;\;\;\;\frac{\frac{y \cdot \left(x \cdot \left(x \cdot 0.5\right)\right)}{x}}{z}\\
\mathbf{elif}\;x \leq 1.4:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{0.5}{\frac{z}{x \cdot x}}}{x}\\
\end{array}
\end{array}
if x < -1.44999999999999996Initial program 79.7%
associate-*r/60.9%
associate-/r*57.8%
Simplified57.8%
Taylor expanded in x around 0 37.1%
unpow237.1%
Simplified37.1%
Taylor expanded in x around inf 37.1%
unpow237.1%
Simplified37.1%
associate-*r/40.1%
associate-/r*69.8%
*-commutative69.8%
*-commutative69.8%
associate-*l*69.8%
Applied egg-rr69.8%
if -1.44999999999999996 < x < 1.3999999999999999Initial program 94.6%
associate-*r/94.6%
associate-/r*97.2%
Simplified97.2%
Taylor expanded in x around 0 96.6%
if 1.3999999999999999 < x Initial program 64.6%
associate-*r/55.4%
associate-/r*67.7%
Simplified67.7%
associate-*r/78.5%
*-commutative78.5%
frac-times64.6%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 71.9%
unpow244.4%
Simplified71.9%
Taylor expanded in x around inf 71.9%
unpow271.9%
associate-*r/71.9%
associate-/l*71.9%
Simplified71.9%
Final simplification83.6%
(FPCore (x y z) :precision binary64 (/ (* y (/ (+ 1.0 (* 0.5 (* x x))) z)) x))
double code(double x, double y, double z) {
return (y * ((1.0 + (0.5 * (x * 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 * ((1.0d0 + (0.5d0 * (x * x))) / z)) / x
end function
public static double code(double x, double y, double z) {
return (y * ((1.0 + (0.5 * (x * x))) / z)) / x;
}
def code(x, y, z): return (y * ((1.0 + (0.5 * (x * x))) / z)) / x
function code(x, y, z) return Float64(Float64(y * Float64(Float64(1.0 + Float64(0.5 * Float64(x * x))) / z)) / x) end
function tmp = code(x, y, z) tmp = (y * ((1.0 + (0.5 * (x * x))) / z)) / x; end
code[x_, y_, z_] := N[(N[(y * N[(N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{y \cdot \frac{1 + 0.5 \cdot \left(x \cdot x\right)}{z}}{x}
\end{array}
Initial program 83.2%
associate-*r/76.2%
associate-/r*79.9%
Simplified79.9%
associate-*r/84.9%
*-commutative84.9%
frac-times83.3%
associate-*l/97.2%
Applied egg-rr97.2%
Taylor expanded in x around 0 81.8%
unpow268.5%
Simplified81.8%
Final simplification81.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.45) (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.45) || !(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.45d0)) .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.45) || !(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.45) 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.45) || !(x <= 1.4)) tmp = Float64(0.5 * Float64(x * Float64(y / z))); else tmp = Float64(y / Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.45) || ~((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.45], N[Not[LessEqual[x, 1.4]], $MachinePrecision]], N[(0.5 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \lor \neg \left(x \leq 1.4\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if x < -1.44999999999999996 or 1.3999999999999999 < x Initial program 72.1%
associate-*r/58.1%
associate-/r*62.8%
Simplified62.8%
Taylor expanded in x around 0 40.8%
unpow240.8%
Simplified40.8%
Taylor expanded in x around inf 43.3%
div-inv43.3%
associate-*l*34.5%
*-commutative34.5%
associate-*l/34.5%
*-un-lft-identity34.5%
Applied egg-rr34.5%
if -1.44999999999999996 < x < 1.3999999999999999Initial program 94.6%
associate-*r/94.6%
associate-/r*97.2%
Simplified97.2%
Taylor expanded in x around 0 96.6%
Final simplification65.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.45) (not (<= x 1.4))) (* 0.5 (* y (/ x z))) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.45) || !(x <= 1.4)) {
tmp = 0.5 * (y * (x / z));
} else {
tmp = y / (x * z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.45d0)) .or. (.not. (x <= 1.4d0))) then
tmp = 0.5d0 * (y * (x / z))
else
tmp = y / (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.45) || !(x <= 1.4)) {
tmp = 0.5 * (y * (x / z));
} else {
tmp = y / (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.45) or not (x <= 1.4): tmp = 0.5 * (y * (x / z)) else: tmp = y / (x * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.45) || !(x <= 1.4)) tmp = Float64(0.5 * Float64(y * Float64(x / z))); else tmp = Float64(y / Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.45) || ~((x <= 1.4))) tmp = 0.5 * (y * (x / z)); else tmp = y / (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.45], N[Not[LessEqual[x, 1.4]], $MachinePrecision]], N[(0.5 * N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \lor \neg \left(x \leq 1.4\right):\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if x < -1.44999999999999996 or 1.3999999999999999 < x Initial program 72.1%
associate-*r/58.1%
associate-/r*62.8%
Simplified62.8%
Taylor expanded in x around 0 40.8%
unpow240.8%
Simplified40.8%
Taylor expanded in x around inf 43.3%
associate-*l/41.1%
*-commutative41.1%
Simplified41.1%
if -1.44999999999999996 < x < 1.3999999999999999Initial program 94.6%
associate-*r/94.6%
associate-/r*97.2%
Simplified97.2%
Taylor expanded in x around 0 96.6%
Final simplification68.6%
(FPCore (x y z) :precision binary64 (if (<= x -1.45) (* 0.5 (/ (* x y) z)) (if (<= x 1.4) (/ y (* x z)) (* 0.5 (* y (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.45) {
tmp = 0.5 * ((x * y) / z);
} else if (x <= 1.4) {
tmp = y / (x * z);
} else {
tmp = 0.5 * (y * (x / z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.45d0)) then
tmp = 0.5d0 * ((x * y) / z)
else if (x <= 1.4d0) then
tmp = y / (x * z)
else
tmp = 0.5d0 * (y * (x / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.45) {
tmp = 0.5 * ((x * y) / z);
} else if (x <= 1.4) {
tmp = y / (x * z);
} else {
tmp = 0.5 * (y * (x / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.45: tmp = 0.5 * ((x * y) / z) elif x <= 1.4: tmp = y / (x * z) else: tmp = 0.5 * (y * (x / z)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.45) tmp = Float64(0.5 * Float64(Float64(x * y) / z)); elseif (x <= 1.4) tmp = Float64(y / Float64(x * z)); 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.45) tmp = 0.5 * ((x * y) / z); elseif (x <= 1.4) tmp = y / (x * z); else tmp = 0.5 * (y * (x / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.45], N[(0.5 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.4], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45:\\
\;\;\;\;0.5 \cdot \frac{x \cdot y}{z}\\
\mathbf{elif}\;x \leq 1.4:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{z}\right)\\
\end{array}
\end{array}
if x < -1.44999999999999996Initial program 79.7%
associate-*r/60.9%
associate-/r*57.8%
Simplified57.8%
Taylor expanded in x around 0 37.1%
unpow237.1%
Simplified37.1%
Taylor expanded in x around inf 45.9%
if -1.44999999999999996 < x < 1.3999999999999999Initial program 94.6%
associate-*r/94.6%
associate-/r*97.2%
Simplified97.2%
Taylor expanded in x around 0 96.6%
if 1.3999999999999999 < x Initial program 64.6%
associate-*r/55.4%
associate-/r*67.7%
Simplified67.7%
Taylor expanded in x around 0 44.4%
unpow244.4%
Simplified44.4%
Taylor expanded in x around inf 40.8%
associate-*l/43.7%
*-commutative43.7%
Simplified43.7%
Final simplification70.5%
(FPCore (x y z) :precision binary64 (if (<= z 1.35e-107) (/ (/ y z) x) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if (z <= 1.35e-107) {
tmp = (y / z) / x;
} else {
tmp = y / (x * z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= 1.35d-107) then
tmp = (y / z) / x
else
tmp = y / (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 1.35e-107) {
tmp = (y / z) / x;
} else {
tmp = y / (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 1.35e-107: tmp = (y / z) / x else: tmp = y / (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 1.35e-107) tmp = Float64(Float64(y / z) / x); else tmp = Float64(y / Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 1.35e-107) tmp = (y / z) / x; else tmp = y / (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 1.35e-107], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.35 \cdot 10^{-107}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if z < 1.35e-107Initial program 82.2%
associate-*r/76.3%
associate-/r*82.0%
Simplified82.0%
Taylor expanded in x around 0 47.5%
*-commutative47.5%
associate-/r*52.7%
Simplified52.7%
if 1.35e-107 < z Initial program 85.3%
associate-*r/76.1%
associate-/r*75.8%
Simplified75.8%
Taylor expanded in x around 0 60.6%
Final simplification55.4%
(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 83.2%
associate-*r/76.2%
associate-/r*79.9%
Simplified79.9%
Taylor expanded in x around 0 52.0%
Final simplification52.0%
(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 2023280
(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))