
(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 13 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 (/ (* (/ y (+ z 1.0)) (/ x z)) z))
double code(double x, double y, double z) {
return ((y / (z + 1.0)) * (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 / (z + 1.0d0)) * (x / z)) / z
end function
public static double code(double x, double y, double z) {
return ((y / (z + 1.0)) * (x / z)) / z;
}
def code(x, y, z): return ((y / (z + 1.0)) * (x / z)) / z
function code(x, y, z) return Float64(Float64(Float64(y / Float64(z + 1.0)) * Float64(x / z)) / z) end
function tmp = code(x, y, z) tmp = ((y / (z + 1.0)) * (x / z)) / z; end
code[x_, y_, z_] := N[(N[(N[(y / N[(z + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{z + 1} \cdot \frac{x}{z}}{z}
\end{array}
Initial program 84.7%
associate-*l*84.7%
times-frac95.4%
distribute-lft-in95.5%
fma-def95.5%
*-rgt-identity95.5%
Simplified95.5%
*-commutative95.5%
associate-*l/94.5%
fma-udef94.5%
distribute-lft1-in94.5%
frac-times94.0%
associate-*r/97.8%
Applied egg-rr97.8%
Final simplification97.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 0.76))) (* (/ 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.76)) {
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.76d0))) 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.76)) {
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.76): 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.76)) 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.76))) 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.76]], $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.76\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.76000000000000001 < z Initial program 86.4%
associate-*l*86.4%
times-frac93.4%
distribute-lft-in93.4%
fma-def93.4%
*-rgt-identity93.4%
Simplified93.4%
Taylor expanded in z around inf 92.0%
unpow292.0%
Simplified92.0%
if -1 < z < 0.76000000000000001Initial program 82.9%
associate-*l*82.9%
times-frac97.5%
distribute-lft-in97.5%
fma-def97.5%
*-rgt-identity97.5%
Simplified97.5%
Taylor expanded in z around 0 96.7%
neg-mul-196.7%
+-commutative96.7%
unsub-neg96.7%
Simplified96.7%
Final simplification94.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 0.76))) (* (/ 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.76)) {
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.76d0))) 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.76)) {
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.76): 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.76)) 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.76))) 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.76]], $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.76\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.76000000000000001 < z Initial program 86.4%
associate-*l*86.4%
times-frac93.4%
distribute-lft-in93.4%
fma-def93.4%
*-rgt-identity93.4%
Simplified93.4%
Taylor expanded in z around inf 92.0%
unpow292.0%
associate-/r*95.6%
Simplified95.6%
if -1 < z < 0.76000000000000001Initial program 82.9%
associate-*l*82.9%
times-frac97.5%
distribute-lft-in97.5%
fma-def97.5%
*-rgt-identity97.5%
Simplified97.5%
Taylor expanded in z around 0 96.7%
neg-mul-196.7%
+-commutative96.7%
unsub-neg96.7%
Simplified96.7%
Final simplification96.1%
(FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ (* (/ x z) (/ y 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 = ((x / z) * (y / 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 = ((x / z) * (y / 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 = ((x / z) * (y / 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 = ((x / z) * (y / 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(Float64(x / z) * Float64(y / 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 = ((x / z) * (y / 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[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $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{\frac{x}{z} \cdot \frac{y}{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 83.2%
associate-*l*83.2%
times-frac93.7%
distribute-lft-in93.7%
fma-def93.7%
*-rgt-identity93.7%
Simplified93.7%
*-commutative93.7%
associate-*l/89.6%
fma-udef89.6%
distribute-lft1-in89.6%
frac-times92.6%
associate-*r/96.5%
Applied egg-rr96.5%
Taylor expanded in z around inf 86.2%
unpow286.2%
times-frac94.5%
Simplified94.5%
if -1 < z < 0.76000000000000001Initial program 82.9%
associate-*l*82.9%
times-frac97.5%
distribute-lft-in97.5%
fma-def97.5%
*-rgt-identity97.5%
Simplified97.5%
Taylor expanded in z around 0 96.7%
neg-mul-196.7%
+-commutative96.7%
unsub-neg96.7%
Simplified96.7%
if 0.76000000000000001 < z Initial program 89.9%
associate-*l*89.9%
times-frac93.1%
distribute-lft-in93.1%
fma-def93.1%
*-rgt-identity93.1%
Simplified93.1%
Taylor expanded in z around inf 92.3%
unpow292.3%
associate-/r*98.2%
Simplified98.2%
Final simplification96.5%
(FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ (* (/ x z) (/ y z)) z) (if (<= z 0.76) (* (/ x z) (- (/ y z) y)) (/ (/ x z) (/ z (/ y z))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = ((x / z) * (y / z)) / z;
} else if (z <= 0.76) {
tmp = (x / z) * ((y / z) - y);
} else {
tmp = (x / z) / (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)) then
tmp = ((x / z) * (y / z)) / z
else if (z <= 0.76d0) then
tmp = (x / z) * ((y / z) - y)
else
tmp = (x / z) / (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) {
tmp = ((x / z) * (y / z)) / z;
} else if (z <= 0.76) {
tmp = (x / z) * ((y / z) - y);
} else {
tmp = (x / z) / (z / (y / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.0: tmp = ((x / z) * (y / z)) / z elif z <= 0.76: tmp = (x / z) * ((y / z) - y) else: tmp = (x / z) / (z / (y / z)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(Float64(x / z) * Float64(y / z)) / z); elseif (z <= 0.76) tmp = Float64(Float64(x / z) * Float64(Float64(y / z) - y)); else tmp = Float64(Float64(x / z) / Float64(z / Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.0) tmp = ((x / z) * (y / z)) / z; elseif (z <= 0.76) tmp = (x / z) * ((y / z) - y); else tmp = (x / z) / (z / (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $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[(z / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{\frac{x}{z} \cdot \frac{y}{z}}{z}\\
\mathbf{elif}\;z \leq 0.76:\\
\;\;\;\;\frac{x}{z} \cdot \left(\frac{y}{z} - y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{z}{\frac{y}{z}}}\\
\end{array}
\end{array}
if z < -1Initial program 83.2%
associate-*l*83.2%
times-frac93.7%
distribute-lft-in93.7%
fma-def93.7%
*-rgt-identity93.7%
Simplified93.7%
*-commutative93.7%
associate-*l/89.6%
fma-udef89.6%
distribute-lft1-in89.6%
frac-times92.6%
associate-*r/96.5%
Applied egg-rr96.5%
Taylor expanded in z around inf 86.2%
unpow286.2%
times-frac94.5%
Simplified94.5%
if -1 < z < 0.76000000000000001Initial program 82.9%
associate-*l*82.9%
times-frac97.5%
distribute-lft-in97.5%
fma-def97.5%
*-rgt-identity97.5%
Simplified97.5%
Taylor expanded in z around 0 96.7%
neg-mul-196.7%
+-commutative96.7%
unsub-neg96.7%
Simplified96.7%
if 0.76000000000000001 < z Initial program 89.9%
associate-*l*89.9%
times-frac93.1%
distribute-lft-in93.1%
fma-def93.1%
*-rgt-identity93.1%
Simplified93.1%
Taylor expanded in z around inf 92.3%
unpow292.3%
Simplified92.3%
clear-num92.3%
un-div-inv92.3%
associate-/l*98.1%
Applied egg-rr98.1%
Final simplification96.5%
(FPCore (x y z) :precision binary64 (if (<= z -2.9e-151) (* (/ y (+ z 1.0)) (/ (/ x z) z)) (if (<= z 1.0) (/ (/ y (/ z x)) z) (/ (/ x z) (/ z (/ y z))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.9e-151) {
tmp = (y / (z + 1.0)) * ((x / z) / z);
} else if (z <= 1.0) {
tmp = (y / (z / x)) / z;
} else {
tmp = (x / z) / (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.9d-151)) then
tmp = (y / (z + 1.0d0)) * ((x / z) / z)
else if (z <= 1.0d0) then
tmp = (y / (z / x)) / z
else
tmp = (x / z) / (z / (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.9e-151) {
tmp = (y / (z + 1.0)) * ((x / z) / z);
} else if (z <= 1.0) {
tmp = (y / (z / x)) / z;
} else {
tmp = (x / z) / (z / (y / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.9e-151: tmp = (y / (z + 1.0)) * ((x / z) / z) elif z <= 1.0: tmp = (y / (z / x)) / z else: tmp = (x / z) / (z / (y / z)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.9e-151) tmp = Float64(Float64(y / Float64(z + 1.0)) * Float64(Float64(x / z) / z)); elseif (z <= 1.0) tmp = Float64(Float64(y / Float64(z / x)) / z); else tmp = Float64(Float64(x / z) / Float64(z / Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.9e-151) tmp = (y / (z + 1.0)) * ((x / z) / z); elseif (z <= 1.0) tmp = (y / (z / x)) / z; else tmp = (x / z) / (z / (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.9e-151], N[(N[(y / N[(z + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-151}:\\
\;\;\;\;\frac{y}{z + 1} \cdot \frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{\frac{y}{\frac{z}{x}}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{z}{\frac{y}{z}}}\\
\end{array}
\end{array}
if z < -2.90000000000000013e-151Initial program 86.5%
times-frac93.0%
Simplified93.0%
Taylor expanded in x around 0 93.0%
unpow293.0%
associate-/l/94.8%
Simplified94.8%
if -2.90000000000000013e-151 < z < 1Initial program 79.5%
associate-*l*79.5%
times-frac97.8%
distribute-lft-in97.8%
fma-def97.8%
*-rgt-identity97.8%
Simplified97.8%
*-commutative97.8%
associate-*l/99.7%
fma-udef99.7%
distribute-lft1-in99.7%
frac-times90.8%
associate-*r/99.6%
Applied egg-rr99.6%
*-commutative99.6%
clear-num99.6%
frac-times99.8%
*-un-lft-identity99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 98.8%
if 1 < z Initial program 89.9%
associate-*l*89.9%
times-frac93.1%
distribute-lft-in93.1%
fma-def93.1%
*-rgt-identity93.1%
Simplified93.1%
Taylor expanded in z around inf 92.3%
unpow292.3%
Simplified92.3%
clear-num92.3%
un-div-inv92.3%
associate-/l*98.1%
Applied egg-rr98.1%
Final simplification97.1%
(FPCore (x y z) :precision binary64 (if (<= (* y x) -1e+38) (* y (/ x (* z z))) (/ (/ x z) (/ z y))))
double code(double x, double y, double z) {
double tmp;
if ((y * x) <= -1e+38) {
tmp = y * (x / (z * z));
} else {
tmp = (x / 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) :: tmp
if ((y * x) <= (-1d+38)) then
tmp = y * (x / (z * z))
else
tmp = (x / z) / (z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y * x) <= -1e+38) {
tmp = y * (x / (z * z));
} else {
tmp = (x / z) / (z / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y * x) <= -1e+38: tmp = y * (x / (z * z)) else: tmp = (x / z) / (z / y) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(y * x) <= -1e+38) tmp = Float64(y * Float64(x / Float64(z * z))); else tmp = Float64(Float64(x / z) / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y * x) <= -1e+38) tmp = y * (x / (z * z)); else tmp = (x / z) / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(y * x), $MachinePrecision], -1e+38], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot x \leq -1 \cdot 10^{+38}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{z}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999977e37Initial program 84.9%
times-frac90.4%
Simplified90.4%
Taylor expanded in z around 0 66.6%
if -9.99999999999999977e37 < (*.f64 x y) Initial program 84.6%
associate-*l*84.6%
times-frac96.5%
distribute-lft-in96.5%
fma-def96.5%
*-rgt-identity96.5%
Simplified96.5%
Taylor expanded in z around 0 69.3%
unpow269.3%
associate-/l/75.0%
associate-*r/79.5%
associate-*l/80.0%
Simplified80.0%
*-commutative80.0%
clear-num80.1%
un-div-inv80.4%
Applied egg-rr80.4%
Final simplification77.2%
(FPCore (x y z) :precision binary64 (if (<= (* y x) -1e+38) (* y (/ x (* z z))) (/ (/ y z) (/ z x))))
double code(double x, double y, double z) {
double tmp;
if ((y * x) <= -1e+38) {
tmp = y * (x / (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 ((y * x) <= (-1d+38)) then
tmp = y * (x / (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 ((y * x) <= -1e+38) {
tmp = y * (x / (z * z));
} else {
tmp = (y / z) / (z / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y * x) <= -1e+38: tmp = y * (x / (z * z)) else: tmp = (y / z) / (z / x) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(y * x) <= -1e+38) tmp = Float64(y * Float64(x / Float64(z * z))); else tmp = Float64(Float64(y / z) / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y * x) <= -1e+38) tmp = y * (x / (z * z)); else tmp = (y / z) / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(y * x), $MachinePrecision], -1e+38], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot x \leq -1 \cdot 10^{+38}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{\frac{z}{x}}\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999977e37Initial program 84.9%
times-frac90.4%
Simplified90.4%
Taylor expanded in z around 0 66.6%
if -9.99999999999999977e37 < (*.f64 x y) Initial program 84.6%
times-frac88.3%
Simplified88.3%
Taylor expanded in z around 0 72.5%
associate-*l/69.3%
times-frac80.0%
clear-num80.1%
associate-*l/80.1%
*-un-lft-identity80.1%
Applied egg-rr80.1%
Final simplification77.0%
(FPCore (x y z) :precision binary64 (if (<= y 1.65e-43) (* x (/ (/ y z) z)) (* y (/ x (* z z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.65e-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 <= 1.65d-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 <= 1.65e-43) {
tmp = x * ((y / z) / z);
} else {
tmp = y * (x / (z * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.65e-43: tmp = x * ((y / z) / z) else: tmp = y * (x / (z * z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.65e-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 <= 1.65e-43) tmp = x * ((y / z) / z); else tmp = y * (x / (z * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.65e-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 1.65 \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 < 1.65000000000000008e-43Initial program 85.3%
times-frac89.3%
Simplified89.3%
Taylor expanded in z around 0 74.6%
associate-*l/71.8%
associate-/l*74.9%
associate-/l*76.8%
Applied egg-rr76.8%
div-inv76.1%
clear-num75.6%
Applied egg-rr75.6%
if 1.65000000000000008e-43 < y Initial program 83.5%
times-frac87.6%
Simplified87.6%
Taylor expanded in z around 0 63.9%
Final simplification71.8%
(FPCore (x y z) :precision binary64 (if (<= x -1.5e-36) (* x (/ (/ y z) z)) (* (/ x z) (/ y z))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.5e-36) {
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.5d-36)) 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.5e-36) {
tmp = x * ((y / z) / z);
} else {
tmp = (x / z) * (y / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.5e-36: tmp = x * ((y / z) / z) else: tmp = (x / z) * (y / z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.5e-36) 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 <= -1.5e-36) tmp = x * ((y / z) / z); else tmp = (x / z) * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.5e-36], 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 -1.5 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \frac{\frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\end{array}
\end{array}
if x < -1.5000000000000001e-36Initial program 89.0%
times-frac90.7%
Simplified90.7%
Taylor expanded in z around 0 74.0%
associate-*l/73.8%
associate-/l*80.2%
associate-/l*78.4%
Applied egg-rr78.4%
div-inv78.4%
clear-num77.0%
Applied egg-rr77.0%
if -1.5000000000000001e-36 < x Initial program 83.4%
associate-*l*83.4%
times-frac96.0%
distribute-lft-in96.0%
fma-def96.0%
*-rgt-identity96.0%
Simplified96.0%
Taylor expanded in z around 0 66.4%
unpow266.4%
associate-/l/70.1%
associate-*r/74.8%
associate-*l/74.8%
Simplified74.8%
Final simplification75.3%
(FPCore (x y z) :precision binary64 (if (<= x -1e-20) (/ x (* z (/ z y))) (* (/ x z) (/ y z))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1e-20) {
tmp = x / (z * (z / y));
} 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 <= (-1d-20)) then
tmp = x / (z * (z / y))
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 <= -1e-20) {
tmp = x / (z * (z / y));
} else {
tmp = (x / z) * (y / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1e-20: tmp = x / (z * (z / y)) else: tmp = (x / z) * (y / z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1e-20) tmp = Float64(x / Float64(z * Float64(z / y))); 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 <= -1e-20) tmp = x / (z * (z / y)); else tmp = (x / z) * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1e-20], N[(x / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-20}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\end{array}
\end{array}
if x < -9.99999999999999945e-21Initial program 90.0%
/-rgt-identity90.0%
associate-/l*90.0%
associate-/l/87.2%
associate-*l*87.2%
associate-*r/87.2%
*-rgt-identity87.2%
associate-*l*87.2%
associate-*r/87.2%
distribute-lft-in87.2%
fma-def87.2%
*-rgt-identity87.2%
Simplified87.2%
Taylor expanded in z around 0 77.8%
if -9.99999999999999945e-21 < x Initial program 83.1%
associate-*l*83.1%
times-frac96.0%
distribute-lft-in96.0%
fma-def96.0%
*-rgt-identity96.0%
Simplified96.0%
Taylor expanded in z around 0 66.3%
unpow266.3%
associate-/l/70.0%
associate-*r/75.1%
associate-*l/75.1%
Simplified75.1%
Final simplification75.7%
(FPCore (x y z) :precision binary64 (if (<= y 3.2e-26) (/ x (* z (/ z y))) (/ y (* z (/ z x)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 3.2e-26) {
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 <= 3.2d-26) 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 <= 3.2e-26) {
tmp = x / (z * (z / y));
} else {
tmp = y / (z * (z / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 3.2e-26: tmp = x / (z * (z / y)) else: tmp = y / (z * (z / x)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 3.2e-26) 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 <= 3.2e-26) tmp = x / (z * (z / y)); else tmp = y / (z * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 3.2e-26], 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 3.2 \cdot 10^{-26}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if y < 3.2000000000000001e-26Initial program 85.5%
/-rgt-identity85.5%
associate-/l*85.5%
associate-/l/85.4%
associate-*l*85.9%
associate-*r/85.9%
*-rgt-identity85.9%
associate-*l*88.7%
associate-*r/88.8%
distribute-lft-in88.8%
fma-def88.8%
*-rgt-identity88.8%
Simplified88.8%
Taylor expanded in z around 0 76.6%
if 3.2000000000000001e-26 < y Initial program 82.9%
times-frac86.6%
Simplified86.6%
Taylor expanded in z around 0 63.4%
associate-*l/60.6%
times-frac63.1%
clear-num63.1%
frac-times67.1%
*-un-lft-identity67.1%
Applied egg-rr67.1%
Final simplification73.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 84.7%
times-frac88.8%
Simplified88.8%
Taylor expanded in z around 0 71.1%
associate-*l/68.1%
associate-/l*69.9%
associate-/l*70.0%
Applied egg-rr70.0%
div-inv69.5%
clear-num69.2%
Applied egg-rr69.2%
Final simplification69.2%
(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 2023221
(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))))