
(FPCore (x y z) :precision binary64 (/ (* x y) (* (* z z) (+ z 1.0))))
double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * y) / ((z * z) * (z + 1.0d0))
end function
public static double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
def code(x, y, z): return (x * y) / ((z * z) * (z + 1.0))
function code(x, y, z) return Float64(Float64(x * y) / Float64(Float64(z * z) * Float64(z + 1.0))) end
function tmp = code(x, y, z) tmp = (x * y) / ((z * z) * (z + 1.0)); end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* x y) (* (* z z) (+ z 1.0))))
double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * y) / ((z * z) * (z + 1.0d0))
end function
public static double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
def code(x, y, z): return (x * y) / ((z * z) * (z + 1.0))
function code(x, y, z) return Float64(Float64(x * y) / Float64(Float64(z * z) * Float64(z + 1.0))) end
function tmp = code(x, y, z) tmp = (x * y) / ((z * z) * (z + 1.0)); end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (* z z) (+ z 1.0))))
(if (or (<= t_0 2e-211) (not (<= t_0 2e+257)))
(/ (* (/ x z) (/ y z)) (+ z 1.0))
(/ (* x y) t_0))))
double code(double x, double y, double z) {
double t_0 = (z * z) * (z + 1.0);
double tmp;
if ((t_0 <= 2e-211) || !(t_0 <= 2e+257)) {
tmp = ((x / z) * (y / z)) / (z + 1.0);
} else {
tmp = (x * y) / 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 = (z * z) * (z + 1.0d0)
if ((t_0 <= 2d-211) .or. (.not. (t_0 <= 2d+257))) then
tmp = ((x / z) * (y / z)) / (z + 1.0d0)
else
tmp = (x * y) / t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z * z) * (z + 1.0);
double tmp;
if ((t_0 <= 2e-211) || !(t_0 <= 2e+257)) {
tmp = ((x / z) * (y / z)) / (z + 1.0);
} else {
tmp = (x * y) / t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (z * z) * (z + 1.0) tmp = 0 if (t_0 <= 2e-211) or not (t_0 <= 2e+257): tmp = ((x / z) * (y / z)) / (z + 1.0) else: tmp = (x * y) / t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(z * z) * Float64(z + 1.0)) tmp = 0.0 if ((t_0 <= 2e-211) || !(t_0 <= 2e+257)) tmp = Float64(Float64(Float64(x / z) * Float64(y / z)) / Float64(z + 1.0)); else tmp = Float64(Float64(x * y) / t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z * z) * (z + 1.0); tmp = 0.0; if ((t_0 <= 2e-211) || ~((t_0 <= 2e+257))) tmp = ((x / z) * (y / z)) / (z + 1.0); else tmp = (x * y) / t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 2e-211], N[Not[LessEqual[t$95$0, 2e+257]], $MachinePrecision]], N[(N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(z \cdot z\right) \cdot \left(z + 1\right)\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-211} \lor \neg \left(t_0 \leq 2 \cdot 10^{+257}\right):\\
\;\;\;\;\frac{\frac{x}{z} \cdot \frac{y}{z}}{z + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{t_0}\\
\end{array}
\end{array}
if (*.f64 (*.f64 z z) (+.f64 z 1)) < 2.00000000000000017e-211 or 2.00000000000000006e257 < (*.f64 (*.f64 z z) (+.f64 z 1)) Initial program 77.0%
associate-*l*77.0%
times-frac93.0%
associate-/r*97.4%
associate-*r/98.9%
Simplified98.9%
if 2.00000000000000017e-211 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 2.00000000000000006e257Initial program 99.4%
Final simplification99.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (* z z) (+ z 1.0))))
(if (<= t_0 -2e+15)
(/ (/ y z) (* z (/ z x)))
(if (<= t_0 5e-185)
(/ (* x (/ y z)) z)
(if (<= t_0 2e+257) (/ (* x y) t_0) (/ (/ (/ x z) z) (/ z y)))))))
double code(double x, double y, double z) {
double t_0 = (z * z) * (z + 1.0);
double tmp;
if (t_0 <= -2e+15) {
tmp = (y / z) / (z * (z / x));
} else if (t_0 <= 5e-185) {
tmp = (x * (y / z)) / z;
} else if (t_0 <= 2e+257) {
tmp = (x * y) / t_0;
} else {
tmp = ((x / z) / z) / (z / y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (z * z) * (z + 1.0d0)
if (t_0 <= (-2d+15)) then
tmp = (y / z) / (z * (z / x))
else if (t_0 <= 5d-185) then
tmp = (x * (y / z)) / z
else if (t_0 <= 2d+257) then
tmp = (x * y) / t_0
else
tmp = ((x / z) / z) / (z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z * z) * (z + 1.0);
double tmp;
if (t_0 <= -2e+15) {
tmp = (y / z) / (z * (z / x));
} else if (t_0 <= 5e-185) {
tmp = (x * (y / z)) / z;
} else if (t_0 <= 2e+257) {
tmp = (x * y) / t_0;
} else {
tmp = ((x / z) / z) / (z / y);
}
return tmp;
}
def code(x, y, z): t_0 = (z * z) * (z + 1.0) tmp = 0 if t_0 <= -2e+15: tmp = (y / z) / (z * (z / x)) elif t_0 <= 5e-185: tmp = (x * (y / z)) / z elif t_0 <= 2e+257: tmp = (x * y) / t_0 else: tmp = ((x / z) / z) / (z / y) return tmp
function code(x, y, z) t_0 = Float64(Float64(z * z) * Float64(z + 1.0)) tmp = 0.0 if (t_0 <= -2e+15) tmp = Float64(Float64(y / z) / Float64(z * Float64(z / x))); elseif (t_0 <= 5e-185) tmp = Float64(Float64(x * Float64(y / z)) / z); elseif (t_0 <= 2e+257) tmp = Float64(Float64(x * y) / t_0); else tmp = Float64(Float64(Float64(x / z) / z) / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z * z) * (z + 1.0); tmp = 0.0; if (t_0 <= -2e+15) tmp = (y / z) / (z * (z / x)); elseif (t_0 <= 5e-185) tmp = (x * (y / z)) / z; elseif (t_0 <= 2e+257) tmp = (x * y) / t_0; else tmp = ((x / z) / z) / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+15], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-185], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$0, 2e+257], N[(N[(x * y), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(z \cdot z\right) \cdot \left(z + 1\right)\\
\mathbf{if}\;t_0 \leq -2 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{-185}:\\
\;\;\;\;\frac{x \cdot \frac{y}{z}}{z}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+257}:\\
\;\;\;\;\frac{x \cdot y}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{x}{z}}{z}}{\frac{z}{y}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 z z) (+.f64 z 1)) < -2e15Initial program 80.4%
*-commutative80.4%
sqr-neg80.4%
times-frac87.2%
sqr-neg87.2%
Simplified87.2%
Taylor expanded in z around inf 86.2%
*-commutative86.2%
clear-num86.2%
associate-/r*95.4%
frac-times96.7%
*-un-lft-identity96.7%
Applied egg-rr96.7%
if -2e15 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 5.0000000000000003e-185Initial program 75.4%
*-commutative75.4%
sqr-neg75.4%
times-frac78.8%
sqr-neg78.8%
Simplified78.8%
Taylor expanded in z around 0 78.8%
associate-/r*90.6%
associate-*l/98.5%
Applied egg-rr98.5%
if 5.0000000000000003e-185 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 2.00000000000000006e257Initial program 99.3%
if 2.00000000000000006e257 < (*.f64 (*.f64 z z) (+.f64 z 1)) Initial program 81.1%
*-commutative81.1%
sqr-neg81.1%
times-frac91.8%
sqr-neg91.8%
Simplified91.8%
Taylor expanded in z around inf 91.8%
associate-/r*98.0%
frac-times91.8%
Applied egg-rr91.8%
clear-num91.8%
inv-pow91.8%
*-un-lft-identity91.8%
times-frac89.8%
clear-num89.8%
associate-/l*95.8%
div-inv95.8%
clear-num95.9%
Applied egg-rr95.9%
unpow-195.9%
*-commutative95.9%
associate-/r*95.9%
*-commutative95.9%
associate-/r*95.9%
associate-/r/95.8%
*-commutative95.8%
associate-*l/95.8%
associate-*r/95.9%
*-rgt-identity95.9%
Simplified95.9%
Final simplification97.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (* z z) (+ z 1.0))))
(if (<= t_0 -2e+15)
(/ (/ y z) (* z (/ z x)))
(if (<= t_0 5e-185)
(/ (* x (/ y z)) z)
(/ (* y (/ x (+ z 1.0))) (* z z))))))
double code(double x, double y, double z) {
double t_0 = (z * z) * (z + 1.0);
double tmp;
if (t_0 <= -2e+15) {
tmp = (y / z) / (z * (z / x));
} else if (t_0 <= 5e-185) {
tmp = (x * (y / z)) / z;
} else {
tmp = (y * (x / (z + 1.0))) / (z * 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 = (z * z) * (z + 1.0d0)
if (t_0 <= (-2d+15)) then
tmp = (y / z) / (z * (z / x))
else if (t_0 <= 5d-185) then
tmp = (x * (y / z)) / z
else
tmp = (y * (x / (z + 1.0d0))) / (z * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z * z) * (z + 1.0);
double tmp;
if (t_0 <= -2e+15) {
tmp = (y / z) / (z * (z / x));
} else if (t_0 <= 5e-185) {
tmp = (x * (y / z)) / z;
} else {
tmp = (y * (x / (z + 1.0))) / (z * z);
}
return tmp;
}
def code(x, y, z): t_0 = (z * z) * (z + 1.0) tmp = 0 if t_0 <= -2e+15: tmp = (y / z) / (z * (z / x)) elif t_0 <= 5e-185: tmp = (x * (y / z)) / z else: tmp = (y * (x / (z + 1.0))) / (z * z) return tmp
function code(x, y, z) t_0 = Float64(Float64(z * z) * Float64(z + 1.0)) tmp = 0.0 if (t_0 <= -2e+15) tmp = Float64(Float64(y / z) / Float64(z * Float64(z / x))); elseif (t_0 <= 5e-185) tmp = Float64(Float64(x * Float64(y / z)) / z); else tmp = Float64(Float64(y * Float64(x / Float64(z + 1.0))) / Float64(z * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z * z) * (z + 1.0); tmp = 0.0; if (t_0 <= -2e+15) tmp = (y / z) / (z * (z / x)); elseif (t_0 <= 5e-185) tmp = (x * (y / z)) / z; else tmp = (y * (x / (z + 1.0))) / (z * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+15], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-185], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y * N[(x / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(z \cdot z\right) \cdot \left(z + 1\right)\\
\mathbf{if}\;t_0 \leq -2 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{-185}:\\
\;\;\;\;\frac{x \cdot \frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{x}{z + 1}}{z \cdot z}\\
\end{array}
\end{array}
if (*.f64 (*.f64 z z) (+.f64 z 1)) < -2e15Initial program 80.4%
*-commutative80.4%
sqr-neg80.4%
times-frac87.2%
sqr-neg87.2%
Simplified87.2%
Taylor expanded in z around inf 86.2%
*-commutative86.2%
clear-num86.2%
associate-/r*95.4%
frac-times96.7%
*-un-lft-identity96.7%
Applied egg-rr96.7%
if -2e15 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 5.0000000000000003e-185Initial program 75.4%
*-commutative75.4%
sqr-neg75.4%
times-frac78.8%
sqr-neg78.8%
Simplified78.8%
Taylor expanded in z around 0 78.8%
associate-/r*90.6%
associate-*l/98.5%
Applied egg-rr98.5%
if 5.0000000000000003e-185 < (*.f64 (*.f64 z z) (+.f64 z 1)) Initial program 90.0%
*-commutative90.0%
sqr-neg90.0%
times-frac86.7%
sqr-neg86.7%
Simplified86.7%
associate-*l/92.5%
Applied egg-rr92.5%
Final simplification96.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.6e-92) (not (<= z 5.8e-15))) (/ y (* z (* z (/ (+ z 1.0) x)))) (/ (/ x (/ z y)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.6e-92) || !(z <= 5.8e-15)) {
tmp = y / (z * (z * ((z + 1.0) / x)));
} else {
tmp = (x / (z / y)) / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-2.6d-92)) .or. (.not. (z <= 5.8d-15))) then
tmp = y / (z * (z * ((z + 1.0d0) / x)))
else
tmp = (x / (z / y)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.6e-92) || !(z <= 5.8e-15)) {
tmp = y / (z * (z * ((z + 1.0) / x)));
} else {
tmp = (x / (z / y)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.6e-92) or not (z <= 5.8e-15): tmp = y / (z * (z * ((z + 1.0) / x))) else: tmp = (x / (z / y)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.6e-92) || !(z <= 5.8e-15)) tmp = Float64(y / Float64(z * Float64(z * Float64(Float64(z + 1.0) / x)))); else tmp = Float64(Float64(x / Float64(z / y)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.6e-92) || ~((z <= 5.8e-15))) tmp = y / (z * (z * ((z + 1.0) / x))); else tmp = (x / (z / y)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.6e-92], N[Not[LessEqual[z, 5.8e-15]], $MachinePrecision]], N[(y / N[(z * N[(z * N[(N[(z + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-92} \lor \neg \left(z \leq 5.8 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{y}{z \cdot \left(z \cdot \frac{z + 1}{x}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\frac{z}{y}}}{z}\\
\end{array}
\end{array}
if z < -2.6e-92 or 5.80000000000000037e-15 < z Initial program 84.7%
*-commutative84.7%
sqr-neg84.7%
times-frac87.9%
sqr-neg87.9%
Simplified87.9%
frac-2neg87.9%
div-inv87.8%
distribute-rgt-neg-in87.8%
Applied egg-rr87.8%
associate-*r/87.9%
*-rgt-identity87.9%
associate-/r*94.1%
Simplified94.1%
*-commutative94.1%
clear-num94.1%
distribute-frac-neg94.1%
frac-2neg94.1%
times-frac94.2%
*-un-lft-identity94.2%
associate-/l/89.9%
*-commutative89.9%
Applied egg-rr89.9%
if -2.6e-92 < z < 5.80000000000000037e-15Initial program 77.9%
*-commutative77.9%
sqr-neg77.9%
times-frac78.4%
sqr-neg78.4%
Simplified78.4%
Taylor expanded in z around 0 78.4%
add-sqr-sqrt31.9%
sqrt-unprod28.6%
sqr-neg28.6%
sqrt-unprod0.3%
add-sqr-sqrt1.3%
distribute-rgt-neg-in1.3%
associate-/r*1.4%
associate-/r/1.4%
clear-num1.4%
*-un-lft-identity1.4%
associate-*l/1.4%
clear-num1.4%
associate-/r*1.4%
distribute-neg-frac1.4%
div-inv1.4%
clear-num1.4%
/-rgt-identity1.4%
Applied egg-rr1.4%
add-sqr-sqrt1.2%
sqrt-unprod44.8%
sqr-neg44.8%
sqrt-unprod50.7%
add-sqr-sqrt96.9%
distribute-rgt-neg-in96.9%
clear-num96.8%
associate-*l/98.4%
*-un-lft-identity98.4%
Applied egg-rr98.4%
Final simplification93.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (* (/ x z) (/ y (* z z))) (/ (* x (/ y z)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = (x * (y / z)) / 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.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = (x / z) * (y / (z * z))
else
tmp = (x * (y / z)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = (x * (y / z)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = (x / z) * (y / (z * z)) else: tmp = (x * (y / z)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(Float64(x / z) * Float64(y / Float64(z * z))); else tmp = Float64(Float64(x * Float64(y / z)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.0))) tmp = (x / z) * (y / (z * z)); else tmp = (x * (y / z)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{y}{z}}{z}\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 82.6%
*-commutative82.6%
sqr-neg82.6%
times-frac86.9%
sqr-neg86.9%
Simplified86.9%
Taylor expanded in z around inf 86.4%
if -1 < z < 1Initial program 80.8%
*-commutative80.8%
sqr-neg80.8%
times-frac80.6%
sqr-neg80.6%
Simplified80.6%
Taylor expanded in z around 0 77.7%
associate-/r*86.9%
associate-*l/93.6%
Applied egg-rr93.6%
Final simplification90.1%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (/ y (* (* z z) (/ z x))) (/ (* x (/ y z)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = y / ((z * z) * (z / x));
} else {
tmp = (x * (y / z)) / 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.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = y / ((z * z) * (z / x))
else
tmp = (x * (y / z)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = y / ((z * z) * (z / x));
} else {
tmp = (x * (y / z)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = y / ((z * z) * (z / x)) else: tmp = (x * (y / z)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(y / Float64(Float64(z * z) * Float64(z / x))); else tmp = Float64(Float64(x * Float64(y / z)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.0))) tmp = y / ((z * z) * (z / x)); else tmp = (x * (y / z)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(y / N[(N[(z * z), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{y}{\left(z \cdot z\right) \cdot \frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{y}{z}}{z}\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 82.6%
*-commutative82.6%
sqr-neg82.6%
times-frac86.9%
sqr-neg86.9%
Simplified86.9%
Taylor expanded in z around inf 86.4%
*-commutative86.4%
clear-num86.4%
frac-times85.5%
*-un-lft-identity85.5%
Applied egg-rr85.5%
if -1 < z < 1Initial program 80.8%
*-commutative80.8%
sqr-neg80.8%
times-frac80.6%
sqr-neg80.6%
Simplified80.6%
Taylor expanded in z around 0 77.7%
associate-/r*86.9%
associate-*l/93.6%
Applied egg-rr93.6%
Final simplification89.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (/ y (* (* z z) (/ z x))) (/ (/ x (/ z y)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = y / ((z * z) * (z / x));
} else {
tmp = (x / (z / y)) / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = y / ((z * z) * (z / x))
else
tmp = (x / (z / y)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = y / ((z * z) * (z / x));
} else {
tmp = (x / (z / y)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = y / ((z * z) * (z / x)) else: tmp = (x / (z / y)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(y / Float64(Float64(z * z) * Float64(z / x))); else tmp = Float64(Float64(x / Float64(z / y)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.0))) tmp = y / ((z * z) * (z / x)); else tmp = (x / (z / y)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(y / N[(N[(z * z), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{y}{\left(z \cdot z\right) \cdot \frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\frac{z}{y}}}{z}\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 82.6%
*-commutative82.6%
sqr-neg82.6%
times-frac86.9%
sqr-neg86.9%
Simplified86.9%
Taylor expanded in z around inf 86.4%
*-commutative86.4%
clear-num86.4%
frac-times85.5%
*-un-lft-identity85.5%
Applied egg-rr85.5%
if -1 < z < 1Initial program 80.8%
*-commutative80.8%
sqr-neg80.8%
times-frac80.6%
sqr-neg80.6%
Simplified80.6%
Taylor expanded in z around 0 77.7%
add-sqr-sqrt32.9%
sqrt-unprod28.7%
sqr-neg28.7%
sqrt-unprod0.3%
add-sqr-sqrt1.3%
distribute-rgt-neg-in1.3%
associate-/r*1.3%
associate-/r/1.4%
clear-num1.4%
*-un-lft-identity1.4%
associate-*l/1.4%
clear-num1.4%
associate-/r*1.4%
distribute-neg-frac1.4%
div-inv1.4%
clear-num1.4%
/-rgt-identity1.4%
Applied egg-rr1.4%
add-sqr-sqrt1.1%
sqrt-unprod41.9%
sqr-neg41.9%
sqrt-unprod47.2%
add-sqr-sqrt93.6%
distribute-rgt-neg-in93.6%
clear-num93.6%
associate-*l/94.9%
*-un-lft-identity94.9%
Applied egg-rr94.9%
Final simplification90.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (/ (/ y z) (* z (/ z x))) (/ (/ x (/ z y)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = (y / z) / (z * (z / x));
} else {
tmp = (x / (z / y)) / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = (y / z) / (z * (z / x))
else
tmp = (x / (z / y)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = (y / z) / (z * (z / x));
} else {
tmp = (x / (z / y)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = (y / z) / (z * (z / x)) else: tmp = (x / (z / y)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(Float64(y / z) / Float64(z * Float64(z / x))); else tmp = Float64(Float64(x / Float64(z / y)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.0))) tmp = (y / z) / (z * (z / x)); else tmp = (x / (z / y)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\frac{z}{y}}}{z}\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 82.6%
*-commutative82.6%
sqr-neg82.6%
times-frac86.9%
sqr-neg86.9%
Simplified86.9%
Taylor expanded in z around inf 86.4%
*-commutative86.4%
clear-num86.4%
associate-/r*93.6%
frac-times94.5%
*-un-lft-identity94.5%
Applied egg-rr94.5%
if -1 < z < 1Initial program 80.8%
*-commutative80.8%
sqr-neg80.8%
times-frac80.6%
sqr-neg80.6%
Simplified80.6%
Taylor expanded in z around 0 77.7%
add-sqr-sqrt32.9%
sqrt-unprod28.7%
sqr-neg28.7%
sqrt-unprod0.3%
add-sqr-sqrt1.3%
distribute-rgt-neg-in1.3%
associate-/r*1.3%
associate-/r/1.4%
clear-num1.4%
*-un-lft-identity1.4%
associate-*l/1.4%
clear-num1.4%
associate-/r*1.4%
distribute-neg-frac1.4%
div-inv1.4%
clear-num1.4%
/-rgt-identity1.4%
Applied egg-rr1.4%
add-sqr-sqrt1.1%
sqrt-unprod41.9%
sqr-neg41.9%
sqrt-unprod47.2%
add-sqr-sqrt93.6%
distribute-rgt-neg-in93.6%
clear-num93.6%
associate-*l/94.9%
*-un-lft-identity94.9%
Applied egg-rr94.9%
Final simplification94.7%
(FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ y (* (* z z) (/ z x))) (if (<= z 1.0) (/ (/ x (/ z y)) z) (/ (* x (/ y z)) (* z z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = y / ((z * z) * (z / x));
} else if (z <= 1.0) {
tmp = (x / (z / y)) / z;
} else {
tmp = (x * (y / z)) / (z * 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.0d0)) then
tmp = y / ((z * z) * (z / x))
else if (z <= 1.0d0) then
tmp = (x / (z / y)) / z
else
tmp = (x * (y / z)) / (z * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = y / ((z * z) * (z / x));
} else if (z <= 1.0) {
tmp = (x / (z / y)) / z;
} else {
tmp = (x * (y / z)) / (z * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.0: tmp = y / ((z * z) * (z / x)) elif z <= 1.0: tmp = (x / (z / y)) / z else: tmp = (x * (y / z)) / (z * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(y / Float64(Float64(z * z) * Float64(z / x))); elseif (z <= 1.0) tmp = Float64(Float64(x / Float64(z / y)) / z); else tmp = Float64(Float64(x * Float64(y / z)) / Float64(z * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.0) tmp = y / ((z * z) * (z / x)); elseif (z <= 1.0) tmp = (x / (z / y)) / z; else tmp = (x * (y / z)) / (z * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(y / N[(N[(z * z), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{y}{\left(z \cdot z\right) \cdot \frac{z}{x}}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{\frac{x}{\frac{z}{y}}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{y}{z}}{z \cdot z}\\
\end{array}
\end{array}
if z < -1Initial program 80.4%
*-commutative80.4%
sqr-neg80.4%
times-frac87.2%
sqr-neg87.2%
Simplified87.2%
Taylor expanded in z around inf 86.2%
*-commutative86.2%
clear-num86.2%
frac-times86.8%
*-un-lft-identity86.8%
Applied egg-rr86.8%
if -1 < z < 1Initial program 80.8%
*-commutative80.8%
sqr-neg80.8%
times-frac80.6%
sqr-neg80.6%
Simplified80.6%
Taylor expanded in z around 0 77.7%
add-sqr-sqrt32.9%
sqrt-unprod28.7%
sqr-neg28.7%
sqrt-unprod0.3%
add-sqr-sqrt1.3%
distribute-rgt-neg-in1.3%
associate-/r*1.3%
associate-/r/1.4%
clear-num1.4%
*-un-lft-identity1.4%
associate-*l/1.4%
clear-num1.4%
associate-/r*1.4%
distribute-neg-frac1.4%
div-inv1.4%
clear-num1.4%
/-rgt-identity1.4%
Applied egg-rr1.4%
add-sqr-sqrt1.1%
sqrt-unprod41.9%
sqr-neg41.9%
sqrt-unprod47.2%
add-sqr-sqrt93.6%
distribute-rgt-neg-in93.6%
clear-num93.6%
associate-*l/94.9%
*-un-lft-identity94.9%
Applied egg-rr94.9%
if 1 < z Initial program 85.1%
*-commutative85.1%
sqr-neg85.1%
times-frac86.6%
sqr-neg86.6%
Simplified86.6%
Taylor expanded in z around inf 86.6%
associate-/r*91.4%
frac-times93.5%
Applied egg-rr93.5%
Final simplification92.5%
(FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ (/ y z) (* z (/ z x))) (if (<= z 1.0) (/ (/ x (/ z y)) z) (/ (/ y (/ z x)) (* z z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (y / z) / (z * (z / x));
} else if (z <= 1.0) {
tmp = (x / (z / y)) / z;
} else {
tmp = (y / (z / x)) / (z * 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.0d0)) then
tmp = (y / z) / (z * (z / x))
else if (z <= 1.0d0) then
tmp = (x / (z / y)) / z
else
tmp = (y / (z / x)) / (z * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (y / z) / (z * (z / x));
} else if (z <= 1.0) {
tmp = (x / (z / y)) / z;
} else {
tmp = (y / (z / x)) / (z * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (y / z) / (z * (z / x)) elif z <= 1.0: tmp = (x / (z / y)) / z else: tmp = (y / (z / x)) / (z * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(y / z) / Float64(z * Float64(z / x))); elseif (z <= 1.0) tmp = Float64(Float64(x / Float64(z / y)) / z); else tmp = Float64(Float64(y / Float64(z / x)) / Float64(z * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.0) tmp = (y / z) / (z * (z / x)); elseif (z <= 1.0) tmp = (x / (z / y)) / z; else tmp = (y / (z / x)) / (z * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{\frac{x}{\frac{z}{y}}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{\frac{z}{x}}}{z \cdot z}\\
\end{array}
\end{array}
if z < -1Initial program 80.4%
*-commutative80.4%
sqr-neg80.4%
times-frac87.2%
sqr-neg87.2%
Simplified87.2%
Taylor expanded in z around inf 86.2%
*-commutative86.2%
clear-num86.2%
associate-/r*95.4%
frac-times96.7%
*-un-lft-identity96.7%
Applied egg-rr96.7%
if -1 < z < 1Initial program 80.8%
*-commutative80.8%
sqr-neg80.8%
times-frac80.6%
sqr-neg80.6%
Simplified80.6%
Taylor expanded in z around 0 77.7%
add-sqr-sqrt32.9%
sqrt-unprod28.7%
sqr-neg28.7%
sqrt-unprod0.3%
add-sqr-sqrt1.3%
distribute-rgt-neg-in1.3%
associate-/r*1.3%
associate-/r/1.4%
clear-num1.4%
*-un-lft-identity1.4%
associate-*l/1.4%
clear-num1.4%
associate-/r*1.4%
distribute-neg-frac1.4%
div-inv1.4%
clear-num1.4%
/-rgt-identity1.4%
Applied egg-rr1.4%
add-sqr-sqrt1.1%
sqrt-unprod41.9%
sqr-neg41.9%
sqrt-unprod47.2%
add-sqr-sqrt93.6%
distribute-rgt-neg-in93.6%
clear-num93.6%
associate-*l/94.9%
*-un-lft-identity94.9%
Applied egg-rr94.9%
if 1 < z Initial program 85.1%
*-commutative85.1%
sqr-neg85.1%
times-frac86.6%
sqr-neg86.6%
Simplified86.6%
Taylor expanded in z around inf 86.6%
associate-/r*91.4%
frac-times93.5%
Applied egg-rr93.5%
associate-*l/90.1%
associate-/l*88.7%
Applied egg-rr88.7%
Final simplification94.0%
(FPCore (x y z) :precision binary64 (if (<= x -1e-11) (* x (/ y (* z z))) (* y (/ x (* z z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1e-11) {
tmp = x * (y / (z * z));
} else {
tmp = y * (x / (z * 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 <= (-1d-11)) then
tmp = x * (y / (z * z))
else
tmp = y * (x / (z * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1e-11) {
tmp = x * (y / (z * z));
} else {
tmp = y * (x / (z * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1e-11: tmp = x * (y / (z * z)) else: tmp = y * (x / (z * z)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1e-11) tmp = Float64(x * Float64(y / Float64(z * z))); else tmp = Float64(y * Float64(x / Float64(z * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1e-11) tmp = x * (y / (z * z)); else tmp = y * (x / (z * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1e-11], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-11}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if x < -9.99999999999999939e-12Initial program 81.1%
*-commutative81.1%
sqr-neg81.1%
times-frac85.5%
sqr-neg85.5%
Simplified85.5%
Taylor expanded in z around 0 71.5%
if -9.99999999999999939e-12 < x Initial program 81.9%
*-commutative81.9%
associate-*r/82.4%
sqr-neg82.4%
associate-*l*82.4%
associate-*l*82.4%
sqr-neg82.4%
associate-*l*82.4%
distribute-lft-in82.4%
fma-def82.4%
*-rgt-identity82.4%
Simplified82.4%
Taylor expanded in z around 0 75.4%
unpow275.4%
Simplified75.4%
Final simplification74.3%
(FPCore (x y z) :precision binary64 (if (<= x -3.5e-78) (* x (/ y (* z z))) (* y (/ (/ x z) z))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.5e-78) {
tmp = x * (y / (z * z));
} else {
tmp = y * ((x / z) / 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.5d-78)) then
tmp = x * (y / (z * z))
else
tmp = y * ((x / z) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.5e-78) {
tmp = x * (y / (z * z));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.5e-78: tmp = x * (y / (z * z)) else: tmp = y * ((x / z) / z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.5e-78) tmp = Float64(x * Float64(y / Float64(z * z))); else tmp = Float64(y * Float64(Float64(x / z) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.5e-78) tmp = x * (y / (z * z)); else tmp = y * ((x / z) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.5e-78], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{-78}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if x < -3.4999999999999999e-78Initial program 83.1%
*-commutative83.1%
sqr-neg83.1%
times-frac86.8%
sqr-neg86.8%
Simplified86.8%
Taylor expanded in z around 0 74.4%
if -3.4999999999999999e-78 < x Initial program 81.0%
*-commutative81.0%
sqr-neg81.0%
times-frac82.1%
sqr-neg82.1%
Simplified82.1%
*-commutative82.1%
clear-num82.1%
associate-/r*90.0%
frac-times93.8%
*-un-lft-identity93.8%
Applied egg-rr93.8%
Taylor expanded in z around 0 69.9%
unpow269.9%
associate-/l*72.4%
associate-/r/74.3%
associate-/l/78.7%
Simplified78.7%
Final simplification77.3%
(FPCore (x y z) :precision binary64 (if (<= y 2.2e-126) (/ x (* z (/ z y))) (* y (/ x (* z z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 2.2e-126) {
tmp = x / (z * (z / y));
} else {
tmp = y * (x / (z * z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= 2.2d-126) then
tmp = x / (z * (z / y))
else
tmp = y * (x / (z * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 2.2e-126) {
tmp = x / (z * (z / y));
} else {
tmp = y * (x / (z * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 2.2e-126: tmp = x / (z * (z / y)) else: tmp = y * (x / (z * z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 2.2e-126) tmp = Float64(x / Float64(z * Float64(z / y))); else tmp = Float64(y * Float64(x / Float64(z * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 2.2e-126) tmp = x / (z * (z / y)); else tmp = y * (x / (z * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 2.2e-126], N[(x / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-126}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if y < 2.20000000000000014e-126Initial program 80.3%
*-commutative80.3%
sqr-neg80.3%
times-frac83.8%
sqr-neg83.8%
Simplified83.8%
Taylor expanded in z around 0 75.7%
*-commutative75.7%
clear-num75.7%
associate-*l/81.3%
div-inv81.8%
*-commutative81.8%
Applied egg-rr81.8%
if 2.20000000000000014e-126 < y Initial program 85.3%
*-commutative85.3%
associate-*r/87.0%
sqr-neg87.0%
associate-*l*86.9%
associate-*l*87.0%
sqr-neg87.0%
associate-*l*86.9%
distribute-lft-in86.9%
fma-def86.9%
*-rgt-identity86.9%
Simplified86.9%
Taylor expanded in z around 0 77.0%
unpow277.0%
Simplified77.0%
Final simplification80.5%
(FPCore (x y z) :precision binary64 (if (<= y 1.1e-133) (/ x (* z (/ z y))) (/ y (* z (/ z x)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.1e-133) {
tmp = x / (z * (z / y));
} else {
tmp = y / (z * (z / x));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= 1.1d-133) then
tmp = x / (z * (z / y))
else
tmp = y / (z * (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 1.1e-133) {
tmp = x / (z * (z / y));
} else {
tmp = y / (z * (z / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.1e-133: tmp = x / (z * (z / y)) else: tmp = y / (z * (z / x)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.1e-133) tmp = Float64(x / Float64(z * Float64(z / y))); else tmp = Float64(y / Float64(z * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 1.1e-133) tmp = x / (z * (z / y)); else tmp = y / (z * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.1e-133], N[(x / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.1 \cdot 10^{-133}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if y < 1.1e-133Initial program 80.2%
*-commutative80.2%
sqr-neg80.2%
times-frac83.8%
sqr-neg83.8%
Simplified83.8%
Taylor expanded in z around 0 75.6%
*-commutative75.6%
clear-num75.6%
associate-*l/81.2%
div-inv81.7%
*-commutative81.7%
Applied egg-rr81.7%
if 1.1e-133 < y Initial program 85.5%
*-commutative85.5%
sqr-neg85.5%
times-frac83.4%
sqr-neg83.4%
Simplified83.4%
*-commutative83.4%
clear-num83.4%
associate-/r*88.4%
frac-times93.5%
*-un-lft-identity93.5%
Applied egg-rr93.5%
Taylor expanded in z around 0 70.8%
unpow270.8%
*-commutative70.8%
associate-/l*77.3%
associate-*r/78.7%
Simplified78.7%
Final simplification80.9%
(FPCore (x y z) :precision binary64 (* y (/ x (* z z))))
double code(double x, double y, double z) {
return y * (x / (z * 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 * z))
end function
public static double code(double x, double y, double z) {
return y * (x / (z * z));
}
def code(x, y, z): return y * (x / (z * z))
function code(x, y, z) return Float64(y * Float64(x / Float64(z * z))) end
function tmp = code(x, y, z) tmp = y * (x / (z * z)); end
code[x_, y_, z_] := N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \frac{x}{z \cdot z}
\end{array}
Initial program 81.7%
*-commutative81.7%
associate-*r/81.5%
sqr-neg81.5%
associate-*l*81.5%
associate-*l*81.5%
sqr-neg81.5%
associate-*l*81.5%
distribute-lft-in81.5%
fma-def81.5%
*-rgt-identity81.5%
Simplified81.5%
Taylor expanded in z around 0 72.3%
unpow272.3%
Simplified72.3%
Final simplification72.3%
(FPCore (x y z) :precision binary64 (if (< z 249.6182814532307) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1.0 z)) x) z)))
double code(double x, double y, double z) {
double tmp;
if (z < 249.6182814532307) {
tmp = (y * (x / z)) / (z + (z * z));
} else {
tmp = (((y / z) / (1.0 + z)) * x) / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z < 249.6182814532307d0) then
tmp = (y * (x / z)) / (z + (z * z))
else
tmp = (((y / z) / (1.0d0 + z)) * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z < 249.6182814532307) {
tmp = (y * (x / z)) / (z + (z * z));
} else {
tmp = (((y / z) / (1.0 + z)) * x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z < 249.6182814532307: tmp = (y * (x / z)) / (z + (z * z)) else: tmp = (((y / z) / (1.0 + z)) * x) / z return tmp
function code(x, y, z) tmp = 0.0 if (z < 249.6182814532307) tmp = Float64(Float64(y * Float64(x / z)) / Float64(z + Float64(z * z))); else tmp = Float64(Float64(Float64(Float64(y / z) / Float64(1.0 + z)) * x) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z < 249.6182814532307) tmp = (y * (x / z)) / (z + (z * z)); else tmp = (((y / z) / (1.0 + z)) * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Less[z, 249.6182814532307], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / N[(z + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y / z), $MachinePrecision] / N[(1.0 + z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z < 249.6182814532307:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z + z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{y}{z}}{1 + z} \cdot x}{z}\\
\end{array}
\end{array}
herbie shell --seed 2023290
(FPCore (x y z)
:name "Statistics.Distribution.Beta:$cvariance from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< z 249.6182814532307) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1.0 z)) x) z))
(/ (* x y) (* (* z z) (+ z 1.0))))