
(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 1.0) (* z z))) (t_1 (/ (/ (* y (/ x z)) z) z)))
(if (<= t_0 -2e+32)
t_1
(if (<= t_0 5e-291)
(* (/ x z) (/ y z))
(if (<= t_0 2e+124) (/ (* y x) t_0) t_1)))))
double code(double x, double y, double z) {
double t_0 = (z + 1.0) * (z * z);
double t_1 = ((y * (x / z)) / z) / z;
double tmp;
if (t_0 <= -2e+32) {
tmp = t_1;
} else if (t_0 <= 5e-291) {
tmp = (x / z) * (y / z);
} else if (t_0 <= 2e+124) {
tmp = (y * x) / t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (z + 1.0d0) * (z * z)
t_1 = ((y * (x / z)) / z) / z
if (t_0 <= (-2d+32)) then
tmp = t_1
else if (t_0 <= 5d-291) then
tmp = (x / z) * (y / z)
else if (t_0 <= 2d+124) then
tmp = (y * x) / t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z + 1.0) * (z * z);
double t_1 = ((y * (x / z)) / z) / z;
double tmp;
if (t_0 <= -2e+32) {
tmp = t_1;
} else if (t_0 <= 5e-291) {
tmp = (x / z) * (y / z);
} else if (t_0 <= 2e+124) {
tmp = (y * x) / t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = (z + 1.0) * (z * z) t_1 = ((y * (x / z)) / z) / z tmp = 0 if t_0 <= -2e+32: tmp = t_1 elif t_0 <= 5e-291: tmp = (x / z) * (y / z) elif t_0 <= 2e+124: tmp = (y * x) / t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(Float64(z + 1.0) * Float64(z * z)) t_1 = Float64(Float64(Float64(y * Float64(x / z)) / z) / z) tmp = 0.0 if (t_0 <= -2e+32) tmp = t_1; elseif (t_0 <= 5e-291) tmp = Float64(Float64(x / z) * Float64(y / z)); elseif (t_0 <= 2e+124) tmp = Float64(Float64(y * x) / t_0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z + 1.0) * (z * z); t_1 = ((y * (x / z)) / z) / z; tmp = 0.0; if (t_0 <= -2e+32) tmp = t_1; elseif (t_0 <= 5e-291) tmp = (x / z) * (y / z); elseif (t_0 <= 2e+124) tmp = (y * x) / t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z + 1.0), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+32], t$95$1, If[LessEqual[t$95$0, 5e-291], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+124], N[(N[(y * x), $MachinePrecision] / t$95$0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(z + 1\right) \cdot \left(z \cdot z\right)\\
t_1 := \frac{\frac{y \cdot \frac{x}{z}}{z}}{z}\\
\mathbf{if}\;t_0 \leq -2 \cdot 10^{+32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{-291}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+124}:\\
\;\;\;\;\frac{y \cdot x}{t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 z z) (+.f64 z 1)) < -2.00000000000000011e32 or 1.9999999999999999e124 < (*.f64 (*.f64 z z) (+.f64 z 1)) Initial program 81.7%
associate-*l*81.7%
times-frac92.6%
distribute-lft-in92.6%
fma-def92.6%
*-rgt-identity92.6%
Simplified92.6%
*-commutative92.6%
associate-*l/92.9%
fma-udef92.9%
distribute-lft1-in92.9%
frac-times96.3%
associate-*r/98.1%
Applied egg-rr98.1%
Taylor expanded in z around inf 88.7%
unpow288.7%
associate-/r*88.9%
associate-*l/98.1%
*-commutative98.1%
associate-*r/97.9%
Simplified97.9%
associate-*r/98.1%
associate-*l/98.1%
associate-*r/99.0%
Applied egg-rr99.0%
if -2.00000000000000011e32 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 5.0000000000000003e-291Initial program 76.2%
associate-*l*76.2%
times-frac99.8%
distribute-lft-in99.8%
fma-def99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in z around 0 76.2%
unpow276.2%
associate-/l/89.4%
associate-*r/96.0%
associate-*l/99.8%
Simplified99.8%
if 5.0000000000000003e-291 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 1.9999999999999999e124Initial program 96.5%
Final simplification98.5%
(FPCore (x y z)
:precision binary64
(if (<= z -45000000000.0)
(/ y (/ z x))
(if (or (<= z -1e-310) (and (not (<= z 1.18e+139)) (<= z 1.18e+232)))
(/ (- x) (/ z y))
(* y (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -45000000000.0) {
tmp = y / (z / x);
} else if ((z <= -1e-310) || (!(z <= 1.18e+139) && (z <= 1.18e+232))) {
tmp = -x / (z / y);
} else {
tmp = y * (x / z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-45000000000.0d0)) then
tmp = y / (z / x)
else if ((z <= (-1d-310)) .or. (.not. (z <= 1.18d+139)) .and. (z <= 1.18d+232)) then
tmp = -x / (z / y)
else
tmp = y * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -45000000000.0) {
tmp = y / (z / x);
} else if ((z <= -1e-310) || (!(z <= 1.18e+139) && (z <= 1.18e+232))) {
tmp = -x / (z / y);
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -45000000000.0: tmp = y / (z / x) elif (z <= -1e-310) or (not (z <= 1.18e+139) and (z <= 1.18e+232)): tmp = -x / (z / y) else: tmp = y * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -45000000000.0) tmp = Float64(y / Float64(z / x)); elseif ((z <= -1e-310) || (!(z <= 1.18e+139) && (z <= 1.18e+232))) tmp = Float64(Float64(-x) / Float64(z / y)); else tmp = Float64(y * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -45000000000.0) tmp = y / (z / x); elseif ((z <= -1e-310) || (~((z <= 1.18e+139)) && (z <= 1.18e+232))) tmp = -x / (z / y); else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -45000000000.0], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1e-310], And[N[Not[LessEqual[z, 1.18e+139]], $MachinePrecision], LessEqual[z, 1.18e+232]]], N[((-x) / N[(z / y), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -45000000000:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-310} \lor \neg \left(z \leq 1.18 \cdot 10^{+139}\right) \land z \leq 1.18 \cdot 10^{+232}:\\
\;\;\;\;\frac{-x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if z < -4.5e10Initial program 82.3%
associate-*r/87.3%
associate-*l*87.3%
distribute-lft-in87.3%
fma-def87.3%
*-rgt-identity87.3%
Simplified87.3%
Taylor expanded in z around 0 40.6%
+-commutative40.6%
mul-1-neg40.6%
unsub-neg40.6%
unpow240.6%
associate-/r*40.6%
Simplified40.6%
Taylor expanded in z around inf 34.3%
associate-*r/34.3%
neg-mul-134.3%
distribute-lft-neg-in34.3%
associate-*l/40.6%
*-commutative40.6%
Simplified40.6%
add-sqr-sqrt18.1%
sqrt-unprod40.4%
sqr-neg40.4%
sqrt-unprod22.8%
add-sqr-sqrt43.3%
associate-*r/36.9%
*-commutative36.9%
associate-/l*44.7%
Applied egg-rr44.7%
if -4.5e10 < z < -9.999999999999969e-311 or 1.18e139 < z < 1.18e232Initial program 86.1%
associate-*r/80.0%
associate-*l*80.0%
distribute-lft-in80.1%
fma-def80.1%
*-rgt-identity80.1%
Simplified80.1%
Taylor expanded in z around 0 74.3%
+-commutative74.3%
mul-1-neg74.3%
unsub-neg74.3%
unpow274.3%
associate-/r*78.3%
Simplified78.3%
Taylor expanded in z around inf 39.4%
associate-*r/39.4%
neg-mul-139.4%
distribute-lft-neg-in39.4%
associate-*l/46.6%
*-commutative46.6%
Simplified46.6%
Taylor expanded in x around 0 39.4%
mul-1-neg39.4%
*-commutative39.4%
associate-*l/43.4%
associate-/r/47.6%
Simplified47.6%
if -9.999999999999969e-311 < z < 1.18e139 or 1.18e232 < z Initial program 84.5%
associate-*r/85.2%
associate-*l*85.2%
distribute-lft-in85.2%
fma-def85.2%
*-rgt-identity85.2%
Simplified85.2%
Taylor expanded in z around 0 48.8%
+-commutative48.8%
mul-1-neg48.8%
unsub-neg48.8%
unpow248.8%
associate-/r*53.1%
Simplified53.1%
Taylor expanded in z around inf 16.6%
associate-*r/16.6%
neg-mul-116.6%
distribute-lft-neg-in16.6%
associate-*l/17.5%
*-commutative17.5%
Simplified17.5%
add-sqr-sqrt9.7%
sqrt-unprod30.8%
sqr-neg30.8%
sqrt-unprod21.9%
add-sqr-sqrt43.4%
associate-*r/39.7%
*-commutative39.7%
associate-/l*43.7%
Applied egg-rr43.7%
associate-/l*39.7%
*-commutative39.7%
associate-*l/42.8%
Applied egg-rr42.8%
Final simplification45.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -45000000000.0) (not (<= z 1.0))) (* (/ x z) (/ y (* z z))) (/ (* y (/ x z)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -45000000000.0) || !(z <= 1.0)) {
tmp = (x / z) * (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 ((z <= (-45000000000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = (x / z) * (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 ((z <= -45000000000.0) || !(z <= 1.0)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = (y * (x / z)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -45000000000.0) or not (z <= 1.0): tmp = (x / z) * (y / (z * z)) else: tmp = (y * (x / z)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -45000000000.0) || !(z <= 1.0)) tmp = Float64(Float64(x / z) * Float64(y / Float64(z * z))); else tmp = Float64(Float64(y * Float64(x / z)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -45000000000.0) || ~((z <= 1.0))) tmp = (x / z) * (y / (z * z)); else tmp = (y * (x / z)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -45000000000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -45000000000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z}\\
\end{array}
\end{array}
if z < -4.5e10 or 1 < z Initial program 83.7%
associate-*l*83.7%
times-frac91.9%
distribute-lft-in91.9%
fma-def91.9%
*-rgt-identity91.9%
Simplified91.9%
Taylor expanded in z around inf 90.8%
unpow290.8%
Simplified90.8%
if -4.5e10 < z < 1Initial program 85.4%
times-frac84.9%
Simplified84.9%
Taylor expanded in z around 0 83.4%
*-commutative83.4%
associate-/r*91.3%
associate-*r/93.5%
Applied egg-rr93.5%
Final simplification92.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -45000000000.0) (not (<= z 1.0))) (* (/ x z) (/ (/ y z) z)) (/ (* y (/ x z)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -45000000000.0) || !(z <= 1.0)) {
tmp = (x / z) * ((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 ((z <= (-45000000000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = (x / z) * ((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 ((z <= -45000000000.0) || !(z <= 1.0)) {
tmp = (x / z) * ((y / z) / z);
} else {
tmp = (y * (x / z)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -45000000000.0) or not (z <= 1.0): tmp = (x / z) * ((y / z) / z) else: tmp = (y * (x / z)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -45000000000.0) || !(z <= 1.0)) tmp = Float64(Float64(x / z) * Float64(Float64(y / z) / z)); else tmp = Float64(Float64(y * Float64(x / z)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -45000000000.0) || ~((z <= 1.0))) tmp = (x / z) * ((y / z) / z); else tmp = (y * (x / z)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -45000000000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -45000000000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z}\\
\end{array}
\end{array}
if z < -4.5e10 or 1 < z Initial program 83.7%
associate-*l*83.7%
times-frac91.9%
distribute-lft-in91.9%
fma-def91.9%
*-rgt-identity91.9%
Simplified91.9%
Taylor expanded in z around inf 90.8%
unpow290.8%
associate-/r*96.3%
Simplified96.3%
if -4.5e10 < z < 1Initial program 85.4%
times-frac84.9%
Simplified84.9%
Taylor expanded in z around 0 83.4%
*-commutative83.4%
associate-/r*91.3%
associate-*r/93.5%
Applied egg-rr93.5%
Final simplification94.8%
(FPCore (x y z) :precision binary64 (let* ((t_0 (/ (* y (/ x z)) z))) (if (or (<= z -45000000000.0) (not (<= z 1.0))) (/ t_0 z) t_0)))
double code(double x, double y, double z) {
double t_0 = (y * (x / z)) / z;
double tmp;
if ((z <= -45000000000.0) || !(z <= 1.0)) {
tmp = t_0 / 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 * (x / z)) / z
if ((z <= (-45000000000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = t_0 / 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 * (x / z)) / z;
double tmp;
if ((z <= -45000000000.0) || !(z <= 1.0)) {
tmp = t_0 / z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (y * (x / z)) / z tmp = 0 if (z <= -45000000000.0) or not (z <= 1.0): tmp = t_0 / z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(y * Float64(x / z)) / z) tmp = 0.0 if ((z <= -45000000000.0) || !(z <= 1.0)) tmp = Float64(t_0 / z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y * (x / z)) / z; tmp = 0.0; if ((z <= -45000000000.0) || ~((z <= 1.0))) tmp = t_0 / z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[Or[LessEqual[z, -45000000000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(t$95$0 / z), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y \cdot \frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -45000000000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{t_0}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -4.5e10 or 1 < z Initial program 83.7%
associate-*l*83.7%
times-frac91.9%
distribute-lft-in91.9%
fma-def91.9%
*-rgt-identity91.9%
Simplified91.9%
*-commutative91.9%
associate-*l/92.2%
fma-udef92.2%
distribute-lft1-in92.2%
frac-times95.1%
associate-*r/96.9%
Applied egg-rr96.9%
Taylor expanded in z around inf 88.7%
unpow288.7%
associate-/r*89.0%
associate-*l/97.1%
*-commutative97.1%
associate-*r/96.9%
Simplified96.9%
associate-*r/97.1%
associate-*l/95.7%
associate-*r/96.5%
Applied egg-rr96.5%
if -4.5e10 < z < 1Initial program 85.4%
times-frac84.9%
Simplified84.9%
Taylor expanded in z around 0 83.4%
*-commutative83.4%
associate-/r*91.3%
associate-*r/93.5%
Applied egg-rr93.5%
Final simplification94.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (/ y z) z)))
(if (<= z -45000000000.0)
(* (/ x z) t_0)
(if (<= z 1.0) (/ (* y (/ x z)) z) (/ (* x t_0) z)))))
double code(double x, double y, double z) {
double t_0 = (y / z) / z;
double tmp;
if (z <= -45000000000.0) {
tmp = (x / z) * t_0;
} else if (z <= 1.0) {
tmp = (y * (x / z)) / z;
} else {
tmp = (x * t_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) :: t_0
real(8) :: tmp
t_0 = (y / z) / z
if (z <= (-45000000000.0d0)) then
tmp = (x / z) * t_0
else if (z <= 1.0d0) then
tmp = (y * (x / z)) / z
else
tmp = (x * t_0) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y / z) / z;
double tmp;
if (z <= -45000000000.0) {
tmp = (x / z) * t_0;
} else if (z <= 1.0) {
tmp = (y * (x / z)) / z;
} else {
tmp = (x * t_0) / z;
}
return tmp;
}
def code(x, y, z): t_0 = (y / z) / z tmp = 0 if z <= -45000000000.0: tmp = (x / z) * t_0 elif z <= 1.0: tmp = (y * (x / z)) / z else: tmp = (x * t_0) / z return tmp
function code(x, y, z) t_0 = Float64(Float64(y / z) / z) tmp = 0.0 if (z <= -45000000000.0) tmp = Float64(Float64(x / z) * t_0); elseif (z <= 1.0) tmp = Float64(Float64(y * Float64(x / z)) / z); else tmp = Float64(Float64(x * t_0) / z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y / z) / z; tmp = 0.0; if (z <= -45000000000.0) tmp = (x / z) * t_0; elseif (z <= 1.0) tmp = (y * (x / z)) / z; else tmp = (x * t_0) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -45000000000.0], N[(N[(x / z), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x * t$95$0), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{z}}{z}\\
\mathbf{if}\;z \leq -45000000000:\\
\;\;\;\;\frac{x}{z} \cdot t_0\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot t_0}{z}\\
\end{array}
\end{array}
if z < -4.5e10Initial program 82.3%
associate-*l*82.3%
times-frac93.3%
distribute-lft-in93.3%
fma-def93.3%
*-rgt-identity93.3%
Simplified93.3%
Taylor expanded in z around inf 93.3%
unpow293.3%
associate-/r*97.9%
Simplified97.9%
if -4.5e10 < z < 1Initial program 85.4%
times-frac84.9%
Simplified84.9%
Taylor expanded in z around 0 83.4%
*-commutative83.4%
associate-/r*91.3%
associate-*r/93.5%
Applied egg-rr93.5%
if 1 < z Initial program 85.0%
associate-*l*85.0%
times-frac90.6%
distribute-lft-in90.6%
fma-def90.6%
*-rgt-identity90.6%
Simplified90.6%
*-commutative90.6%
associate-*l/90.6%
fma-udef90.6%
distribute-lft1-in90.6%
frac-times93.9%
associate-*r/96.9%
Applied egg-rr96.9%
Taylor expanded in z around inf 88.9%
unpow288.9%
associate-/r*89.3%
associate-*l/97.4%
*-commutative97.4%
associate-*r/97.4%
Simplified97.4%
Final simplification95.4%
(FPCore (x y z) :precision binary64 (if (<= y 4e+132) (/ (* (/ x z) (/ y z)) (+ z 1.0)) (/ (* (/ x z) (/ y (+ z 1.0))) z)))
double code(double x, double y, double z) {
double tmp;
if (y <= 4e+132) {
tmp = ((x / z) * (y / z)) / (z + 1.0);
} else {
tmp = ((x / z) * (y / (z + 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 <= 4d+132) then
tmp = ((x / z) * (y / z)) / (z + 1.0d0)
else
tmp = ((x / z) * (y / (z + 1.0d0))) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 4e+132) {
tmp = ((x / z) * (y / z)) / (z + 1.0);
} else {
tmp = ((x / z) * (y / (z + 1.0))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 4e+132: tmp = ((x / z) * (y / z)) / (z + 1.0) else: tmp = ((x / z) * (y / (z + 1.0))) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= 4e+132) tmp = Float64(Float64(Float64(x / z) * Float64(y / z)) / Float64(z + 1.0)); else tmp = Float64(Float64(Float64(x / z) * Float64(y / Float64(z + 1.0))) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 4e+132) tmp = ((x / z) * (y / z)) / (z + 1.0); else tmp = ((x / z) * (y / (z + 1.0))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 4e+132], N[(N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / z), $MachinePrecision] * N[(y / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4 \cdot 10^{+132}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot \frac{y}{z}}{z + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot \frac{y}{z + 1}}{z}\\
\end{array}
\end{array}
if y < 3.99999999999999996e132Initial program 84.3%
associate-*l*84.3%
times-frac96.2%
distribute-lft-in96.2%
fma-def96.2%
*-rgt-identity96.2%
Simplified96.2%
fma-udef96.2%
*-rgt-identity96.2%
distribute-lft-in96.2%
times-frac84.3%
associate-*l*84.3%
associate-/r*87.2%
times-frac97.2%
Applied egg-rr97.2%
if 3.99999999999999996e132 < y Initial program 86.5%
associate-*l*86.5%
times-frac78.0%
distribute-lft-in78.0%
fma-def78.0%
*-rgt-identity78.0%
Simplified78.0%
*-commutative78.0%
associate-*l/88.1%
fma-udef88.1%
distribute-lft1-in88.1%
frac-times93.1%
associate-*r/97.9%
Applied egg-rr97.9%
Final simplification97.3%
(FPCore (x y z)
:precision binary64
(if (<= z -1e-310)
(/ (- y) (/ z x))
(if (or (<= z 3.65e+139) (not (<= z 1.8e+232)))
(* y (/ x z))
(/ (- x) (/ z y)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1e-310) {
tmp = -y / (z / x);
} else if ((z <= 3.65e+139) || !(z <= 1.8e+232)) {
tmp = y * (x / z);
} else {
tmp = -x / (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) :: tmp
if (z <= (-1d-310)) then
tmp = -y / (z / x)
else if ((z <= 3.65d+139) .or. (.not. (z <= 1.8d+232))) then
tmp = y * (x / z)
else
tmp = -x / (z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1e-310) {
tmp = -y / (z / x);
} else if ((z <= 3.65e+139) || !(z <= 1.8e+232)) {
tmp = y * (x / z);
} else {
tmp = -x / (z / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1e-310: tmp = -y / (z / x) elif (z <= 3.65e+139) or not (z <= 1.8e+232): tmp = y * (x / z) else: tmp = -x / (z / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1e-310) tmp = Float64(Float64(-y) / Float64(z / x)); elseif ((z <= 3.65e+139) || !(z <= 1.8e+232)) tmp = Float64(y * Float64(x / z)); else tmp = Float64(Float64(-x) / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1e-310) tmp = -y / (z / x); elseif ((z <= 3.65e+139) || ~((z <= 1.8e+232))) tmp = y * (x / z); else tmp = -x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1e-310], N[((-y) / N[(z / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 3.65e+139], N[Not[LessEqual[z, 1.8e+232]], $MachinePrecision]], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[((-x) / N[(z / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{-y}{\frac{z}{x}}\\
\mathbf{elif}\;z \leq 3.65 \cdot 10^{+139} \lor \neg \left(z \leq 1.8 \cdot 10^{+232}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\frac{z}{y}}\\
\end{array}
\end{array}
if z < -9.999999999999969e-311Initial program 85.8%
associate-*r/83.6%
associate-*l*83.6%
distribute-lft-in83.6%
fma-def83.6%
*-rgt-identity83.6%
Simplified83.6%
Taylor expanded in z around 0 63.0%
+-commutative63.0%
mul-1-neg63.0%
unsub-neg63.0%
unpow263.0%
associate-/r*65.8%
Simplified65.8%
Taylor expanded in z around inf 37.3%
associate-*r/37.3%
neg-mul-137.3%
distribute-lft-neg-in37.3%
associate-*l/44.1%
*-commutative44.1%
Simplified44.1%
*-commutative44.1%
distribute-frac-neg44.1%
distribute-lft-neg-out44.1%
associate-*l/37.3%
associate-/l*42.7%
Applied egg-rr42.7%
if -9.999999999999969e-311 < z < 3.64999999999999989e139 or 1.79999999999999996e232 < z Initial program 84.5%
associate-*r/85.2%
associate-*l*85.2%
distribute-lft-in85.2%
fma-def85.2%
*-rgt-identity85.2%
Simplified85.2%
Taylor expanded in z around 0 48.8%
+-commutative48.8%
mul-1-neg48.8%
unsub-neg48.8%
unpow248.8%
associate-/r*53.1%
Simplified53.1%
Taylor expanded in z around inf 16.6%
associate-*r/16.6%
neg-mul-116.6%
distribute-lft-neg-in16.6%
associate-*l/17.5%
*-commutative17.5%
Simplified17.5%
add-sqr-sqrt9.7%
sqrt-unprod30.8%
sqr-neg30.8%
sqrt-unprod21.9%
add-sqr-sqrt43.4%
associate-*r/39.7%
*-commutative39.7%
associate-/l*43.7%
Applied egg-rr43.7%
associate-/l*39.7%
*-commutative39.7%
associate-*l/42.8%
Applied egg-rr42.8%
if 3.64999999999999989e139 < z < 1.79999999999999996e232Initial program 75.0%
associate-*r/76.6%
associate-*l*76.6%
distribute-lft-in76.6%
fma-def76.6%
*-rgt-identity76.6%
Simplified76.6%
Taylor expanded in z around 0 46.2%
+-commutative46.2%
mul-1-neg46.2%
unsub-neg46.2%
unpow246.2%
associate-/r*46.2%
Simplified46.2%
Taylor expanded in z around inf 38.4%
associate-*r/38.4%
neg-mul-138.4%
distribute-lft-neg-in38.4%
associate-*l/46.2%
*-commutative46.2%
Simplified46.2%
Taylor expanded in x around 0 38.4%
mul-1-neg38.4%
*-commutative38.4%
associate-*l/44.5%
associate-/r/52.1%
Simplified52.1%
Final simplification43.3%
(FPCore (x y z) :precision binary64 (/ (* (/ x z) (/ y z)) (+ z 1.0)))
double code(double x, double y, double z) {
return ((x / z) * (y / 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 / z) * (y / z)) / (z + 1.0d0)
end function
public static double code(double x, double y, double z) {
return ((x / z) * (y / z)) / (z + 1.0);
}
def code(x, y, z): return ((x / z) * (y / z)) / (z + 1.0)
function code(x, y, z) return Float64(Float64(Float64(x / z) * Float64(y / z)) / Float64(z + 1.0)) end
function tmp = code(x, y, z) tmp = ((x / z) * (y / z)) / (z + 1.0); end
code[x_, y_, z_] := N[(N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{z} \cdot \frac{y}{z}}{z + 1}
\end{array}
Initial program 84.6%
associate-*l*84.6%
times-frac93.6%
distribute-lft-in93.6%
fma-def93.6%
*-rgt-identity93.6%
Simplified93.6%
fma-udef93.6%
*-rgt-identity93.6%
distribute-lft-in93.6%
times-frac84.6%
associate-*l*84.6%
associate-/r*87.5%
times-frac95.9%
Applied egg-rr95.9%
Final simplification95.9%
(FPCore (x y z) :precision binary64 (if (<= y 4.5e+65) (* (/ x z) (/ y z)) (* y (/ x (* z z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 4.5e+65) {
tmp = (x / z) * (y / 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 (y <= 4.5d+65) then
tmp = (x / z) * (y / 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 (y <= 4.5e+65) {
tmp = (x / z) * (y / z);
} else {
tmp = y * (x / (z * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 4.5e+65: tmp = (x / z) * (y / z) else: tmp = y * (x / (z * z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 4.5e+65) tmp = Float64(Float64(x / z) * Float64(y / 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 (y <= 4.5e+65) tmp = (x / z) * (y / z); else tmp = y * (x / (z * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 4.5e+65], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.5 \cdot 10^{+65}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if y < 4.5e65Initial program 84.4%
associate-*l*84.4%
times-frac96.0%
distribute-lft-in96.1%
fma-def96.1%
*-rgt-identity96.1%
Simplified96.1%
Taylor expanded in z around 0 72.2%
unpow272.2%
associate-/l/73.8%
associate-*r/75.5%
associate-*l/77.8%
Simplified77.8%
if 4.5e65 < y Initial program 85.6%
times-frac86.3%
Simplified86.3%
Taylor expanded in z around 0 80.7%
Final simplification78.3%
(FPCore (x y z) :precision binary64 (if (<= y 1.85e-78) (/ x (* z (/ z y))) (/ y (* z (/ z x)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.85e-78) {
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.85d-78) 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.85e-78) {
tmp = x / (z * (z / y));
} else {
tmp = y / (z * (z / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.85e-78: tmp = x / (z * (z / y)) else: tmp = y / (z * (z / x)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.85e-78) 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.85e-78) tmp = x / (z * (z / y)); else tmp = y / (z * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.85e-78], 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.85 \cdot 10^{-78}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if y < 1.85000000000000003e-78Initial program 85.6%
/-rgt-identity85.6%
associate-/l*85.5%
associate-/l/87.4%
associate-*l*89.0%
associate-*r/89.1%
*-rgt-identity89.1%
associate-*l*93.7%
associate-*r/93.7%
distribute-lft-in93.7%
fma-def93.7%
*-rgt-identity93.7%
Simplified93.7%
Taylor expanded in z around 0 78.7%
if 1.85000000000000003e-78 < y Initial program 82.7%
associate-*l*82.7%
times-frac90.2%
distribute-lft-in90.2%
fma-def90.2%
*-rgt-identity90.2%
Simplified90.2%
Taylor expanded in z around 0 72.4%
unpow272.4%
associate-/l*75.0%
associate-/l*80.5%
Simplified80.5%
associate-/r/80.4%
Applied egg-rr80.4%
Final simplification79.3%
(FPCore (x y z) :precision binary64 (if (<= y 2.4e-78) (/ x (* z (/ z y))) (/ y (/ z (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 2.4e-78) {
tmp = x / (z * (z / y));
} else {
tmp = y / (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 (y <= 2.4d-78) then
tmp = x / (z * (z / y))
else
tmp = y / (z / (x / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 2.4e-78) {
tmp = x / (z * (z / y));
} else {
tmp = y / (z / (x / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 2.4e-78: tmp = x / (z * (z / y)) else: tmp = y / (z / (x / z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 2.4e-78) tmp = Float64(x / Float64(z * Float64(z / y))); else tmp = Float64(y / Float64(z / Float64(x / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 2.4e-78) tmp = x / (z * (z / y)); else tmp = y / (z / (x / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 2.4e-78], N[(x / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4 \cdot 10^{-78}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{\frac{x}{z}}}\\
\end{array}
\end{array}
if y < 2.4e-78Initial program 85.6%
/-rgt-identity85.6%
associate-/l*85.5%
associate-/l/87.4%
associate-*l*89.0%
associate-*r/89.1%
*-rgt-identity89.1%
associate-*l*93.7%
associate-*r/93.7%
distribute-lft-in93.7%
fma-def93.7%
*-rgt-identity93.7%
Simplified93.7%
Taylor expanded in z around 0 78.7%
if 2.4e-78 < y Initial program 82.7%
associate-*l*82.7%
times-frac90.2%
distribute-lft-in90.2%
fma-def90.2%
*-rgt-identity90.2%
Simplified90.2%
Taylor expanded in z around 0 72.4%
unpow272.4%
associate-/l*75.0%
associate-/l*80.5%
Simplified80.5%
Final simplification79.3%
(FPCore (x y z) :precision binary64 (if (<= y 7.5e-174) (* x (/ y z)) (/ y (/ z x))))
double code(double x, double y, double z) {
double tmp;
if (y <= 7.5e-174) {
tmp = x * (y / z);
} else {
tmp = y / (z / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= 7.5d-174) then
tmp = x * (y / z)
else
tmp = y / (z / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 7.5e-174) {
tmp = x * (y / z);
} else {
tmp = y / (z / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 7.5e-174: tmp = x * (y / z) else: tmp = y / (z / x) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 7.5e-174) tmp = Float64(x * Float64(y / z)); else tmp = Float64(y / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 7.5e-174) tmp = x * (y / z); else tmp = y / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 7.5e-174], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.5 \cdot 10^{-174}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if y < 7.5000000000000003e-174Initial program 86.0%
associate-*r/88.1%
associate-*l*88.1%
distribute-lft-in88.1%
fma-def88.1%
*-rgt-identity88.1%
Simplified88.1%
Taylor expanded in z around 0 58.0%
+-commutative58.0%
mul-1-neg58.0%
unsub-neg58.0%
unpow258.0%
associate-/r*60.9%
Simplified60.9%
Taylor expanded in z around inf 30.2%
associate-*r/30.2%
neg-mul-130.2%
distribute-lft-neg-in30.2%
associate-*l/36.7%
*-commutative36.7%
Simplified36.7%
add-sqr-sqrt30.9%
sqrt-unprod37.1%
sqr-neg37.1%
sqrt-unprod5.7%
add-sqr-sqrt32.2%
associate-*r/26.3%
*-commutative26.3%
associate-/l*30.7%
Applied egg-rr30.7%
associate-/r/32.2%
Applied egg-rr32.2%
if 7.5000000000000003e-174 < y Initial program 82.6%
associate-*r/77.7%
associate-*l*77.7%
distribute-lft-in77.7%
fma-def77.7%
*-rgt-identity77.7%
Simplified77.7%
Taylor expanded in z around 0 54.0%
+-commutative54.0%
mul-1-neg54.0%
unsub-neg54.0%
unpow254.0%
associate-/r*57.6%
Simplified57.6%
Taylor expanded in z around inf 27.7%
associate-*r/27.7%
neg-mul-127.7%
distribute-lft-neg-in27.7%
associate-*l/29.6%
*-commutative29.6%
Simplified29.6%
add-sqr-sqrt0.0%
sqrt-unprod28.1%
sqr-neg28.1%
sqrt-unprod29.9%
add-sqr-sqrt29.9%
associate-*r/29.9%
*-commutative29.9%
associate-/l*33.7%
Applied egg-rr33.7%
Final simplification32.8%
(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 84.6%
times-frac87.4%
Simplified87.4%
Taylor expanded in z around 0 74.6%
Final simplification74.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}
\\
y \cdot \frac{x}{z}
\end{array}
Initial program 84.6%
associate-*r/83.8%
associate-*l*83.8%
distribute-lft-in83.8%
fma-def83.8%
*-rgt-identity83.8%
Simplified83.8%
Taylor expanded in z around 0 56.4%
+-commutative56.4%
mul-1-neg56.4%
unsub-neg56.4%
unpow256.4%
associate-/r*59.5%
Simplified59.5%
Taylor expanded in z around inf 29.2%
associate-*r/29.2%
neg-mul-129.2%
distribute-lft-neg-in29.2%
associate-*l/33.7%
*-commutative33.7%
Simplified33.7%
add-sqr-sqrt18.0%
sqrt-unprod33.3%
sqr-neg33.3%
sqrt-unprod15.8%
add-sqr-sqrt31.2%
associate-*r/27.8%
*-commutative27.8%
associate-/l*31.9%
Applied egg-rr31.9%
associate-/l*27.8%
*-commutative27.8%
associate-*l/30.8%
Applied egg-rr30.8%
Final simplification30.8%
(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 2023174
(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))))