
(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 (/ y (* x (/ z (cosh x)))))
double code(double x, double y, double z) {
return y / (x * (z / cosh(x)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y / (x * (z / cosh(x)))
end function
public static double code(double x, double y, double z) {
return y / (x * (z / Math.cosh(x)));
}
def code(x, y, z): return y / (x * (z / math.cosh(x)))
function code(x, y, z) return Float64(y / Float64(x * Float64(z / cosh(x)))) end
function tmp = code(x, y, z) tmp = y / (x * (z / cosh(x))); end
code[x_, y_, z_] := N[(y / N[(x * N[(z / N[Cosh[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{x \cdot \frac{z}{\cosh x}}
\end{array}
Initial program 84.5%
associate-*r/75.5%
associate-/r*77.0%
Simplified77.0%
*-commutative77.0%
associate-/r*75.5%
associate-/r/84.5%
associate-/r*97.3%
Applied egg-rr97.3%
Final simplification97.3%
(FPCore (x y z)
:precision binary64
(if (<= y -1.2e+191)
(+ (* 0.5 (/ (* y x) z)) (* (/ y z) (/ 1.0 x)))
(if (or (<= y -6e-150) (not (<= y 7.8e-209)))
(* (/ (cosh x) z) (/ y x))
(* y (/ (+ (* (/ x y) (* y (* x 0.5))) 1.0) (* x z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.2e+191) {
tmp = (0.5 * ((y * x) / z)) + ((y / z) * (1.0 / x));
} else if ((y <= -6e-150) || !(y <= 7.8e-209)) {
tmp = (cosh(x) / z) * (y / x);
} else {
tmp = y * ((((x / y) * (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.2d+191)) then
tmp = (0.5d0 * ((y * x) / z)) + ((y / z) * (1.0d0 / x))
else if ((y <= (-6d-150)) .or. (.not. (y <= 7.8d-209))) then
tmp = (cosh(x) / z) * (y / x)
else
tmp = y * ((((x / y) * (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.2e+191) {
tmp = (0.5 * ((y * x) / z)) + ((y / z) * (1.0 / x));
} else if ((y <= -6e-150) || !(y <= 7.8e-209)) {
tmp = (Math.cosh(x) / z) * (y / x);
} else {
tmp = y * ((((x / y) * (y * (x * 0.5))) + 1.0) / (x * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.2e+191: tmp = (0.5 * ((y * x) / z)) + ((y / z) * (1.0 / x)) elif (y <= -6e-150) or not (y <= 7.8e-209): tmp = (math.cosh(x) / z) * (y / x) else: tmp = y * ((((x / y) * (y * (x * 0.5))) + 1.0) / (x * z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.2e+191) tmp = Float64(Float64(0.5 * Float64(Float64(y * x) / z)) + Float64(Float64(y / z) * Float64(1.0 / x))); elseif ((y <= -6e-150) || !(y <= 7.8e-209)) tmp = Float64(Float64(cosh(x) / z) * Float64(y / x)); else tmp = Float64(y * Float64(Float64(Float64(Float64(x / y) * Float64(y * Float64(x * 0.5))) + 1.0) / Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.2e+191) tmp = (0.5 * ((y * x) / z)) + ((y / z) * (1.0 / x)); elseif ((y <= -6e-150) || ~((y <= 7.8e-209))) tmp = (cosh(x) / z) * (y / x); else tmp = y * ((((x / y) * (y * (x * 0.5))) + 1.0) / (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.2e+191], N[(N[(0.5 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -6e-150], N[Not[LessEqual[y, 7.8e-209]], $MachinePrecision]], N[(N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(N[(N[(x / y), $MachinePrecision] * N[(y * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+191}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{z} + \frac{y}{z} \cdot \frac{1}{x}\\
\mathbf{elif}\;y \leq -6 \cdot 10^{-150} \lor \neg \left(y \leq 7.8 \cdot 10^{-209}\right):\\
\;\;\;\;\frac{\cosh x}{z} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{x}{y} \cdot \left(y \cdot \left(x \cdot 0.5\right)\right) + 1}{x \cdot z}\\
\end{array}
\end{array}
if y < -1.19999999999999993e191Initial program 80.1%
associate-*r/80.1%
associate-/r*92.7%
Simplified92.7%
Taylor expanded in x around 0 99.9%
associate-/l/99.9%
div-inv99.9%
Applied egg-rr99.9%
if -1.19999999999999993e191 < y < -6.0000000000000003e-150 or 7.8000000000000001e-209 < y Initial program 92.5%
associate-*l/92.5%
Simplified92.5%
if -6.0000000000000003e-150 < y < 7.8000000000000001e-209Initial program 61.6%
associate-*r/54.4%
associate-/r*61.8%
Simplified61.8%
Taylor expanded in x around 0 47.1%
associate-/l*47.0%
div-inv47.0%
clear-num47.0%
*-commutative47.0%
Applied egg-rr47.0%
+-commutative47.0%
associate-/r*50.5%
div-inv50.5%
clear-num50.5%
metadata-eval50.5%
associate-*l/50.5%
div-inv50.5%
metadata-eval50.5%
associate-*l/50.6%
*-commutative50.6%
associate-*r/50.6%
associate-*l*50.6%
*-commutative50.6%
*-commutative50.6%
frac-add45.5%
lft-mult-inverse45.6%
remove-double-div45.6%
metadata-eval45.6%
metadata-eval45.6%
metadata-eval45.6%
Applied egg-rr52.9%
add-exp-log_binary6429.6%
Applied rewrite-once29.6%
rem-exp-log52.9%
*-commutative52.9%
associate-/r/80.2%
*-commutative80.2%
Simplified80.2%
Final simplification90.7%
(FPCore (x y z)
:precision binary64
(if (<= x -1.7e+122)
(* y (/ (+ (* (/ x y) (* y (* x 0.5))) 1.0) (* x z)))
(if (<= x 1.08e+151)
(* (cosh x) (/ y (* x z)))
(* (/ y x) (/ (+ (* 0.5 (* x x)) 1.0) z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.7e+122) {
tmp = y * ((((x / y) * (y * (x * 0.5))) + 1.0) / (x * z));
} else if (x <= 1.08e+151) {
tmp = cosh(x) * (y / (x * z));
} else {
tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.7d+122)) then
tmp = y * ((((x / y) * (y * (x * 0.5d0))) + 1.0d0) / (x * z))
else if (x <= 1.08d+151) then
tmp = cosh(x) * (y / (x * z))
else
tmp = (y / x) * (((0.5d0 * (x * x)) + 1.0d0) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.7e+122) {
tmp = y * ((((x / y) * (y * (x * 0.5))) + 1.0) / (x * z));
} else if (x <= 1.08e+151) {
tmp = Math.cosh(x) * (y / (x * z));
} else {
tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.7e+122: tmp = y * ((((x / y) * (y * (x * 0.5))) + 1.0) / (x * z)) elif x <= 1.08e+151: tmp = math.cosh(x) * (y / (x * z)) else: tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.7e+122) tmp = Float64(y * Float64(Float64(Float64(Float64(x / y) * Float64(y * Float64(x * 0.5))) + 1.0) / Float64(x * z))); elseif (x <= 1.08e+151) tmp = Float64(cosh(x) * Float64(y / Float64(x * z))); else tmp = Float64(Float64(y / x) * Float64(Float64(Float64(0.5 * Float64(x * x)) + 1.0) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.7e+122) tmp = y * ((((x / y) * (y * (x * 0.5))) + 1.0) / (x * z)); elseif (x <= 1.08e+151) tmp = cosh(x) * (y / (x * z)); else tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.7e+122], N[(y * N[(N[(N[(N[(x / y), $MachinePrecision] * N[(y * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.08e+151], N[(N[Cosh[x], $MachinePrecision] * N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] * N[(N[(N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+122}:\\
\;\;\;\;y \cdot \frac{\frac{x}{y} \cdot \left(y \cdot \left(x \cdot 0.5\right)\right) + 1}{x \cdot z}\\
\mathbf{elif}\;x \leq 1.08 \cdot 10^{+151}:\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{0.5 \cdot \left(x \cdot x\right) + 1}{z}\\
\end{array}
\end{array}
if x < -1.7e122Initial program 52.4%
associate-*r/38.1%
associate-/r*50.0%
Simplified50.0%
Taylor expanded in x around 0 47.4%
associate-/l*40.9%
div-inv40.9%
clear-num40.9%
*-commutative40.9%
Applied egg-rr40.9%
+-commutative40.9%
associate-/r*40.9%
div-inv40.9%
clear-num40.9%
metadata-eval40.9%
associate-*l/40.9%
div-inv40.9%
metadata-eval40.9%
associate-*l/47.4%
*-commutative47.4%
associate-*r/47.4%
associate-*l*47.4%
*-commutative47.4%
*-commutative47.4%
frac-add38.1%
lft-mult-inverse38.1%
remove-double-div38.1%
metadata-eval38.1%
metadata-eval38.1%
metadata-eval38.1%
Applied egg-rr45.2%
add-exp-log_binary6414.3%
Applied rewrite-once14.3%
rem-exp-log45.2%
*-commutative45.2%
associate-/r/69.0%
*-commutative69.0%
Simplified69.0%
if -1.7e122 < x < 1.08000000000000003e151Initial program 92.7%
associate-*r/86.2%
associate-/r*87.1%
Simplified87.1%
if 1.08000000000000003e151 < x Initial program 78.6%
associate-*r/60.7%
associate-/r*50.0%
Simplified50.0%
Taylor expanded in x around 0 48.4%
associate-/l*45.1%
div-inv45.1%
clear-num45.1%
*-commutative45.1%
Applied egg-rr45.1%
+-commutative45.1%
associate-/r*45.1%
div-inv45.1%
clear-num45.1%
metadata-eval45.1%
associate-*l/45.1%
div-inv45.1%
metadata-eval45.1%
associate-*l/48.4%
*-commutative48.4%
associate-*r/48.4%
associate-*l*48.4%
*-commutative48.4%
*-commutative48.4%
frac-add60.8%
lft-mult-inverse60.8%
remove-double-div60.8%
metadata-eval60.8%
metadata-eval60.8%
metadata-eval60.8%
Applied egg-rr50.1%
Taylor expanded in y around 0 64.3%
times-frac75.1%
unpow275.1%
Simplified75.1%
Final simplification82.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ y x) (/ (+ (* 0.5 (* x x)) 1.0) z)))
(t_1 (* (/ x y) (* y (* x 0.5)))))
(if (<= y -1e+77)
(/ (+ t_1 (* z (/ 1.0 z))) (* x (/ z y)))
(if (<= y -1.05e-151)
t_0
(if (<= y 1.6e-109)
(* y (/ (+ t_1 1.0) (* x z)))
(if (<= y 1.5e+74)
t_0
(if (<= y 1.55e+92)
(*
(/ y z)
(/ (- (* (* x z) (- (/ x 2.0))) (* y (/ z y))) (* x (- z))))
(+ (* 0.5 (/ (* y x) z)) (/ y (* x z))))))))))
double code(double x, double y, double z) {
double t_0 = (y / x) * (((0.5 * (x * x)) + 1.0) / z);
double t_1 = (x / y) * (y * (x * 0.5));
double tmp;
if (y <= -1e+77) {
tmp = (t_1 + (z * (1.0 / z))) / (x * (z / y));
} else if (y <= -1.05e-151) {
tmp = t_0;
} else if (y <= 1.6e-109) {
tmp = y * ((t_1 + 1.0) / (x * z));
} else if (y <= 1.5e+74) {
tmp = t_0;
} else if (y <= 1.55e+92) {
tmp = (y / z) * ((((x * z) * -(x / 2.0)) - (y * (z / y))) / (x * -z));
} else {
tmp = (0.5 * ((y * x) / z)) + (y / (x * z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (y / x) * (((0.5d0 * (x * x)) + 1.0d0) / z)
t_1 = (x / y) * (y * (x * 0.5d0))
if (y <= (-1d+77)) then
tmp = (t_1 + (z * (1.0d0 / z))) / (x * (z / y))
else if (y <= (-1.05d-151)) then
tmp = t_0
else if (y <= 1.6d-109) then
tmp = y * ((t_1 + 1.0d0) / (x * z))
else if (y <= 1.5d+74) then
tmp = t_0
else if (y <= 1.55d+92) then
tmp = (y / z) * ((((x * z) * -(x / 2.0d0)) - (y * (z / y))) / (x * -z))
else
tmp = (0.5d0 * ((y * x) / z)) + (y / (x * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y / x) * (((0.5 * (x * x)) + 1.0) / z);
double t_1 = (x / y) * (y * (x * 0.5));
double tmp;
if (y <= -1e+77) {
tmp = (t_1 + (z * (1.0 / z))) / (x * (z / y));
} else if (y <= -1.05e-151) {
tmp = t_0;
} else if (y <= 1.6e-109) {
tmp = y * ((t_1 + 1.0) / (x * z));
} else if (y <= 1.5e+74) {
tmp = t_0;
} else if (y <= 1.55e+92) {
tmp = (y / z) * ((((x * z) * -(x / 2.0)) - (y * (z / y))) / (x * -z));
} else {
tmp = (0.5 * ((y * x) / z)) + (y / (x * z));
}
return tmp;
}
def code(x, y, z): t_0 = (y / x) * (((0.5 * (x * x)) + 1.0) / z) t_1 = (x / y) * (y * (x * 0.5)) tmp = 0 if y <= -1e+77: tmp = (t_1 + (z * (1.0 / z))) / (x * (z / y)) elif y <= -1.05e-151: tmp = t_0 elif y <= 1.6e-109: tmp = y * ((t_1 + 1.0) / (x * z)) elif y <= 1.5e+74: tmp = t_0 elif y <= 1.55e+92: tmp = (y / z) * ((((x * z) * -(x / 2.0)) - (y * (z / y))) / (x * -z)) else: tmp = (0.5 * ((y * x) / z)) + (y / (x * z)) return tmp
function code(x, y, z) t_0 = Float64(Float64(y / x) * Float64(Float64(Float64(0.5 * Float64(x * x)) + 1.0) / z)) t_1 = Float64(Float64(x / y) * Float64(y * Float64(x * 0.5))) tmp = 0.0 if (y <= -1e+77) tmp = Float64(Float64(t_1 + Float64(z * Float64(1.0 / z))) / Float64(x * Float64(z / y))); elseif (y <= -1.05e-151) tmp = t_0; elseif (y <= 1.6e-109) tmp = Float64(y * Float64(Float64(t_1 + 1.0) / Float64(x * z))); elseif (y <= 1.5e+74) tmp = t_0; elseif (y <= 1.55e+92) tmp = Float64(Float64(y / z) * Float64(Float64(Float64(Float64(x * z) * Float64(-Float64(x / 2.0))) - Float64(y * Float64(z / y))) / Float64(x * Float64(-z)))); else tmp = Float64(Float64(0.5 * Float64(Float64(y * x) / z)) + Float64(y / Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y / x) * (((0.5 * (x * x)) + 1.0) / z); t_1 = (x / y) * (y * (x * 0.5)); tmp = 0.0; if (y <= -1e+77) tmp = (t_1 + (z * (1.0 / z))) / (x * (z / y)); elseif (y <= -1.05e-151) tmp = t_0; elseif (y <= 1.6e-109) tmp = y * ((t_1 + 1.0) / (x * z)); elseif (y <= 1.5e+74) tmp = t_0; elseif (y <= 1.55e+92) tmp = (y / z) * ((((x * z) * -(x / 2.0)) - (y * (z / y))) / (x * -z)); else tmp = (0.5 * ((y * x) / z)) + (y / (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y / x), $MachinePrecision] * N[(N[(N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] * N[(y * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e+77], N[(N[(t$95$1 + N[(z * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.05e-151], t$95$0, If[LessEqual[y, 1.6e-109], N[(y * N[(N[(t$95$1 + 1.0), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e+74], t$95$0, If[LessEqual[y, 1.55e+92], N[(N[(y / z), $MachinePrecision] * N[(N[(N[(N[(x * z), $MachinePrecision] * (-N[(x / 2.0), $MachinePrecision])), $MachinePrecision] - N[(y * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x} \cdot \frac{0.5 \cdot \left(x \cdot x\right) + 1}{z}\\
t_1 := \frac{x}{y} \cdot \left(y \cdot \left(x \cdot 0.5\right)\right)\\
\mathbf{if}\;y \leq -1 \cdot 10^{+77}:\\
\;\;\;\;\frac{t_1 + z \cdot \frac{1}{z}}{x \cdot \frac{z}{y}}\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-151}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-109}:\\
\;\;\;\;y \cdot \frac{t_1 + 1}{x \cdot z}\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+74}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+92}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{\left(x \cdot z\right) \cdot \left(-\frac{x}{2}\right) - y \cdot \frac{z}{y}}{x \cdot \left(-z\right)}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{z} + \frac{y}{x \cdot z}\\
\end{array}
\end{array}
if y < -9.99999999999999983e76Initial program 84.7%
associate-*r/82.6%
associate-/r*89.7%
Simplified89.7%
Taylor expanded in x around 0 88.4%
+-commutative88.4%
associate-/l/88.4%
div-inv88.3%
*-commutative88.3%
associate-/l*74.2%
associate-*r/74.2%
frac-add76.1%
associate-*r*76.1%
*-commutative76.1%
*-commutative76.1%
/-rgt-identity76.1%
times-frac82.0%
*-commutative82.0%
times-frac90.2%
/-rgt-identity90.2%
Applied egg-rr90.2%
if -9.99999999999999983e76 < y < -1.04999999999999995e-151 or 1.6000000000000001e-109 < y < 1.5e74Initial program 96.6%
associate-*r/81.4%
associate-/r*77.2%
Simplified77.2%
Taylor expanded in x around 0 59.3%
associate-/l*59.3%
div-inv59.3%
clear-num59.3%
*-commutative59.3%
Applied egg-rr59.3%
+-commutative59.3%
associate-/r*61.3%
div-inv61.3%
clear-num61.2%
metadata-eval61.2%
associate-*l/61.3%
div-inv61.3%
metadata-eval61.3%
associate-*l/61.3%
*-commutative61.3%
associate-*r/61.3%
associate-*l*61.3%
*-commutative61.3%
*-commutative61.3%
frac-add63.9%
lft-mult-inverse63.9%
remove-double-div63.9%
metadata-eval63.9%
metadata-eval63.9%
metadata-eval63.9%
Applied egg-rr63.0%
Taylor expanded in y around 0 63.0%
times-frac75.7%
unpow275.7%
Simplified75.7%
if -1.04999999999999995e-151 < y < 1.6000000000000001e-109Initial program 64.7%
associate-*r/55.3%
associate-/r*62.4%
Simplified62.4%
Taylor expanded in x around 0 46.4%
associate-/l*46.0%
div-inv46.0%
clear-num46.4%
*-commutative46.4%
Applied egg-rr46.4%
+-commutative46.4%
associate-/r*52.8%
div-inv52.8%
clear-num52.8%
metadata-eval52.8%
associate-*l/52.8%
div-inv52.8%
metadata-eval52.8%
associate-*l/52.8%
*-commutative52.8%
associate-*r/52.8%
associate-*l*52.8%
*-commutative52.8%
*-commutative52.8%
frac-add47.6%
lft-mult-inverse47.7%
remove-double-div47.7%
metadata-eval47.7%
metadata-eval47.7%
metadata-eval47.7%
Applied egg-rr52.1%
add-exp-log_binary6426.5%
Applied rewrite-once26.5%
rem-exp-log52.1%
*-commutative52.1%
associate-/r/76.1%
*-commutative76.1%
Simplified76.1%
if 1.5e74 < y < 1.5500000000000001e92Initial program 99.6%
associate-*r/99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in x around 0 75.3%
*-commutative75.3%
associate-/l*75.3%
div-inv75.3%
Applied egg-rr75.3%
+-commutative75.3%
associate-*r*75.3%
clear-num75.3%
associate-*r*75.3%
*-commutative75.3%
associate-/r/75.3%
frac-2neg75.3%
associate-*r/75.3%
*-commutative75.3%
frac-add74.2%
*-commutative74.2%
div-inv74.6%
Applied egg-rr74.6%
*-commutative74.6%
associate-/r/74.2%
associate-/l*99.6%
associate-/r/99.6%
associate-/r/99.0%
associate-*l/99.6%
*-lft-identity99.6%
fma-udef99.6%
distribute-rgt-neg-out99.6%
unsub-neg99.6%
distribute-rgt-neg-out99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
distribute-rgt-neg-out99.6%
*-commutative99.6%
Simplified99.6%
if 1.5500000000000001e92 < y Initial program 92.3%
associate-*r/89.6%
associate-/r*86.4%
Simplified86.4%
Taylor expanded in x around 0 89.7%
Final simplification81.0%
(FPCore (x y z)
:precision binary64
(if (<= y -9e+190)
(+ (* 0.5 (/ (* y x) z)) (* (/ y z) (/ 1.0 x)))
(if (or (<= y -1.26e-151) (not (<= y 2.3e-110)))
(* (/ y x) (/ (+ (* 0.5 (* x x)) 1.0) z))
(* y (/ (+ (* (/ x y) (* y (* x 0.5))) 1.0) (* x z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -9e+190) {
tmp = (0.5 * ((y * x) / z)) + ((y / z) * (1.0 / x));
} else if ((y <= -1.26e-151) || !(y <= 2.3e-110)) {
tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z);
} else {
tmp = y * ((((x / y) * (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 <= (-9d+190)) then
tmp = (0.5d0 * ((y * x) / z)) + ((y / z) * (1.0d0 / x))
else if ((y <= (-1.26d-151)) .or. (.not. (y <= 2.3d-110))) then
tmp = (y / x) * (((0.5d0 * (x * x)) + 1.0d0) / z)
else
tmp = y * ((((x / y) * (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 <= -9e+190) {
tmp = (0.5 * ((y * x) / z)) + ((y / z) * (1.0 / x));
} else if ((y <= -1.26e-151) || !(y <= 2.3e-110)) {
tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z);
} else {
tmp = y * ((((x / y) * (y * (x * 0.5))) + 1.0) / (x * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -9e+190: tmp = (0.5 * ((y * x) / z)) + ((y / z) * (1.0 / x)) elif (y <= -1.26e-151) or not (y <= 2.3e-110): tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z) else: tmp = y * ((((x / y) * (y * (x * 0.5))) + 1.0) / (x * z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -9e+190) tmp = Float64(Float64(0.5 * Float64(Float64(y * x) / z)) + Float64(Float64(y / z) * Float64(1.0 / x))); elseif ((y <= -1.26e-151) || !(y <= 2.3e-110)) tmp = Float64(Float64(y / x) * Float64(Float64(Float64(0.5 * Float64(x * x)) + 1.0) / z)); else tmp = Float64(y * Float64(Float64(Float64(Float64(x / y) * Float64(y * Float64(x * 0.5))) + 1.0) / Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -9e+190) tmp = (0.5 * ((y * x) / z)) + ((y / z) * (1.0 / x)); elseif ((y <= -1.26e-151) || ~((y <= 2.3e-110))) tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z); else tmp = y * ((((x / y) * (y * (x * 0.5))) + 1.0) / (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -9e+190], N[(N[(0.5 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -1.26e-151], N[Not[LessEqual[y, 2.3e-110]], $MachinePrecision]], N[(N[(y / x), $MachinePrecision] * N[(N[(N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(N[(N[(x / y), $MachinePrecision] * N[(y * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+190}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{z} + \frac{y}{z} \cdot \frac{1}{x}\\
\mathbf{elif}\;y \leq -1.26 \cdot 10^{-151} \lor \neg \left(y \leq 2.3 \cdot 10^{-110}\right):\\
\;\;\;\;\frac{y}{x} \cdot \frac{0.5 \cdot \left(x \cdot x\right) + 1}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{x}{y} \cdot \left(y \cdot \left(x \cdot 0.5\right)\right) + 1}{x \cdot z}\\
\end{array}
\end{array}
if y < -8.9999999999999999e190Initial program 80.1%
associate-*r/80.1%
associate-/r*92.7%
Simplified92.7%
Taylor expanded in x around 0 99.9%
associate-/l/99.9%
div-inv99.9%
Applied egg-rr99.9%
if -8.9999999999999999e190 < y < -1.2600000000000001e-151 or 2.3000000000000001e-110 < y Initial program 94.8%
associate-*r/84.5%
associate-/r*81.1%
Simplified81.1%
Taylor expanded in x around 0 68.9%
associate-/l*66.5%
div-inv66.5%
clear-num66.5%
*-commutative66.5%
Applied egg-rr66.5%
+-commutative66.5%
associate-/r*64.6%
div-inv64.6%
clear-num64.5%
metadata-eval64.5%
associate-*l/64.9%
div-inv64.9%
metadata-eval64.9%
associate-*l/67.3%
*-commutative67.3%
associate-*r/67.3%
associate-*l*67.3%
*-commutative67.3%
*-commutative67.3%
frac-add68.8%
lft-mult-inverse68.8%
remove-double-div68.8%
metadata-eval68.8%
metadata-eval68.8%
metadata-eval68.8%
Applied egg-rr67.1%
Taylor expanded in y around 0 68.4%
times-frac76.2%
unpow276.2%
Simplified76.2%
if -1.2600000000000001e-151 < y < 2.3000000000000001e-110Initial program 64.7%
associate-*r/55.3%
associate-/r*62.4%
Simplified62.4%
Taylor expanded in x around 0 46.4%
associate-/l*46.0%
div-inv46.0%
clear-num46.4%
*-commutative46.4%
Applied egg-rr46.4%
+-commutative46.4%
associate-/r*52.8%
div-inv52.8%
clear-num52.8%
metadata-eval52.8%
associate-*l/52.8%
div-inv52.8%
metadata-eval52.8%
associate-*l/52.8%
*-commutative52.8%
associate-*r/52.8%
associate-*l*52.8%
*-commutative52.8%
*-commutative52.8%
frac-add47.6%
lft-mult-inverse47.7%
remove-double-div47.7%
metadata-eval47.7%
metadata-eval47.7%
metadata-eval47.7%
Applied egg-rr52.1%
add-exp-log_binary6426.5%
Applied rewrite-once26.5%
rem-exp-log52.1%
*-commutative52.1%
associate-/r/76.1%
*-commutative76.1%
Simplified76.1%
Final simplification78.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ x y) (* y (* x 0.5)))))
(if (<= y -5e+77)
(/ (+ t_0 (* z (/ 1.0 z))) (* x (/ z y)))
(if (or (<= y -4e-149) (not (<= y 6.2e-110)))
(* (/ y x) (/ (+ (* 0.5 (* x x)) 1.0) z))
(* y (/ (+ t_0 1.0) (* x z)))))))
double code(double x, double y, double z) {
double t_0 = (x / y) * (y * (x * 0.5));
double tmp;
if (y <= -5e+77) {
tmp = (t_0 + (z * (1.0 / z))) / (x * (z / y));
} else if ((y <= -4e-149) || !(y <= 6.2e-110)) {
tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z);
} else {
tmp = y * ((t_0 + 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) :: t_0
real(8) :: tmp
t_0 = (x / y) * (y * (x * 0.5d0))
if (y <= (-5d+77)) then
tmp = (t_0 + (z * (1.0d0 / z))) / (x * (z / y))
else if ((y <= (-4d-149)) .or. (.not. (y <= 6.2d-110))) then
tmp = (y / x) * (((0.5d0 * (x * x)) + 1.0d0) / z)
else
tmp = y * ((t_0 + 1.0d0) / (x * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x / y) * (y * (x * 0.5));
double tmp;
if (y <= -5e+77) {
tmp = (t_0 + (z * (1.0 / z))) / (x * (z / y));
} else if ((y <= -4e-149) || !(y <= 6.2e-110)) {
tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z);
} else {
tmp = y * ((t_0 + 1.0) / (x * z));
}
return tmp;
}
def code(x, y, z): t_0 = (x / y) * (y * (x * 0.5)) tmp = 0 if y <= -5e+77: tmp = (t_0 + (z * (1.0 / z))) / (x * (z / y)) elif (y <= -4e-149) or not (y <= 6.2e-110): tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z) else: tmp = y * ((t_0 + 1.0) / (x * z)) return tmp
function code(x, y, z) t_0 = Float64(Float64(x / y) * Float64(y * Float64(x * 0.5))) tmp = 0.0 if (y <= -5e+77) tmp = Float64(Float64(t_0 + Float64(z * Float64(1.0 / z))) / Float64(x * Float64(z / y))); elseif ((y <= -4e-149) || !(y <= 6.2e-110)) tmp = Float64(Float64(y / x) * Float64(Float64(Float64(0.5 * Float64(x * x)) + 1.0) / z)); else tmp = Float64(y * Float64(Float64(t_0 + 1.0) / Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x / y) * (y * (x * 0.5)); tmp = 0.0; if (y <= -5e+77) tmp = (t_0 + (z * (1.0 / z))) / (x * (z / y)); elseif ((y <= -4e-149) || ~((y <= 6.2e-110))) tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z); else tmp = y * ((t_0 + 1.0) / (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x / y), $MachinePrecision] * N[(y * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5e+77], N[(N[(t$95$0 + N[(z * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -4e-149], N[Not[LessEqual[y, 6.2e-110]], $MachinePrecision]], N[(N[(y / x), $MachinePrecision] * N[(N[(N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(t$95$0 + 1.0), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y} \cdot \left(y \cdot \left(x \cdot 0.5\right)\right)\\
\mathbf{if}\;y \leq -5 \cdot 10^{+77}:\\
\;\;\;\;\frac{t_0 + z \cdot \frac{1}{z}}{x \cdot \frac{z}{y}}\\
\mathbf{elif}\;y \leq -4 \cdot 10^{-149} \lor \neg \left(y \leq 6.2 \cdot 10^{-110}\right):\\
\;\;\;\;\frac{y}{x} \cdot \frac{0.5 \cdot \left(x \cdot x\right) + 1}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t_0 + 1}{x \cdot z}\\
\end{array}
\end{array}
if y < -5.00000000000000004e77Initial program 84.7%
associate-*r/82.6%
associate-/r*89.7%
Simplified89.7%
Taylor expanded in x around 0 88.4%
+-commutative88.4%
associate-/l/88.4%
div-inv88.3%
*-commutative88.3%
associate-/l*74.2%
associate-*r/74.2%
frac-add76.1%
associate-*r*76.1%
*-commutative76.1%
*-commutative76.1%
/-rgt-identity76.1%
times-frac82.0%
*-commutative82.0%
times-frac90.2%
/-rgt-identity90.2%
Applied egg-rr90.2%
if -5.00000000000000004e77 < y < -3.99999999999999992e-149 or 6.20000000000000014e-110 < y Initial program 95.5%
associate-*r/84.2%
associate-/r*80.4%
Simplified80.4%
Taylor expanded in x around 0 68.2%
associate-/l*66.8%
div-inv66.8%
clear-num66.8%
*-commutative66.8%
Applied egg-rr66.8%
+-commutative66.8%
associate-/r*66.1%
div-inv66.0%
clear-num66.0%
metadata-eval66.0%
associate-*l/66.0%
div-inv66.0%
metadata-eval66.0%
associate-*l/67.5%
*-commutative67.5%
associate-*r/67.5%
associate-*l*67.5%
*-commutative67.5%
*-commutative67.5%
frac-add68.5%
lft-mult-inverse68.5%
remove-double-div68.5%
metadata-eval68.5%
metadata-eval68.5%
metadata-eval68.5%
Applied egg-rr67.0%
Taylor expanded in y around 0 67.1%
times-frac76.7%
unpow276.7%
Simplified76.7%
if -3.99999999999999992e-149 < y < 6.20000000000000014e-110Initial program 64.7%
associate-*r/55.3%
associate-/r*62.4%
Simplified62.4%
Taylor expanded in x around 0 46.4%
associate-/l*46.0%
div-inv46.0%
clear-num46.4%
*-commutative46.4%
Applied egg-rr46.4%
+-commutative46.4%
associate-/r*52.8%
div-inv52.8%
clear-num52.8%
metadata-eval52.8%
associate-*l/52.8%
div-inv52.8%
metadata-eval52.8%
associate-*l/52.8%
*-commutative52.8%
associate-*r/52.8%
associate-*l*52.8%
*-commutative52.8%
*-commutative52.8%
frac-add47.6%
lft-mult-inverse47.7%
remove-double-div47.7%
metadata-eval47.7%
metadata-eval47.7%
metadata-eval47.7%
Applied egg-rr52.1%
add-exp-log_binary6426.5%
Applied rewrite-once26.5%
rem-exp-log52.1%
*-commutative52.1%
associate-/r/76.1%
*-commutative76.1%
Simplified76.1%
Final simplification79.1%
(FPCore (x y z)
:precision binary64
(if (<= y -9e+190)
(+ (* 0.5 (/ (* y x) z)) (/ y (* x z)))
(if (or (<= y -8.8e-105) (not (<= y 2.7e-73)))
(* (/ y x) (/ (+ (* 0.5 (* x x)) 1.0) z))
(+ (/ (/ y x) z) (* y (/ x (/ z 0.5)))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -9e+190) {
tmp = (0.5 * ((y * x) / z)) + (y / (x * z));
} else if ((y <= -8.8e-105) || !(y <= 2.7e-73)) {
tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z);
} else {
tmp = ((y / x) / z) + (y * (x / (z / 0.5)));
}
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 <= (-9d+190)) then
tmp = (0.5d0 * ((y * x) / z)) + (y / (x * z))
else if ((y <= (-8.8d-105)) .or. (.not. (y <= 2.7d-73))) then
tmp = (y / x) * (((0.5d0 * (x * x)) + 1.0d0) / z)
else
tmp = ((y / x) / z) + (y * (x / (z / 0.5d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -9e+190) {
tmp = (0.5 * ((y * x) / z)) + (y / (x * z));
} else if ((y <= -8.8e-105) || !(y <= 2.7e-73)) {
tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z);
} else {
tmp = ((y / x) / z) + (y * (x / (z / 0.5)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -9e+190: tmp = (0.5 * ((y * x) / z)) + (y / (x * z)) elif (y <= -8.8e-105) or not (y <= 2.7e-73): tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z) else: tmp = ((y / x) / z) + (y * (x / (z / 0.5))) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -9e+190) tmp = Float64(Float64(0.5 * Float64(Float64(y * x) / z)) + Float64(y / Float64(x * z))); elseif ((y <= -8.8e-105) || !(y <= 2.7e-73)) tmp = Float64(Float64(y / x) * Float64(Float64(Float64(0.5 * Float64(x * x)) + 1.0) / z)); else tmp = Float64(Float64(Float64(y / x) / z) + Float64(y * Float64(x / Float64(z / 0.5)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -9e+190) tmp = (0.5 * ((y * x) / z)) + (y / (x * z)); elseif ((y <= -8.8e-105) || ~((y <= 2.7e-73))) tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z); else tmp = ((y / x) / z) + (y * (x / (z / 0.5))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -9e+190], N[(N[(0.5 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -8.8e-105], N[Not[LessEqual[y, 2.7e-73]], $MachinePrecision]], N[(N[(y / x), $MachinePrecision] * N[(N[(N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision] + N[(y * N[(x / N[(z / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+190}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{z} + \frac{y}{x \cdot z}\\
\mathbf{elif}\;y \leq -8.8 \cdot 10^{-105} \lor \neg \left(y \leq 2.7 \cdot 10^{-73}\right):\\
\;\;\;\;\frac{y}{x} \cdot \frac{0.5 \cdot \left(x \cdot x\right) + 1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{x}}{z} + y \cdot \frac{x}{\frac{z}{0.5}}\\
\end{array}
\end{array}
if y < -8.9999999999999999e190Initial program 80.1%
associate-*r/80.1%
associate-/r*92.7%
Simplified92.7%
Taylor expanded in x around 0 99.9%
if -8.9999999999999999e190 < y < -8.80000000000000016e-105 or 2.69999999999999994e-73 < y Initial program 95.5%
associate-*r/84.9%
associate-/r*82.5%
Simplified82.5%
Taylor expanded in x around 0 72.9%
associate-/l*70.1%
div-inv70.1%
clear-num70.1%
*-commutative70.1%
Applied egg-rr70.1%
+-commutative70.1%
associate-/r*66.5%
div-inv66.5%
clear-num66.4%
metadata-eval66.4%
associate-*l/66.9%
div-inv66.9%
metadata-eval66.9%
associate-*l/69.7%
*-commutative69.7%
associate-*r/69.7%
associate-*l*69.7%
*-commutative69.7%
*-commutative69.7%
frac-add70.7%
lft-mult-inverse70.7%
remove-double-div70.7%
metadata-eval70.7%
metadata-eval70.7%
metadata-eval70.7%
Applied egg-rr70.1%
Taylor expanded in y around 0 71.6%
times-frac78.7%
unpow278.7%
Simplified78.7%
if -8.80000000000000016e-105 < y < 2.69999999999999994e-73Initial program 70.7%
associate-*r/61.3%
associate-/r*64.8%
Simplified64.8%
Taylor expanded in x around 0 46.1%
associate-/l*45.7%
div-inv45.7%
clear-num46.0%
*-commutative46.0%
Applied egg-rr46.0%
+-commutative46.0%
associate-/r*52.9%
div-inv52.9%
clear-num52.8%
metadata-eval52.8%
associate-*l/52.9%
div-inv52.9%
metadata-eval52.9%
associate-*l/52.9%
*-commutative52.9%
associate-*r/52.9%
associate-*l*52.9%
*-commutative52.9%
*-commutative52.9%
frac-add49.8%
lft-mult-inverse49.9%
remove-double-div49.9%
metadata-eval49.9%
metadata-eval49.9%
metadata-eval49.9%
Applied egg-rr51.4%
associate-*r*51.4%
div-inv51.4%
associate-*l*49.4%
lft-mult-inverse49.4%
*-rgt-identity49.4%
rgt-mult-inverse35.6%
clear-num35.6%
associate-/l*42.4%
div-inv42.4%
clear-num42.4%
frac-add46.1%
associate-/l/45.7%
associate-/r*52.6%
associate-/r/61.7%
*-commutative61.7%
associate-/l*61.7%
Applied egg-rr61.7%
Final simplification74.6%
(FPCore (x y z)
:precision binary64
(if (<= z -1e+77)
(+ (* 0.5 (/ (* y x) z)) (/ y (* x z)))
(if (<= z 1e-185)
(+ (/ (/ y x) z) (* y (/ x (/ z 0.5))))
(if (<= z 1.45e+238)
(/ (* y (+ (* x (/ x 2.0)) 1.0)) (* x z))
(* (/ y x) (/ (+ (* 0.5 (* x x)) 1.0) z))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1e+77) {
tmp = (0.5 * ((y * x) / z)) + (y / (x * z));
} else if (z <= 1e-185) {
tmp = ((y / x) / z) + (y * (x / (z / 0.5)));
} else if (z <= 1.45e+238) {
tmp = (y * ((x * (x / 2.0)) + 1.0)) / (x * z);
} else {
tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1d+77)) then
tmp = (0.5d0 * ((y * x) / z)) + (y / (x * z))
else if (z <= 1d-185) then
tmp = ((y / x) / z) + (y * (x / (z / 0.5d0)))
else if (z <= 1.45d+238) then
tmp = (y * ((x * (x / 2.0d0)) + 1.0d0)) / (x * z)
else
tmp = (y / x) * (((0.5d0 * (x * x)) + 1.0d0) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1e+77) {
tmp = (0.5 * ((y * x) / z)) + (y / (x * z));
} else if (z <= 1e-185) {
tmp = ((y / x) / z) + (y * (x / (z / 0.5)));
} else if (z <= 1.45e+238) {
tmp = (y * ((x * (x / 2.0)) + 1.0)) / (x * z);
} else {
tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1e+77: tmp = (0.5 * ((y * x) / z)) + (y / (x * z)) elif z <= 1e-185: tmp = ((y / x) / z) + (y * (x / (z / 0.5))) elif z <= 1.45e+238: tmp = (y * ((x * (x / 2.0)) + 1.0)) / (x * z) else: tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1e+77) tmp = Float64(Float64(0.5 * Float64(Float64(y * x) / z)) + Float64(y / Float64(x * z))); elseif (z <= 1e-185) tmp = Float64(Float64(Float64(y / x) / z) + Float64(y * Float64(x / Float64(z / 0.5)))); elseif (z <= 1.45e+238) tmp = Float64(Float64(y * Float64(Float64(x * Float64(x / 2.0)) + 1.0)) / Float64(x * z)); else tmp = Float64(Float64(y / x) * Float64(Float64(Float64(0.5 * Float64(x * x)) + 1.0) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1e+77) tmp = (0.5 * ((y * x) / z)) + (y / (x * z)); elseif (z <= 1e-185) tmp = ((y / x) / z) + (y * (x / (z / 0.5))); elseif (z <= 1.45e+238) tmp = (y * ((x * (x / 2.0)) + 1.0)) / (x * z); else tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1e+77], N[(N[(0.5 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-185], N[(N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision] + N[(y * N[(x / N[(z / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+238], N[(N[(y * N[(N[(x * N[(x / 2.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] * N[(N[(N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+77}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{z} + \frac{y}{x \cdot z}\\
\mathbf{elif}\;z \leq 10^{-185}:\\
\;\;\;\;\frac{\frac{y}{x}}{z} + y \cdot \frac{x}{\frac{z}{0.5}}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+238}:\\
\;\;\;\;\frac{y \cdot \left(x \cdot \frac{x}{2} + 1\right)}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{0.5 \cdot \left(x \cdot x\right) + 1}{z}\\
\end{array}
\end{array}
if z < -9.99999999999999983e76Initial program 86.0%
associate-*r/67.7%
associate-/r*59.2%
Simplified59.2%
Taylor expanded in x around 0 56.3%
if -9.99999999999999983e76 < z < 9.9999999999999999e-186Initial program 89.7%
associate-*r/89.7%
associate-/r*90.1%
Simplified90.1%
Taylor expanded in x around 0 72.2%
associate-/l*72.2%
div-inv72.2%
clear-num72.2%
*-commutative72.2%
Applied egg-rr72.2%
+-commutative72.2%
associate-/r*78.9%
div-inv79.0%
clear-num78.9%
metadata-eval78.9%
associate-*l/78.9%
div-inv78.9%
metadata-eval78.9%
associate-*l/78.9%
*-commutative78.9%
associate-*r/78.9%
associate-*l*78.9%
*-commutative78.9%
*-commutative78.9%
frac-add75.4%
lft-mult-inverse75.4%
remove-double-div75.4%
metadata-eval75.4%
metadata-eval75.4%
metadata-eval75.4%
Applied egg-rr74.8%
associate-*r*74.8%
div-inv74.8%
associate-*l*73.8%
lft-mult-inverse73.8%
*-rgt-identity73.8%
rgt-mult-inverse51.3%
clear-num52.3%
associate-/l*60.0%
div-inv60.1%
clear-num60.1%
frac-add78.9%
associate-/l/72.2%
associate-/r*78.9%
associate-/r/83.6%
*-commutative83.6%
associate-/l*83.6%
Applied egg-rr83.6%
if 9.9999999999999999e-186 < z < 1.4500000000000001e238Initial program 78.8%
associate-*r/70.2%
associate-/r*77.3%
Simplified77.3%
Taylor expanded in x around 0 66.6%
*-commutative66.6%
associate-/l*66.7%
div-inv67.7%
Applied egg-rr67.7%
Applied egg-rr65.9%
associate-/r/76.6%
associate-*l/77.7%
*-commutative77.7%
Simplified77.7%
if 1.4500000000000001e238 < z Initial program 81.3%
associate-*r/43.8%
associate-/r*49.8%
Simplified49.8%
Taylor expanded in x around 0 51.0%
associate-/l*50.9%
div-inv50.9%
clear-num50.9%
*-commutative50.9%
Applied egg-rr50.9%
+-commutative50.9%
associate-/r*44.9%
div-inv45.1%
clear-num45.0%
metadata-eval45.0%
associate-*l/45.2%
div-inv45.2%
metadata-eval45.2%
associate-*l/45.3%
*-commutative45.3%
associate-*r/45.3%
associate-*l*45.3%
*-commutative45.3%
*-commutative45.3%
frac-add44.0%
lft-mult-inverse44.0%
remove-double-div44.0%
metadata-eval44.0%
metadata-eval44.0%
metadata-eval44.0%
Applied egg-rr50.0%
Taylor expanded in y around 0 49.9%
times-frac75.4%
unpow275.4%
Simplified75.4%
Final simplification75.7%
(FPCore (x y z) :precision binary64 (if (<= y -1.05e+191) (+ (/ y (* x z)) (* 0.5 (* x (/ y z)))) (* (/ y x) (/ (+ (* 0.5 (* x x)) 1.0) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.05e+191) {
tmp = (y / (x * z)) + (0.5 * (x * (y / z)));
} else {
tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1.05d+191)) then
tmp = (y / (x * z)) + (0.5d0 * (x * (y / z)))
else
tmp = (y / x) * (((0.5d0 * (x * x)) + 1.0d0) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.05e+191) {
tmp = (y / (x * z)) + (0.5 * (x * (y / z)));
} else {
tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.05e+191: tmp = (y / (x * z)) + (0.5 * (x * (y / z))) else: tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.05e+191) tmp = Float64(Float64(y / Float64(x * z)) + Float64(0.5 * Float64(x * Float64(y / z)))); else tmp = Float64(Float64(y / x) * Float64(Float64(Float64(0.5 * Float64(x * x)) + 1.0) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.05e+191) tmp = (y / (x * z)) + (0.5 * (x * (y / z))); else tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.05e+191], N[(N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] * N[(N[(N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+191}:\\
\;\;\;\;\frac{y}{x \cdot z} + 0.5 \cdot \left(x \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{0.5 \cdot \left(x \cdot x\right) + 1}{z}\\
\end{array}
\end{array}
if y < -1.05e191Initial program 80.1%
associate-*r/80.1%
associate-/r*92.7%
Simplified92.7%
Taylor expanded in x around 0 99.9%
associate-/l*86.4%
div-inv86.4%
clear-num86.4%
*-commutative86.4%
Applied egg-rr86.4%
if -1.05e191 < y Initial program 85.1%
associate-*r/75.0%
associate-/r*75.1%
Simplified75.1%
Taylor expanded in x around 0 61.6%
associate-/l*59.8%
div-inv59.8%
clear-num60.0%
*-commutative60.0%
Applied egg-rr60.0%
+-commutative60.0%
associate-/r*60.8%
div-inv60.8%
clear-num60.7%
metadata-eval60.7%
associate-*l/61.0%
div-inv61.0%
metadata-eval61.0%
associate-*l/62.6%
*-commutative62.6%
associate-*r/62.6%
associate-*l*62.6%
*-commutative62.6%
*-commutative62.6%
frac-add61.9%
lft-mult-inverse62.0%
remove-double-div62.0%
metadata-eval62.0%
metadata-eval62.0%
metadata-eval62.0%
Applied egg-rr62.2%
Taylor expanded in y around 0 68.4%
times-frac67.3%
unpow267.3%
Simplified67.3%
Final simplification69.4%
(FPCore (x y z) :precision binary64 (if (<= y -9e+190) (+ (* 0.5 (/ (* y x) z)) (/ y (* x z))) (* (/ y x) (/ (+ (* 0.5 (* x x)) 1.0) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -9e+190) {
tmp = (0.5 * ((y * x) / z)) + (y / (x * z));
} else {
tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-9d+190)) then
tmp = (0.5d0 * ((y * x) / z)) + (y / (x * z))
else
tmp = (y / x) * (((0.5d0 * (x * x)) + 1.0d0) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -9e+190) {
tmp = (0.5 * ((y * x) / z)) + (y / (x * z));
} else {
tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -9e+190: tmp = (0.5 * ((y * x) / z)) + (y / (x * z)) else: tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -9e+190) tmp = Float64(Float64(0.5 * Float64(Float64(y * x) / z)) + Float64(y / Float64(x * z))); else tmp = Float64(Float64(y / x) * Float64(Float64(Float64(0.5 * Float64(x * x)) + 1.0) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -9e+190) tmp = (0.5 * ((y * x) / z)) + (y / (x * z)); else tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -9e+190], N[(N[(0.5 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] * N[(N[(N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+190}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{z} + \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{0.5 \cdot \left(x \cdot x\right) + 1}{z}\\
\end{array}
\end{array}
if y < -8.9999999999999999e190Initial program 80.1%
associate-*r/80.1%
associate-/r*92.7%
Simplified92.7%
Taylor expanded in x around 0 99.9%
if -8.9999999999999999e190 < y Initial program 85.1%
associate-*r/75.0%
associate-/r*75.1%
Simplified75.1%
Taylor expanded in x around 0 61.6%
associate-/l*59.8%
div-inv59.8%
clear-num60.0%
*-commutative60.0%
Applied egg-rr60.0%
+-commutative60.0%
associate-/r*60.8%
div-inv60.8%
clear-num60.7%
metadata-eval60.7%
associate-*l/61.0%
div-inv61.0%
metadata-eval61.0%
associate-*l/62.6%
*-commutative62.6%
associate-*r/62.6%
associate-*l*62.6%
*-commutative62.6%
*-commutative62.6%
frac-add61.9%
lft-mult-inverse62.0%
remove-double-div62.0%
metadata-eval62.0%
metadata-eval62.0%
metadata-eval62.0%
Applied egg-rr62.2%
Taylor expanded in y around 0 68.4%
times-frac67.3%
unpow267.3%
Simplified67.3%
Final simplification70.9%
(FPCore (x y z) :precision binary64 (if (<= z 7e+202) (/ (+ (/ y x) (* 0.5 (* y x))) z) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if (z <= 7e+202) {
tmp = ((y / x) + (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 (z <= 7d+202) then
tmp = ((y / x) + (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 (z <= 7e+202) {
tmp = ((y / x) + (0.5 * (y * x))) / z;
} else {
tmp = y / (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 7e+202: tmp = ((y / x) + (0.5 * (y * x))) / z else: tmp = y / (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 7e+202) tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(y * x))) / z); else tmp = Float64(y / Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 7e+202) tmp = ((y / x) + (0.5 * (y * x))) / z; else tmp = y / (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 7e+202], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 7 \cdot 10^{+202}:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(y \cdot x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if z < 6.99999999999999975e202Initial program 86.1%
associate-*r/79.6%
associate-/r*78.8%
Simplified78.8%
Taylor expanded in x around 0 66.2%
Taylor expanded in z around 0 67.1%
if 6.99999999999999975e202 < z Initial program 70.2%
associate-*r/39.4%
associate-/r*61.4%
Simplified61.4%
Taylor expanded in x around 0 62.0%
Final simplification66.6%
(FPCore (x y z) :precision binary64 (* (/ y x) (/ (+ (* 0.5 (* x x)) 1.0) z)))
double code(double x, double y, double z) {
return (y / x) * (((0.5 * (x * x)) + 1.0) / 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 * x)) + 1.0d0) / z)
end function
public static double code(double x, double y, double z) {
return (y / x) * (((0.5 * (x * x)) + 1.0) / z);
}
def code(x, y, z): return (y / x) * (((0.5 * (x * x)) + 1.0) / z)
function code(x, y, z) return Float64(Float64(y / x) * Float64(Float64(Float64(0.5 * Float64(x * x)) + 1.0) / z)) end
function tmp = code(x, y, z) tmp = (y / x) * (((0.5 * (x * x)) + 1.0) / z); end
code[x_, y_, z_] := N[(N[(y / x), $MachinePrecision] * N[(N[(N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{x} \cdot \frac{0.5 \cdot \left(x \cdot x\right) + 1}{z}
\end{array}
Initial program 84.5%
associate-*r/75.5%
associate-/r*77.0%
Simplified77.0%
Taylor expanded in x around 0 65.8%
associate-/l*62.8%
div-inv62.8%
clear-num62.9%
*-commutative62.9%
Applied egg-rr62.9%
+-commutative62.9%
associate-/r*61.4%
div-inv61.4%
clear-num61.4%
metadata-eval61.4%
associate-*l/61.6%
div-inv61.6%
metadata-eval61.6%
associate-*l/64.5%
*-commutative64.5%
associate-*r/64.5%
associate-*l*64.5%
*-commutative64.5%
*-commutative64.5%
frac-add63.9%
lft-mult-inverse63.9%
remove-double-div63.9%
metadata-eval63.9%
metadata-eval63.9%
metadata-eval63.9%
Applied egg-rr65.6%
Taylor expanded in y around 0 71.0%
times-frac67.3%
unpow267.3%
Simplified67.3%
Final simplification67.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.4) (not (<= x 1.45))) (* 0.5 (* x (/ y z))) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4) || !(x <= 1.45)) {
tmp = 0.5 * (x * (y / z));
} else {
tmp = y / (x * z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.4d0)) .or. (.not. (x <= 1.45d0))) then
tmp = 0.5d0 * (x * (y / z))
else
tmp = y / (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4) || !(x <= 1.45)) {
tmp = 0.5 * (x * (y / z));
} else {
tmp = y / (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.4) or not (x <= 1.45): tmp = 0.5 * (x * (y / z)) else: tmp = y / (x * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.4) || !(x <= 1.45)) tmp = Float64(0.5 * Float64(x * Float64(y / z))); else tmp = Float64(y / Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.4) || ~((x <= 1.45))) tmp = 0.5 * (x * (y / z)); else tmp = y / (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.4], N[Not[LessEqual[x, 1.45]], $MachinePrecision]], N[(0.5 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \lor \neg \left(x \leq 1.45\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if x < -1.3999999999999999 or 1.44999999999999996 < x Initial program 76.8%
associate-*r/58.4%
associate-/r*58.4%
Simplified58.4%
Taylor expanded in x around 0 36.0%
associate-*r/36.0%
frac-2neg36.0%
associate-/r*36.0%
div-inv36.0%
*-commutative36.0%
frac-2neg36.0%
associate-*r/36.0%
frac-add34.5%
Applied egg-rr34.5%
Simplified46.7%
Taylor expanded in x around inf 36.0%
*-commutative36.0%
associate-*l/30.1%
*-commutative30.1%
Simplified30.1%
if -1.3999999999999999 < x < 1.44999999999999996Initial program 91.9%
associate-*r/91.9%
associate-/r*94.7%
Simplified94.7%
Taylor expanded in x around 0 93.3%
Final simplification62.4%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.4) (not (<= x 1.45))) (* 0.5 (* y (/ x z))) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4) || !(x <= 1.45)) {
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.4d0)) .or. (.not. (x <= 1.45d0))) 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.4) || !(x <= 1.45)) {
tmp = 0.5 * (y * (x / z));
} else {
tmp = y / (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.4) or not (x <= 1.45): tmp = 0.5 * (y * (x / z)) else: tmp = y / (x * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.4) || !(x <= 1.45)) 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.4) || ~((x <= 1.45))) 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.4], N[Not[LessEqual[x, 1.45]], $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.4 \lor \neg \left(x \leq 1.45\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.3999999999999999 or 1.44999999999999996 < x Initial program 76.8%
associate-*r/58.4%
associate-/r*58.4%
Simplified58.4%
Taylor expanded in x around 0 36.0%
Taylor expanded in x around inf 36.0%
*-commutative36.0%
associate-*r/36.8%
Simplified36.8%
if -1.3999999999999999 < x < 1.44999999999999996Initial program 91.9%
associate-*r/91.9%
associate-/r*94.7%
Simplified94.7%
Taylor expanded in x around 0 93.3%
Final simplification65.7%
(FPCore (x y z) :precision binary64 (if (<= z 2e+35) (/ (/ y z) x) (/ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if (z <= 2e+35) {
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 <= 2d+35) 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 <= 2e+35) {
tmp = (y / z) / x;
} else {
tmp = y / (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 2e+35: tmp = (y / z) / x else: tmp = y / (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 2e+35) 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 <= 2e+35) tmp = (y / z) / x; else tmp = y / (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 2e+35], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{+35}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x \cdot z}\\
\end{array}
\end{array}
if z < 1.9999999999999999e35Initial program 85.7%
associate-*r/80.1%
associate-/r*80.1%
Simplified80.1%
associate-*r/87.8%
times-frac95.6%
*-commutative95.6%
clear-num95.6%
un-div-inv95.7%
Applied egg-rr95.7%
Taylor expanded in x around 0 55.8%
if 1.9999999999999999e35 < z Initial program 80.8%
associate-*r/61.1%
associate-/r*67.0%
Simplified67.0%
Taylor expanded in x around 0 54.9%
Final simplification55.6%
(FPCore (x y z) :precision binary64 (/ y (* x z)))
double code(double x, double y, double z) {
return y / (x * z);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y / (x * z)
end function
public static double code(double x, double y, double z) {
return y / (x * z);
}
def code(x, y, z): return y / (x * z)
function code(x, y, z) return Float64(y / Float64(x * z)) end
function tmp = code(x, y, z) tmp = y / (x * z); end
code[x_, y_, z_] := N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{x \cdot z}
\end{array}
Initial program 84.5%
associate-*r/75.5%
associate-/r*77.0%
Simplified77.0%
Taylor expanded in x around 0 50.8%
Final simplification50.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ (/ y z) x) (cosh x))))
(if (< y -4.618902267687042e-52)
t_0
(if (< y 1.038530535935153e-39) (/ (/ (* (cosh x) y) x) z) t_0))))
double code(double x, double y, double z) {
double t_0 = ((y / z) / x) * cosh(x);
double tmp;
if (y < -4.618902267687042e-52) {
tmp = t_0;
} else if (y < 1.038530535935153e-39) {
tmp = ((cosh(x) * y) / x) / z;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((y / z) / x) * cosh(x)
if (y < (-4.618902267687042d-52)) then
tmp = t_0
else if (y < 1.038530535935153d-39) then
tmp = ((cosh(x) * y) / x) / z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((y / z) / x) * Math.cosh(x);
double tmp;
if (y < -4.618902267687042e-52) {
tmp = t_0;
} else if (y < 1.038530535935153e-39) {
tmp = ((Math.cosh(x) * y) / x) / z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((y / z) / x) * math.cosh(x) tmp = 0 if y < -4.618902267687042e-52: tmp = t_0 elif y < 1.038530535935153e-39: tmp = ((math.cosh(x) * y) / x) / z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(y / z) / x) * cosh(x)) tmp = 0.0 if (y < -4.618902267687042e-52) tmp = t_0; elseif (y < 1.038530535935153e-39) tmp = Float64(Float64(Float64(cosh(x) * y) / x) / z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((y / z) / x) * cosh(x); tmp = 0.0; if (y < -4.618902267687042e-52) tmp = t_0; elseif (y < 1.038530535935153e-39) tmp = ((cosh(x) * y) / x) / z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision] * N[Cosh[x], $MachinePrecision]), $MachinePrecision]}, If[Less[y, -4.618902267687042e-52], t$95$0, If[Less[y, 1.038530535935153e-39], N[(N[(N[(N[Cosh[x], $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision] / z), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{z}}{x} \cdot \cosh x\\
\mathbf{if}\;y < -4.618902267687042 \cdot 10^{-52}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y < 1.038530535935153 \cdot 10^{-39}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
herbie shell --seed 2023297
(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))