
(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 17 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))))
(if (<= t_0 -1e+20)
(/ (/ y z) (* z (/ z x)))
(if (<= t_0 5e-153)
(/ (/ x z) (/ z y))
(if (<= t_0 2e+140)
(/ (* x y) t_0)
(/ 1.0 (* z (* (/ z x) (/ z y)))))))))
double code(double x, double y, double z) {
double t_0 = (z + 1.0) * (z * z);
double tmp;
if (t_0 <= -1e+20) {
tmp = (y / z) / (z * (z / x));
} else if (t_0 <= 5e-153) {
tmp = (x / z) / (z / y);
} else if (t_0 <= 2e+140) {
tmp = (x * y) / t_0;
} else {
tmp = 1.0 / (z * ((z / 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) :: t_0
real(8) :: tmp
t_0 = (z + 1.0d0) * (z * z)
if (t_0 <= (-1d+20)) then
tmp = (y / z) / (z * (z / x))
else if (t_0 <= 5d-153) then
tmp = (x / z) / (z / y)
else if (t_0 <= 2d+140) then
tmp = (x * y) / t_0
else
tmp = 1.0d0 / (z * ((z / x) * (z / y)))
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 tmp;
if (t_0 <= -1e+20) {
tmp = (y / z) / (z * (z / x));
} else if (t_0 <= 5e-153) {
tmp = (x / z) / (z / y);
} else if (t_0 <= 2e+140) {
tmp = (x * y) / t_0;
} else {
tmp = 1.0 / (z * ((z / x) * (z / y)));
}
return tmp;
}
def code(x, y, z): t_0 = (z + 1.0) * (z * z) tmp = 0 if t_0 <= -1e+20: tmp = (y / z) / (z * (z / x)) elif t_0 <= 5e-153: tmp = (x / z) / (z / y) elif t_0 <= 2e+140: tmp = (x * y) / t_0 else: tmp = 1.0 / (z * ((z / x) * (z / y))) return tmp
function code(x, y, z) t_0 = Float64(Float64(z + 1.0) * Float64(z * z)) tmp = 0.0 if (t_0 <= -1e+20) tmp = Float64(Float64(y / z) / Float64(z * Float64(z / x))); elseif (t_0 <= 5e-153) tmp = Float64(Float64(x / z) / Float64(z / y)); elseif (t_0 <= 2e+140) tmp = Float64(Float64(x * y) / t_0); else tmp = Float64(1.0 / Float64(z * Float64(Float64(z / x) * Float64(z / y)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z + 1.0) * (z * z); tmp = 0.0; if (t_0 <= -1e+20) tmp = (y / z) / (z * (z / x)); elseif (t_0 <= 5e-153) tmp = (x / z) / (z / y); elseif (t_0 <= 2e+140) tmp = (x * y) / t_0; else tmp = 1.0 / (z * ((z / x) * (z / y))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z + 1.0), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+20], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-153], N[(N[(x / z), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+140], N[(N[(x * y), $MachinePrecision] / t$95$0), $MachinePrecision], N[(1.0 / N[(z * N[(N[(z / x), $MachinePrecision] * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(z + 1\right) \cdot \left(z \cdot z\right)\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{+20}:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{-153}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{z}{y}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+140}:\\
\;\;\;\;\frac{x \cdot y}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \left(\frac{z}{x} \cdot \frac{z}{y}\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 z z) (+.f64 z 1)) < -1e20Initial program 81.6%
associate-*l*81.6%
times-frac93.6%
distribute-lft-in93.6%
fma-def93.6%
*-rgt-identity93.6%
Simplified93.6%
Taylor expanded in z around inf 92.9%
unpow292.9%
associate-/r*96.9%
Simplified96.9%
clear-num96.9%
frac-times99.1%
*-un-lft-identity99.1%
Applied egg-rr99.1%
if -1e20 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 5.00000000000000033e-153Initial program 82.0%
associate-*l*82.0%
times-frac98.8%
distribute-lft-in98.8%
fma-def98.8%
*-rgt-identity98.8%
Simplified98.8%
Taylor expanded in z around 0 98.8%
clear-num98.8%
un-div-inv98.9%
Applied egg-rr98.9%
if 5.00000000000000033e-153 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 2.00000000000000012e140Initial program 99.6%
if 2.00000000000000012e140 < (*.f64 (*.f64 z z) (+.f64 z 1)) Initial program 86.4%
/-rgt-identity86.4%
associate-/l*86.4%
associate-/l/84.7%
associate-*l*86.9%
associate-*r/87.0%
*-rgt-identity87.0%
associate-*l*89.1%
associate-*r/87.0%
distribute-lft-in87.0%
fma-def87.0%
*-rgt-identity87.0%
Simplified87.0%
Taylor expanded in z around inf 87.0%
unpow287.0%
Simplified87.0%
associate-/r*89.0%
add-cube-cbrt88.8%
*-un-lft-identity88.8%
times-frac88.9%
pow288.9%
div-inv88.9%
associate-*l*95.3%
div-inv95.3%
Applied egg-rr95.3%
times-frac95.2%
*-lft-identity95.2%
unpow295.2%
rem-3cbrt-lft95.5%
Simplified95.5%
associate-/r*97.8%
associate-/r/93.4%
associate-/l/91.2%
Applied egg-rr91.2%
associate-*l/91.3%
associate-/r*97.8%
associate-/r/99.9%
clear-num99.8%
associate-/l/99.9%
div-inv99.8%
clear-num99.8%
Applied egg-rr99.8%
Final simplification99.2%
(FPCore (x y z)
:precision binary64
(if (<= z -1.0)
(/ (/ y z) (* z (/ z x)))
(if (<= z 0.75)
(* (/ x z) (- (/ y z) y))
(/ 1.0 (* z (* (/ z x) (/ z y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (y / z) / (z * (z / x));
} else if (z <= 0.75) {
tmp = (x / z) * ((y / z) - y);
} else {
tmp = 1.0 / (z * ((z / 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 <= (-1.0d0)) then
tmp = (y / z) / (z * (z / x))
else if (z <= 0.75d0) then
tmp = (x / z) * ((y / z) - y)
else
tmp = 1.0d0 / (z * ((z / x) * (z / y)))
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 <= 0.75) {
tmp = (x / z) * ((y / z) - y);
} else {
tmp = 1.0 / (z * ((z / x) * (z / y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (y / z) / (z * (z / x)) elif z <= 0.75: tmp = (x / z) * ((y / z) - y) else: tmp = 1.0 / (z * ((z / x) * (z / y))) 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 <= 0.75) tmp = Float64(Float64(x / z) * Float64(Float64(y / z) - y)); else tmp = Float64(1.0 / Float64(z * Float64(Float64(z / x) * Float64(z / y)))); 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 <= 0.75) tmp = (x / z) * ((y / z) - y); else tmp = 1.0 / (z * ((z / x) * (z / y))); 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, 0.75], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(z * N[(N[(z / x), $MachinePrecision] * N[(z / y), $MachinePrecision]), $MachinePrecision]), $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 0.75:\\
\;\;\;\;\frac{x}{z} \cdot \left(\frac{y}{z} - y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \left(\frac{z}{x} \cdot \frac{z}{y}\right)}\\
\end{array}
\end{array}
if z < -1Initial program 81.6%
associate-*l*81.6%
times-frac93.6%
distribute-lft-in93.6%
fma-def93.6%
*-rgt-identity93.6%
Simplified93.6%
Taylor expanded in z around inf 92.9%
unpow292.9%
associate-/r*96.9%
Simplified96.9%
clear-num96.9%
frac-times99.1%
*-un-lft-identity99.1%
Applied egg-rr99.1%
if -1 < z < 0.75Initial program 86.7%
associate-*l*86.8%
times-frac97.6%
distribute-lft-in97.6%
fma-def97.6%
*-rgt-identity97.6%
Simplified97.6%
Taylor expanded in z around 0 97.6%
neg-mul-197.6%
+-commutative97.6%
unsub-neg97.6%
Simplified97.6%
if 0.75 < z Initial program 88.9%
/-rgt-identity88.9%
associate-/l*88.9%
associate-/l/87.5%
associate-*l*89.4%
associate-*r/89.4%
*-rgt-identity89.4%
associate-*l*91.1%
associate-*r/89.4%
distribute-lft-in89.4%
fma-def89.4%
*-rgt-identity89.4%
Simplified89.4%
Taylor expanded in z around inf 87.1%
unpow287.1%
Simplified87.1%
associate-/r*88.1%
add-cube-cbrt87.9%
*-un-lft-identity87.9%
times-frac87.9%
pow287.9%
div-inv88.0%
associate-*l*93.1%
div-inv93.1%
Applied egg-rr93.1%
times-frac93.0%
*-lft-identity93.0%
unpow293.0%
rem-3cbrt-lft93.4%
Simplified93.4%
associate-/r*94.1%
associate-/r/90.5%
associate-/l/88.8%
Applied egg-rr88.8%
associate-*l/88.9%
associate-/r*94.1%
associate-/r/96.9%
clear-num96.8%
associate-/l/96.9%
div-inv95.8%
clear-num95.8%
Applied egg-rr95.8%
Final simplification97.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 0.75))) (* (/ x z) (/ y (* z z))) (* (/ x z) (- (/ y z) y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 0.75)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = (x / z) * ((y / 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 <= (-1.0d0)) .or. (.not. (z <= 0.75d0))) then
tmp = (x / z) * (y / (z * z))
else
tmp = (x / z) * ((y / z) - y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 0.75)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = (x / z) * ((y / z) - y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 0.75): tmp = (x / z) * (y / (z * z)) else: tmp = (x / z) * ((y / z) - y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 0.75)) tmp = Float64(Float64(x / z) * Float64(y / Float64(z * z))); else tmp = Float64(Float64(x / z) * Float64(Float64(y / z) - y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 0.75))) tmp = (x / z) * (y / (z * z)); else tmp = (x / z) * ((y / z) - y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 0.75]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 0.75\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(\frac{y}{z} - y\right)\\
\end{array}
\end{array}
if z < -1 or 0.75 < z Initial program 84.8%
associate-*l*84.8%
times-frac92.2%
distribute-lft-in92.2%
fma-def92.2%
*-rgt-identity92.2%
Simplified92.2%
Taylor expanded in z around inf 90.9%
unpow290.9%
Simplified90.9%
if -1 < z < 0.75Initial program 86.7%
associate-*l*86.8%
times-frac97.6%
distribute-lft-in97.6%
fma-def97.6%
*-rgt-identity97.6%
Simplified97.6%
Taylor expanded in z around 0 97.6%
neg-mul-197.6%
+-commutative97.6%
unsub-neg97.6%
Simplified97.6%
Final simplification94.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 0.75))) (* (/ x z) (/ (/ y z) z)) (* (/ x z) (- (/ y z) y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 0.75)) {
tmp = (x / z) * ((y / z) / z);
} else {
tmp = (x / z) * ((y / 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 <= (-1.0d0)) .or. (.not. (z <= 0.75d0))) then
tmp = (x / z) * ((y / z) / z)
else
tmp = (x / z) * ((y / z) - y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 0.75)) {
tmp = (x / z) * ((y / z) / z);
} else {
tmp = (x / z) * ((y / z) - y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 0.75): tmp = (x / z) * ((y / z) / z) else: tmp = (x / z) * ((y / z) - y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 0.75)) tmp = Float64(Float64(x / z) * Float64(Float64(y / z) / z)); else tmp = Float64(Float64(x / z) * Float64(Float64(y / z) - y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 0.75))) tmp = (x / z) * ((y / z) / z); else tmp = (x / z) * ((y / z) - y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 0.75]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 0.75\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(\frac{y}{z} - y\right)\\
\end{array}
\end{array}
if z < -1 or 0.75 < z Initial program 84.8%
associate-*l*84.8%
times-frac92.2%
distribute-lft-in92.2%
fma-def92.2%
*-rgt-identity92.2%
Simplified92.2%
Taylor expanded in z around inf 90.9%
unpow290.9%
associate-/r*95.4%
Simplified95.4%
if -1 < z < 0.75Initial program 86.7%
associate-*l*86.8%
times-frac97.6%
distribute-lft-in97.6%
fma-def97.6%
*-rgt-identity97.6%
Simplified97.6%
Taylor expanded in z around 0 97.6%
neg-mul-197.6%
+-commutative97.6%
unsub-neg97.6%
Simplified97.6%
Final simplification96.6%
(FPCore (x y z) :precision binary64 (if (<= z -1.0) (* (/ y z) (/ (/ x z) z)) (if (<= z 0.76) (* (/ x z) (- (/ y z) y)) (* (/ x z) (/ (/ y z) z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (y / z) * ((x / z) / z);
} else if (z <= 0.76) {
tmp = (x / z) * ((y / z) - y);
} else {
tmp = (x / z) * ((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)) then
tmp = (y / z) * ((x / z) / z)
else if (z <= 0.76d0) then
tmp = (x / z) * ((y / z) - y)
else
tmp = (x / z) * ((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) {
tmp = (y / z) * ((x / z) / z);
} else if (z <= 0.76) {
tmp = (x / z) * ((y / z) - y);
} else {
tmp = (x / z) * ((y / z) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (y / z) * ((x / z) / z) elif z <= 0.76: tmp = (x / z) * ((y / z) - y) else: tmp = (x / z) * ((y / z) / z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(y / z) * Float64(Float64(x / z) / z)); elseif (z <= 0.76) tmp = Float64(Float64(x / z) * Float64(Float64(y / z) - y)); else tmp = Float64(Float64(x / z) * Float64(Float64(y / z) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.0) tmp = (y / z) * ((x / z) / z); elseif (z <= 0.76) tmp = (x / z) * ((y / z) - y); else tmp = (x / z) * ((y / z) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(N[(y / z), $MachinePrecision] * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.76], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{y}{z} \cdot \frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq 0.76:\\
\;\;\;\;\frac{x}{z} \cdot \left(\frac{y}{z} - y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z}}{z}\\
\end{array}
\end{array}
if z < -1Initial program 81.6%
/-rgt-identity81.6%
associate-/l*81.7%
associate-/l/88.8%
associate-*l*91.5%
associate-*r/91.5%
*-rgt-identity91.5%
associate-*l*91.5%
associate-*r/91.6%
distribute-lft-in91.6%
fma-def91.6%
*-rgt-identity91.6%
Simplified91.6%
Taylor expanded in z around inf 90.9%
unpow290.9%
Simplified90.9%
associate-/r*93.0%
associate-/l*96.6%
associate-/r/99.0%
Applied egg-rr99.0%
if -1 < z < 0.76000000000000001Initial program 86.7%
associate-*l*86.8%
times-frac97.6%
distribute-lft-in97.6%
fma-def97.6%
*-rgt-identity97.6%
Simplified97.6%
Taylor expanded in z around 0 97.6%
neg-mul-197.6%
+-commutative97.6%
unsub-neg97.6%
Simplified97.6%
if 0.76000000000000001 < z Initial program 88.9%
associate-*l*88.9%
times-frac90.4%
distribute-lft-in90.4%
fma-def90.4%
*-rgt-identity90.4%
Simplified90.4%
Taylor expanded in z around inf 88.2%
unpow288.2%
associate-/r*93.4%
Simplified93.4%
Final simplification97.1%
(FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ (/ y z) (* z (/ z x))) (if (<= z 0.75) (* (/ x z) (- (/ y z) y)) (* (/ x z) (/ (/ y 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 <= 0.75) {
tmp = (x / z) * ((y / z) - y);
} else {
tmp = (x / z) * ((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)) then
tmp = (y / z) / (z * (z / x))
else if (z <= 0.75d0) then
tmp = (x / z) * ((y / z) - y)
else
tmp = (x / z) * ((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) {
tmp = (y / z) / (z * (z / x));
} else if (z <= 0.75) {
tmp = (x / z) * ((y / z) - y);
} else {
tmp = (x / z) * ((y / z) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (y / z) / (z * (z / x)) elif z <= 0.75: tmp = (x / z) * ((y / z) - y) else: tmp = (x / z) * ((y / 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 <= 0.75) tmp = Float64(Float64(x / z) * Float64(Float64(y / z) - y)); else tmp = Float64(Float64(x / z) * Float64(Float64(y / 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 <= 0.75) tmp = (x / z) * ((y / z) - y); else tmp = (x / z) * ((y / 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, 0.75], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / 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 0.75:\\
\;\;\;\;\frac{x}{z} \cdot \left(\frac{y}{z} - y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z}}{z}\\
\end{array}
\end{array}
if z < -1Initial program 81.6%
associate-*l*81.6%
times-frac93.6%
distribute-lft-in93.6%
fma-def93.6%
*-rgt-identity93.6%
Simplified93.6%
Taylor expanded in z around inf 92.9%
unpow292.9%
associate-/r*96.9%
Simplified96.9%
clear-num96.9%
frac-times99.1%
*-un-lft-identity99.1%
Applied egg-rr99.1%
if -1 < z < 0.75Initial program 86.7%
associate-*l*86.8%
times-frac97.6%
distribute-lft-in97.6%
fma-def97.6%
*-rgt-identity97.6%
Simplified97.6%
Taylor expanded in z around 0 97.6%
neg-mul-197.6%
+-commutative97.6%
unsub-neg97.6%
Simplified97.6%
if 0.75 < z Initial program 88.9%
associate-*l*88.9%
times-frac90.4%
distribute-lft-in90.4%
fma-def90.4%
*-rgt-identity90.4%
Simplified90.4%
Taylor expanded in z around inf 88.2%
unpow288.2%
associate-/r*93.4%
Simplified93.4%
Final simplification97.2%
(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 85.8%
associate-*l*85.8%
times-frac95.0%
distribute-lft-in95.0%
fma-def95.0%
*-rgt-identity95.0%
Simplified95.0%
fma-udef95.0%
*-rgt-identity95.0%
distribute-lft-in95.0%
times-frac85.8%
associate-*l*85.8%
associate-/r*86.8%
times-frac97.8%
Applied egg-rr97.8%
Final simplification97.8%
(FPCore (x y z) :precision binary64 (if (<= x -4.2e-157) (* x (/ (/ y z) z)) (* (/ x z) (/ y z))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.2e-157) {
tmp = x * ((y / z) / z);
} 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 (x <= (-4.2d-157)) then
tmp = x * ((y / z) / z)
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 (x <= -4.2e-157) {
tmp = x * ((y / z) / z);
} else {
tmp = (x / z) * (y / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.2e-157: tmp = x * ((y / z) / z) else: tmp = (x / z) * (y / z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.2e-157) tmp = Float64(x * Float64(Float64(y / z) / z)); else tmp = Float64(Float64(x / z) * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.2e-157) tmp = x * ((y / z) / z); else tmp = (x / z) * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.2e-157], N[(x * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{-157}:\\
\;\;\;\;x \cdot \frac{\frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\end{array}
\end{array}
if x < -4.2e-157Initial program 82.8%
associate-*l*82.8%
times-frac93.5%
distribute-lft-in93.4%
fma-def93.4%
*-rgt-identity93.4%
Simplified93.4%
Taylor expanded in z around 0 70.1%
Taylor expanded in x around 0 73.5%
*-commutative73.5%
unpow273.5%
associate-*r/74.9%
associate-/r*75.4%
Simplified75.4%
if -4.2e-157 < x Initial program 87.6%
associate-*l*87.6%
times-frac96.0%
distribute-lft-in96.0%
fma-def96.0%
*-rgt-identity96.0%
Simplified96.0%
Taylor expanded in z around 0 81.3%
Final simplification79.0%
(FPCore (x y z) :precision binary64 (if (<= y 2e+43) (* x (/ (/ y z) z)) (* y (/ x (* z z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 2e+43) {
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 (y <= 2d+43) 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 (y <= 2e+43) {
tmp = x * ((y / z) / z);
} else {
tmp = y * (x / (z * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 2e+43: tmp = x * ((y / z) / z) else: tmp = y * (x / (z * z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 2e+43) tmp = Float64(x * Float64(Float64(y / 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 (y <= 2e+43) tmp = x * ((y / z) / z); else tmp = y * (x / (z * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 2e+43], N[(x * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2 \cdot 10^{+43}:\\
\;\;\;\;x \cdot \frac{\frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if y < 2.00000000000000003e43Initial program 86.7%
associate-*l*86.7%
times-frac97.2%
distribute-lft-in97.2%
fma-def97.2%
*-rgt-identity97.2%
Simplified97.2%
Taylor expanded in z around 0 79.6%
Taylor expanded in x around 0 76.0%
*-commutative76.0%
unpow276.0%
associate-*r/75.2%
associate-/r*78.9%
Simplified78.9%
if 2.00000000000000003e43 < y Initial program 82.4%
times-frac89.0%
Simplified89.0%
Taylor expanded in z around 0 76.1%
Final simplification78.3%
(FPCore (x y z) :precision binary64 (if (<= x -1.02e-103) (* x (/ y (* z z))) (* (/ x z) (/ y z))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.02e-103) {
tmp = x * (y / (z * z));
} 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 (x <= (-1.02d-103)) then
tmp = x * (y / (z * z))
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 (x <= -1.02e-103) {
tmp = x * (y / (z * z));
} else {
tmp = (x / z) * (y / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.02e-103: tmp = x * (y / (z * z)) else: tmp = (x / z) * (y / z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.02e-103) tmp = Float64(x * Float64(y / Float64(z * z))); else tmp = Float64(Float64(x / z) * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.02e-103) tmp = x * (y / (z * z)); else tmp = (x / z) * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.02e-103], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{-103}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\end{array}
\end{array}
if x < -1.01999999999999998e-103Initial program 84.8%
associate-*l*84.8%
times-frac93.0%
distribute-lft-in93.0%
fma-def93.0%
*-rgt-identity93.0%
Simplified93.0%
Taylor expanded in z around 0 74.8%
unpow274.8%
associate-/l*77.2%
associate-/l*70.6%
associate-/r/70.6%
Simplified70.6%
associate-*l/77.2%
associate-/r/75.1%
Applied egg-rr75.1%
if -1.01999999999999998e-103 < x Initial program 86.4%
associate-*l*86.4%
times-frac96.1%
distribute-lft-in96.1%
fma-def96.1%
*-rgt-identity96.1%
Simplified96.1%
Taylor expanded in z around 0 82.0%
Final simplification79.6%
(FPCore (x y z) :precision binary64 (if (<= x -7e-28) (* x (/ y (* z z))) (/ y (* z (/ z x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -7e-28) {
tmp = x * (y / (z * z));
} 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 (x <= (-7d-28)) then
tmp = x * (y / (z * z))
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 (x <= -7e-28) {
tmp = x * (y / (z * z));
} else {
tmp = y / (z * (z / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -7e-28: tmp = x * (y / (z * z)) else: tmp = y / (z * (z / x)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -7e-28) tmp = Float64(x * Float64(y / Float64(z * z))); else tmp = Float64(y / Float64(z * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -7e-28) tmp = x * (y / (z * z)); else tmp = y / (z * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -7e-28], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{-28}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if x < -6.9999999999999999e-28Initial program 82.3%
associate-*l*82.3%
times-frac91.9%
distribute-lft-in91.8%
fma-def91.8%
*-rgt-identity91.8%
Simplified91.8%
Taylor expanded in z around 0 75.9%
unpow275.9%
associate-/l*77.5%
associate-/l*69.9%
associate-/r/69.9%
Simplified69.9%
associate-*l/77.5%
associate-/r/77.6%
Applied egg-rr77.6%
if -6.9999999999999999e-28 < x Initial program 87.3%
associate-*l*87.3%
times-frac96.4%
distribute-lft-in96.4%
fma-def96.4%
*-rgt-identity96.4%
Simplified96.4%
Taylor expanded in z around 0 74.9%
unpow274.9%
associate-/l*79.3%
associate-/l*83.9%
associate-/r/83.9%
Simplified83.9%
Final simplification82.0%
(FPCore (x y z) :precision binary64 (if (<= z -2e-310) (* x (- (/ y z))) (/ y (/ z x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2e-310) {
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 (z <= (-2d-310)) 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 (z <= -2e-310) {
tmp = x * -(y / z);
} else {
tmp = y / (z / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2e-310: tmp = x * -(y / z) else: tmp = y / (z / x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2e-310) tmp = Float64(x * Float64(-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 (z <= -2e-310) tmp = x * -(y / z); else tmp = y / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2e-310], N[(x * (-N[(y / z), $MachinePrecision])), $MachinePrecision], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-310}:\\
\;\;\;\;x \cdot \left(-\frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if z < -1.999999999999994e-310Initial program 84.1%
associate-*l*84.1%
times-frac95.9%
distribute-lft-in95.9%
fma-def95.9%
*-rgt-identity95.9%
Simplified95.9%
Taylor expanded in z around 0 68.6%
neg-mul-168.6%
+-commutative68.6%
unsub-neg68.6%
Simplified68.6%
Taylor expanded in z around inf 36.4%
mul-1-neg36.4%
*-commutative36.4%
associate-*r/41.3%
distribute-rgt-neg-in41.3%
Simplified41.3%
if -1.999999999999994e-310 < z Initial program 87.7%
associate-*l*87.8%
times-frac94.0%
distribute-lft-in94.0%
fma-def94.0%
*-rgt-identity94.0%
Simplified94.0%
Taylor expanded in z around 0 70.9%
neg-mul-170.9%
+-commutative70.9%
unsub-neg70.9%
Simplified70.9%
Taylor expanded in z around inf 15.9%
mul-1-neg15.9%
*-commutative15.9%
associate-*r/17.4%
distribute-rgt-neg-in17.4%
Simplified17.4%
expm1-log1p-u17.3%
expm1-udef29.2%
add-sqr-sqrt16.3%
sqrt-unprod42.0%
sqr-neg42.0%
sqrt-unprod27.6%
add-sqr-sqrt44.4%
clear-num44.4%
un-div-inv44.4%
Applied egg-rr44.4%
expm1-def32.8%
expm1-log1p43.6%
associate-/r/43.5%
*-commutative43.5%
Simplified43.5%
clear-num43.5%
un-div-inv42.7%
Applied egg-rr42.7%
Final simplification42.0%
(FPCore (x y z) :precision binary64 (if (<= z -2e-310) (- (* (/ x z) y)) (/ y (/ z x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2e-310) {
tmp = -((x / z) * y);
} 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 (z <= (-2d-310)) then
tmp = -((x / z) * y)
else
tmp = y / (z / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2e-310) {
tmp = -((x / z) * y);
} else {
tmp = y / (z / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2e-310: tmp = -((x / z) * y) else: tmp = y / (z / x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2e-310) tmp = Float64(-Float64(Float64(x / z) * y)); else tmp = Float64(y / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2e-310) tmp = -((x / z) * y); else tmp = y / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2e-310], (-N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]), N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-310}:\\
\;\;\;\;-\frac{x}{z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if z < -1.999999999999994e-310Initial program 84.1%
associate-*l*84.1%
times-frac95.9%
distribute-lft-in95.9%
fma-def95.9%
*-rgt-identity95.9%
Simplified95.9%
Taylor expanded in z around 0 68.6%
neg-mul-168.6%
+-commutative68.6%
unsub-neg68.6%
Simplified68.6%
Taylor expanded in z around inf 42.6%
neg-mul-142.6%
Simplified42.6%
if -1.999999999999994e-310 < z Initial program 87.7%
associate-*l*87.8%
times-frac94.0%
distribute-lft-in94.0%
fma-def94.0%
*-rgt-identity94.0%
Simplified94.0%
Taylor expanded in z around 0 70.9%
neg-mul-170.9%
+-commutative70.9%
unsub-neg70.9%
Simplified70.9%
Taylor expanded in z around inf 15.9%
mul-1-neg15.9%
*-commutative15.9%
associate-*r/17.4%
distribute-rgt-neg-in17.4%
Simplified17.4%
expm1-log1p-u17.3%
expm1-udef29.2%
add-sqr-sqrt16.3%
sqrt-unprod42.0%
sqr-neg42.0%
sqrt-unprod27.6%
add-sqr-sqrt44.4%
clear-num44.4%
un-div-inv44.4%
Applied egg-rr44.4%
expm1-def32.8%
expm1-log1p43.6%
associate-/r/43.5%
*-commutative43.5%
Simplified43.5%
clear-num43.5%
un-div-inv42.7%
Applied egg-rr42.7%
Final simplification42.7%
(FPCore (x y z) :precision binary64 (* x (/ (/ y z) z)))
double code(double x, double y, double z) {
return x * ((y / 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 = x * ((y / z) / z)
end function
public static double code(double x, double y, double z) {
return x * ((y / z) / z);
}
def code(x, y, z): return x * ((y / z) / z)
function code(x, y, z) return Float64(x * Float64(Float64(y / z) / z)) end
function tmp = code(x, y, z) tmp = x * ((y / z) / z); end
code[x_, y_, z_] := N[(x * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{\frac{y}{z}}{z}
\end{array}
Initial program 85.8%
associate-*l*85.8%
times-frac95.0%
distribute-lft-in95.0%
fma-def95.0%
*-rgt-identity95.0%
Simplified95.0%
Taylor expanded in z around 0 77.0%
Taylor expanded in x around 0 75.2%
*-commutative75.2%
unpow275.2%
associate-*r/73.6%
associate-/r*76.1%
Simplified76.1%
Final simplification76.1%
(FPCore (x y z) :precision binary64 (* (/ x z) y))
double code(double x, double y, double z) {
return (x / z) * y;
}
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
end function
public static double code(double x, double y, double z) {
return (x / z) * y;
}
def code(x, y, z): return (x / z) * y
function code(x, y, z) return Float64(Float64(x / z) * y) end
function tmp = code(x, y, z) tmp = (x / z) * y; end
code[x_, y_, z_] := N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{z} \cdot y
\end{array}
Initial program 85.8%
associate-*l*85.8%
times-frac95.0%
distribute-lft-in95.0%
fma-def95.0%
*-rgt-identity95.0%
Simplified95.0%
Taylor expanded in z around 0 69.7%
neg-mul-169.7%
+-commutative69.7%
unsub-neg69.7%
Simplified69.7%
Taylor expanded in z around inf 26.8%
mul-1-neg26.8%
*-commutative26.8%
associate-*r/30.1%
distribute-rgt-neg-in30.1%
Simplified30.1%
expm1-log1p-u26.9%
expm1-udef37.3%
add-sqr-sqrt23.3%
sqrt-unprod39.2%
sqr-neg39.2%
sqrt-unprod23.4%
add-sqr-sqrt37.6%
clear-num37.6%
un-div-inv37.6%
Applied egg-rr37.6%
expm1-def27.5%
expm1-log1p32.8%
associate-/r/32.0%
*-commutative32.0%
Simplified32.0%
Final simplification32.0%
(FPCore (x y z) :precision binary64 (* x (/ y z)))
double code(double x, double y, double z) {
return x * (y / z);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (y / z)
end function
public static double code(double x, double y, double z) {
return x * (y / z);
}
def code(x, y, z): return x * (y / z)
function code(x, y, z) return Float64(x * Float64(y / z)) end
function tmp = code(x, y, z) tmp = x * (y / z); end
code[x_, y_, z_] := N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y}{z}
\end{array}
Initial program 85.8%
associate-*l*85.8%
times-frac95.0%
distribute-lft-in95.0%
fma-def95.0%
*-rgt-identity95.0%
Simplified95.0%
Taylor expanded in z around 0 69.7%
neg-mul-169.7%
+-commutative69.7%
unsub-neg69.7%
Simplified69.7%
Taylor expanded in z around inf 26.8%
mul-1-neg26.8%
*-commutative26.8%
associate-*r/30.1%
distribute-rgt-neg-in30.1%
Simplified30.1%
*-commutative30.1%
distribute-neg-frac30.1%
associate-*l/26.8%
Applied egg-rr26.8%
associate-/l*31.8%
associate-/r/30.1%
add-sqr-sqrt14.2%
sqrt-unprod31.5%
sqr-neg31.5%
sqrt-unprod17.3%
add-sqr-sqrt32.5%
Applied egg-rr32.5%
Final simplification32.5%
(FPCore (x y z) :precision binary64 (/ x (/ z y)))
double code(double x, double y, double z) {
return x / (z / y);
}
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)
end function
public static double code(double x, double y, double z) {
return x / (z / y);
}
def code(x, y, z): return x / (z / y)
function code(x, y, z) return Float64(x / Float64(z / y)) end
function tmp = code(x, y, z) tmp = x / (z / y); end
code[x_, y_, z_] := N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{z}{y}}
\end{array}
Initial program 85.8%
associate-*l*85.8%
times-frac95.0%
distribute-lft-in95.0%
fma-def95.0%
*-rgt-identity95.0%
Simplified95.0%
Taylor expanded in z around 0 69.7%
neg-mul-169.7%
+-commutative69.7%
unsub-neg69.7%
Simplified69.7%
Taylor expanded in z around inf 26.8%
mul-1-neg26.8%
*-commutative26.8%
associate-*r/30.1%
distribute-rgt-neg-in30.1%
Simplified30.1%
add-sqr-sqrt20.6%
sqrt-unprod38.3%
sqr-neg38.3%
sqrt-unprod20.1%
add-sqr-sqrt32.5%
clear-num32.8%
un-div-inv32.8%
Applied egg-rr32.8%
Final simplification32.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 2023240
(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))))