
(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 14 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 (/ (* (/ 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 81.3%
associate-*l*81.3%
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-frac81.3%
associate-*l*81.3%
associate-/r*84.4%
times-frac98.1%
Applied egg-rr98.1%
Final simplification98.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (+ z 1.0) (* z z))))
(if (or (<= t_0 -10000000.0) (not (<= t_0 1e-18)))
(* (/ y z) (/ (/ x z) z))
(* (/ x z) (- (/ y z) y)))))
double code(double x, double y, double z) {
double t_0 = (z + 1.0) * (z * z);
double tmp;
if ((t_0 <= -10000000.0) || !(t_0 <= 1e-18)) {
tmp = (y / z) * ((x / 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) :: t_0
real(8) :: tmp
t_0 = (z + 1.0d0) * (z * z)
if ((t_0 <= (-10000000.0d0)) .or. (.not. (t_0 <= 1d-18))) then
tmp = (y / z) * ((x / 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 t_0 = (z + 1.0) * (z * z);
double tmp;
if ((t_0 <= -10000000.0) || !(t_0 <= 1e-18)) {
tmp = (y / z) * ((x / z) / z);
} else {
tmp = (x / z) * ((y / z) - y);
}
return tmp;
}
def code(x, y, z): t_0 = (z + 1.0) * (z * z) tmp = 0 if (t_0 <= -10000000.0) or not (t_0 <= 1e-18): tmp = (y / z) * ((x / z) / z) else: tmp = (x / z) * ((y / 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 <= -10000000.0) || !(t_0 <= 1e-18)) tmp = Float64(Float64(y / z) * Float64(Float64(x / z) / z)); else tmp = Float64(Float64(x / z) * Float64(Float64(y / 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 <= -10000000.0) || ~((t_0 <= 1e-18))) tmp = (y / z) * ((x / z) / z); else tmp = (x / z) * ((y / 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[Or[LessEqual[t$95$0, -10000000.0], N[Not[LessEqual[t$95$0, 1e-18]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] - y), $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 -10000000 \lor \neg \left(t_0 \leq 10^{-18}\right):\\
\;\;\;\;\frac{y}{z} \cdot \frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(\frac{y}{z} - y\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 z z) (+.f64 z 1)) < -1e7 or 1.0000000000000001e-18 < (*.f64 (*.f64 z z) (+.f64 z 1)) Initial program 82.1%
/-rgt-identity82.1%
associate-/l*82.1%
associate-/l/83.8%
associate-*l*88.7%
associate-*r/88.7%
*-rgt-identity88.7%
associate-*l*91.4%
associate-*r/88.7%
distribute-lft-in88.7%
fma-def88.7%
*-rgt-identity88.7%
Simplified88.7%
Taylor expanded in z around inf 87.2%
unpow287.2%
Simplified87.2%
associate-/r*90.5%
associate-/l*95.8%
associate-/r/97.2%
Applied egg-rr97.2%
if -1e7 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 1.0000000000000001e-18Initial program 80.3%
associate-*l*80.3%
times-frac98.0%
distribute-lft-in98.0%
fma-def98.0%
*-rgt-identity98.0%
Simplified98.0%
Taylor expanded in z around 0 98.0%
neg-mul-198.0%
+-commutative98.0%
unsub-neg98.0%
Simplified98.0%
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 82.1%
associate-*l*82.1%
times-frac92.6%
distribute-lft-in92.6%
fma-def92.6%
*-rgt-identity92.6%
Simplified92.6%
Taylor expanded in z around inf 91.1%
unpow291.1%
Simplified91.1%
if -1 < z < 0.75Initial program 80.3%
associate-*l*80.3%
times-frac98.0%
distribute-lft-in98.0%
fma-def98.0%
*-rgt-identity98.0%
Simplified98.0%
Taylor expanded in z around 0 98.0%
neg-mul-198.0%
+-commutative98.0%
unsub-neg98.0%
Simplified98.0%
Final simplification94.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 0.75))) (* (/ y z) (/ x (* 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 = (y / z) * (x / (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 = (y / z) * (x / (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 = (y / z) * (x / (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 = (y / z) * (x / (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(y / z) * Float64(x / 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 = (y / z) * (x / (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[(y / z), $MachinePrecision] * N[(x / 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{y}{z} \cdot \frac{x}{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 82.1%
/-rgt-identity82.1%
associate-/l*82.1%
associate-/l/83.8%
associate-*l*88.7%
associate-*r/88.7%
*-rgt-identity88.7%
associate-*l*91.4%
associate-*r/88.7%
distribute-lft-in88.7%
fma-def88.7%
*-rgt-identity88.7%
Simplified88.7%
Taylor expanded in z around inf 87.2%
unpow287.2%
Simplified87.2%
associate-/l*89.9%
add-cbrt-cube82.3%
cbrt-prod87.1%
*-un-lft-identity87.1%
times-frac87.1%
cbrt-prod89.7%
pow289.7%
Applied egg-rr89.7%
/-rgt-identity89.7%
associate-*r/89.7%
unpow289.7%
rem-3cbrt-lft89.9%
Simplified89.9%
associate-/r*95.8%
*-un-lft-identity95.8%
associate-/r/95.8%
times-frac97.0%
clear-num97.2%
associate-/l/91.9%
Applied egg-rr91.9%
if -1 < z < 0.75Initial program 80.3%
associate-*l*80.3%
times-frac98.0%
distribute-lft-in98.0%
fma-def98.0%
*-rgt-identity98.0%
Simplified98.0%
Taylor expanded in z around 0 98.0%
neg-mul-198.0%
+-commutative98.0%
unsub-neg98.0%
Simplified98.0%
Final simplification94.6%
(FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ x (/ z y)) (if (<= z -5e-310) (* x (/ y (- z))) (/ y (/ z x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = x / (z / y);
} else if (z <= -5e-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 <= (-1.0d0)) then
tmp = x / (z / y)
else if (z <= (-5d-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 <= -1.0) {
tmp = x / (z / y);
} else if (z <= -5e-310) {
tmp = x * (y / -z);
} else {
tmp = y / (z / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.0: tmp = x / (z / y) elif z <= -5e-310: tmp = x * (y / -z) else: tmp = y / (z / x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(x / Float64(z / y)); elseif (z <= -5e-310) tmp = Float64(x * Float64(y / Float64(-z))); else tmp = Float64(y / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.0) tmp = x / (z / y); elseif (z <= -5e-310) tmp = x * (y / -z); else tmp = y / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5e-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 -1:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-310}:\\
\;\;\;\;x \cdot \frac{y}{-z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if z < -1Initial program 79.0%
associate-*l*79.0%
times-frac93.0%
distribute-lft-in93.0%
fma-def93.0%
*-rgt-identity93.0%
Simplified93.0%
Taylor expanded in z around 0 28.6%
neg-mul-128.6%
+-commutative28.6%
unsub-neg28.6%
Simplified28.6%
Taylor expanded in z around inf 24.1%
associate-*r/24.1%
*-commutative24.1%
neg-mul-124.1%
distribute-lft-neg-in24.1%
associate-*r/30.7%
distribute-lft-neg-out30.7%
distribute-rgt-neg-in30.7%
*-lft-identity30.7%
metadata-eval30.7%
times-frac30.7%
neg-mul-130.7%
neg-mul-130.7%
distribute-frac-neg30.7%
remove-double-neg30.7%
Simplified30.7%
associate-*r/24.1%
associate-/l*34.0%
add-sqr-sqrt34.0%
sqrt-unprod52.3%
sqr-neg52.3%
sqrt-prod0.0%
add-sqr-sqrt36.9%
Applied egg-rr36.9%
if -1 < z < -4.999999999999985e-310Initial program 79.2%
associate-*l*79.2%
times-frac98.3%
distribute-lft-in98.3%
fma-def98.3%
*-rgt-identity98.3%
Simplified98.3%
Taylor expanded in z around 0 98.3%
neg-mul-198.3%
+-commutative98.3%
unsub-neg98.3%
Simplified98.3%
Taylor expanded in z around inf 30.0%
associate-*r/30.0%
*-commutative30.0%
neg-mul-130.0%
distribute-lft-neg-in30.0%
associate-*r/38.7%
distribute-lft-neg-out38.7%
distribute-rgt-neg-in38.7%
*-lft-identity38.7%
metadata-eval38.7%
times-frac38.7%
neg-mul-138.7%
neg-mul-138.7%
distribute-frac-neg38.7%
remove-double-neg38.7%
Simplified38.7%
if -4.999999999999985e-310 < z Initial program 84.3%
associate-*l*84.3%
times-frac94.7%
distribute-lft-in94.7%
fma-def94.7%
*-rgt-identity94.7%
Simplified94.7%
Taylor expanded in z around 0 66.6%
neg-mul-166.6%
+-commutative66.6%
unsub-neg66.6%
Simplified66.6%
Taylor expanded in z around inf 17.8%
associate-*r/17.8%
*-commutative17.8%
neg-mul-117.8%
distribute-lft-neg-in17.8%
associate-*r/20.4%
distribute-lft-neg-out20.4%
distribute-rgt-neg-in20.4%
*-lft-identity20.4%
metadata-eval20.4%
times-frac20.4%
neg-mul-120.4%
neg-mul-120.4%
distribute-frac-neg20.4%
remove-double-neg20.4%
Simplified20.4%
*-commutative20.4%
associate-*l/17.8%
associate-/l*22.3%
add-sqr-sqrt0.0%
sqrt-unprod51.9%
sqr-neg51.9%
sqrt-prod37.7%
add-sqr-sqrt37.7%
Applied egg-rr37.7%
Final simplification37.7%
(FPCore (x y z) :precision binary64 (if (<= z -9.5e+157) (* x (/ y (* z z))) (* (/ x z) (/ y z))))
double code(double x, double y, double z) {
double tmp;
if (z <= -9.5e+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 (z <= (-9.5d+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 (z <= -9.5e+157) {
tmp = x * (y / (z * z));
} else {
tmp = (x / z) * (y / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -9.5e+157: tmp = x * (y / (z * z)) else: tmp = (x / z) * (y / z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -9.5e+157) 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 (z <= -9.5e+157) tmp = x * (y / (z * z)); else tmp = (x / z) * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -9.5e+157], 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}\;z \leq -9.5 \cdot 10^{+157}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -9.4999999999999996e157Initial program 80.9%
associate-*l*80.9%
times-frac84.2%
distribute-lft-in84.2%
fma-def84.2%
*-rgt-identity84.2%
Simplified84.2%
Taylor expanded in z around 0 80.9%
unpow280.9%
associate-/l*84.2%
Simplified84.2%
associate-/r/84.2%
Applied egg-rr84.2%
if -9.4999999999999996e157 < z Initial program 81.4%
associate-*l*81.4%
times-frac96.8%
distribute-lft-in96.8%
fma-def96.8%
*-rgt-identity96.8%
Simplified96.8%
Taylor expanded in z around 0 63.4%
unpow263.4%
associate-/l/66.7%
associate-*r/70.0%
associate-*l/72.7%
Simplified72.7%
Final simplification74.3%
(FPCore (x y z) :precision binary64 (if (<= x -1e-7) (* x (/ y (* z z))) (* y (/ (/ x z) z))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1e-7) {
tmp = x * (y / (z * z));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1d-7)) then
tmp = x * (y / (z * z))
else
tmp = y * ((x / z) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1e-7) {
tmp = x * (y / (z * z));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1e-7: tmp = x * (y / (z * z)) else: tmp = y * ((x / z) / z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1e-7) tmp = Float64(x * Float64(y / Float64(z * z))); else tmp = Float64(y * Float64(Float64(x / z) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1e-7) tmp = x * (y / (z * z)); else tmp = y * ((x / z) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1e-7], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-7}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if x < -9.9999999999999995e-8Initial program 71.9%
associate-*l*71.9%
times-frac87.2%
distribute-lft-in87.2%
fma-def87.2%
*-rgt-identity87.2%
Simplified87.2%
Taylor expanded in z around 0 55.8%
unpow255.8%
associate-/l*51.3%
Simplified51.3%
associate-/r/57.5%
Applied egg-rr57.5%
if -9.9999999999999995e-8 < x Initial program 85.7%
associate-*l*85.7%
times-frac98.6%
distribute-lft-in98.6%
fma-def98.6%
*-rgt-identity98.6%
Simplified98.6%
Taylor expanded in z around 0 70.5%
unpow270.5%
associate-/l*74.2%
Simplified74.2%
clear-num74.4%
associate-/r/73.8%
clear-num73.8%
associate-/r*77.8%
Applied egg-rr77.8%
Final simplification71.4%
(FPCore (x y z) :precision binary64 (if (<= x -1.05e-24) (/ x (* z (/ z y))) (* y (/ (/ x z) z))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.05e-24) {
tmp = x / (z * (z / y));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.05d-24)) then
tmp = x / (z * (z / y))
else
tmp = y * ((x / z) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.05e-24) {
tmp = x / (z * (z / y));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.05e-24: tmp = x / (z * (z / y)) else: tmp = y * ((x / z) / z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.05e-24) tmp = Float64(x / Float64(z * Float64(z / y))); else tmp = Float64(y * Float64(Float64(x / z) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.05e-24) tmp = x / (z * (z / y)); else tmp = y * ((x / z) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.05e-24], N[(x / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-24}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if x < -1.05e-24Initial program 72.4%
/-rgt-identity72.4%
associate-/l*72.4%
associate-/l/73.8%
associate-*l*80.4%
associate-*r/80.4%
*-rgt-identity80.4%
associate-*l*88.0%
associate-*r/85.7%
distribute-lft-in85.7%
fma-def85.7%
*-rgt-identity85.7%
Simplified85.7%
Taylor expanded in z around 0 62.9%
if -1.05e-24 < x Initial program 85.8%
associate-*l*85.8%
times-frac98.6%
distribute-lft-in98.6%
fma-def98.6%
*-rgt-identity98.6%
Simplified98.6%
Taylor expanded in z around 0 70.2%
unpow270.2%
associate-/l*74.0%
Simplified74.0%
clear-num74.2%
associate-/r/73.6%
clear-num73.6%
associate-/r*77.8%
Applied egg-rr77.8%
Final simplification72.8%
(FPCore (x y z) :precision binary64 (if (<= x -3e-25) (/ x (/ z (/ y z))) (* y (/ (/ x z) z))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3e-25) {
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 (x <= (-3d-25)) 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 (x <= -3e-25) {
tmp = x / (z / (y / z));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3e-25: tmp = x / (z / (y / z)) else: tmp = y * ((x / z) / z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3e-25) tmp = Float64(x / Float64(z / Float64(y / z))); else tmp = Float64(y * Float64(Float64(x / z) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3e-25) tmp = x / (z / (y / z)); else tmp = y * ((x / z) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3e-25], N[(x / N[(z / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{-25}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{y}{z}}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if x < -2.9999999999999998e-25Initial program 72.4%
associate-*l*72.4%
times-frac87.9%
distribute-lft-in87.9%
fma-def87.9%
*-rgt-identity87.9%
Simplified87.9%
Taylor expanded in z around 0 57.2%
unpow257.2%
associate-/l*53.0%
Simplified53.0%
clear-num53.0%
associate-/r/52.0%
clear-num52.0%
associate-/r*49.4%
Applied egg-rr49.4%
associate-/l/52.0%
associate-/r/58.9%
associate-/l*62.9%
Applied egg-rr62.9%
if -2.9999999999999998e-25 < x Initial program 85.8%
associate-*l*85.8%
times-frac98.6%
distribute-lft-in98.6%
fma-def98.6%
*-rgt-identity98.6%
Simplified98.6%
Taylor expanded in z around 0 70.2%
unpow270.2%
associate-/l*74.0%
Simplified74.0%
clear-num74.2%
associate-/r/73.6%
clear-num73.6%
associate-/r*77.8%
Applied egg-rr77.8%
Final simplification72.8%
(FPCore (x y z) :precision binary64 (if (<= x -5.1e+163) (* x (/ y z)) (* (/ x z) y)))
double code(double x, double y, double z) {
double tmp;
if (x <= -5.1e+163) {
tmp = x * (y / 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 (x <= (-5.1d+163)) then
tmp = x * (y / 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 (x <= -5.1e+163) {
tmp = x * (y / z);
} else {
tmp = (x / z) * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -5.1e+163: tmp = x * (y / z) else: tmp = (x / z) * y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -5.1e+163) tmp = Float64(x * Float64(y / z)); else tmp = Float64(Float64(x / z) * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -5.1e+163) tmp = x * (y / z); else tmp = (x / z) * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -5.1e+163], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.1 \cdot 10^{+163}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\end{array}
\end{array}
if x < -5.1000000000000002e163Initial program 76.4%
associate-*l*76.4%
times-frac77.1%
distribute-lft-in77.1%
fma-def77.1%
*-rgt-identity77.1%
Simplified77.1%
Taylor expanded in z around 0 41.3%
neg-mul-141.3%
+-commutative41.3%
unsub-neg41.3%
Simplified41.3%
Taylor expanded in z around inf 16.7%
associate-*r/16.7%
*-commutative16.7%
neg-mul-116.7%
distribute-lft-neg-in16.7%
associate-*r/31.1%
distribute-lft-neg-out31.1%
distribute-rgt-neg-in31.1%
*-lft-identity31.1%
metadata-eval31.1%
times-frac31.1%
neg-mul-131.1%
neg-mul-131.1%
distribute-frac-neg31.1%
remove-double-neg31.1%
Simplified31.1%
expm1-log1p-u23.3%
expm1-udef23.5%
associate-*r/23.5%
add-sqr-sqrt22.0%
sqrt-unprod31.9%
sqr-neg31.9%
sqrt-prod6.1%
add-sqr-sqrt20.8%
Applied egg-rr20.8%
expm1-def6.3%
expm1-log1p17.4%
*-commutative17.4%
associate-*l/31.8%
Simplified31.8%
if -5.1000000000000002e163 < x Initial program 81.9%
associate-*l*81.9%
times-frac97.2%
distribute-lft-in97.2%
fma-def97.2%
*-rgt-identity97.2%
Simplified97.2%
Taylor expanded in z around 0 64.4%
neg-mul-164.4%
+-commutative64.4%
unsub-neg64.4%
Simplified64.4%
Taylor expanded in z around inf 23.7%
associate-*r/23.7%
*-commutative23.7%
neg-mul-123.7%
distribute-lft-neg-in23.7%
associate-*r/28.1%
distribute-lft-neg-out28.1%
distribute-rgt-neg-in28.1%
*-lft-identity28.1%
metadata-eval28.1%
times-frac28.1%
neg-mul-128.1%
neg-mul-128.1%
distribute-frac-neg28.1%
remove-double-neg28.1%
Simplified28.1%
expm1-log1p-u23.8%
expm1-udef38.1%
associate-*r/37.7%
add-sqr-sqrt22.3%
sqrt-unprod43.1%
sqr-neg43.1%
sqrt-prod17.1%
add-sqr-sqrt36.2%
Applied egg-rr36.2%
expm1-def20.1%
expm1-log1p23.9%
*-commutative23.9%
associate-*r/27.7%
Simplified27.7%
Final simplification28.2%
(FPCore (x y z) :precision binary64 (if (<= y 1e+80) (/ x (/ z y)) (* (/ x z) y)))
double code(double x, double y, double z) {
double tmp;
if (y <= 1e+80) {
tmp = x / (z / y);
} 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 (y <= 1d+80) then
tmp = x / (z / y)
else
tmp = (x / z) * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 1e+80) {
tmp = x / (z / y);
} else {
tmp = (x / z) * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1e+80: tmp = x / (z / y) else: tmp = (x / z) * y return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1e+80) tmp = Float64(x / Float64(z / y)); else tmp = Float64(Float64(x / z) * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 1e+80) tmp = x / (z / y); else tmp = (x / z) * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1e+80], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{+80}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\end{array}
\end{array}
if y < 1e80Initial program 81.4%
associate-*l*81.4%
times-frac94.8%
distribute-lft-in94.8%
fma-def94.8%
*-rgt-identity94.8%
Simplified94.8%
Taylor expanded in z around 0 62.6%
neg-mul-162.6%
+-commutative62.6%
unsub-neg62.6%
Simplified62.6%
Taylor expanded in z around inf 22.9%
associate-*r/22.9%
*-commutative22.9%
neg-mul-122.9%
distribute-lft-neg-in22.9%
associate-*r/27.8%
distribute-lft-neg-out27.8%
distribute-rgt-neg-in27.8%
*-lft-identity27.8%
metadata-eval27.8%
times-frac27.8%
neg-mul-127.8%
neg-mul-127.8%
distribute-frac-neg27.8%
remove-double-neg27.8%
Simplified27.8%
associate-*r/22.9%
associate-/l*29.6%
add-sqr-sqrt19.3%
sqrt-unprod48.6%
sqr-neg48.6%
sqrt-prod17.2%
add-sqr-sqrt32.2%
Applied egg-rr32.2%
if 1e80 < y Initial program 80.9%
associate-*l*80.9%
times-frac95.8%
distribute-lft-in95.9%
fma-def95.9%
*-rgt-identity95.9%
Simplified95.9%
Taylor expanded in z around 0 58.9%
neg-mul-158.9%
+-commutative58.9%
unsub-neg58.9%
Simplified58.9%
Taylor expanded in z around inf 23.3%
associate-*r/23.3%
*-commutative23.3%
neg-mul-123.3%
distribute-lft-neg-in23.3%
associate-*r/31.0%
distribute-lft-neg-out31.0%
distribute-rgt-neg-in31.0%
*-lft-identity31.0%
metadata-eval31.0%
times-frac31.0%
neg-mul-131.0%
neg-mul-131.0%
distribute-frac-neg31.0%
remove-double-neg31.0%
Simplified31.0%
expm1-log1p-u13.9%
expm1-udef32.9%
associate-*r/32.9%
add-sqr-sqrt20.3%
sqrt-unprod35.1%
sqr-neg35.1%
sqrt-prod14.8%
add-sqr-sqrt27.4%
Applied egg-rr27.4%
expm1-def8.6%
expm1-log1p15.6%
*-commutative15.6%
associate-*r/31.5%
Simplified31.5%
Final simplification32.0%
(FPCore (x y z) :precision binary64 (if (<= y 4.4e+79) (/ x (/ z y)) (/ y (/ z x))))
double code(double x, double y, double z) {
double tmp;
if (y <= 4.4e+79) {
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 (y <= 4.4d+79) 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 (y <= 4.4e+79) {
tmp = x / (z / y);
} else {
tmp = y / (z / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 4.4e+79: tmp = x / (z / y) else: tmp = y / (z / x) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 4.4e+79) tmp = Float64(x / Float64(z / y)); else tmp = Float64(y / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 4.4e+79) tmp = x / (z / y); else tmp = y / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 4.4e+79], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.4 \cdot 10^{+79}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if y < 4.3999999999999998e79Initial program 81.4%
associate-*l*81.4%
times-frac94.8%
distribute-lft-in94.8%
fma-def94.8%
*-rgt-identity94.8%
Simplified94.8%
Taylor expanded in z around 0 62.6%
neg-mul-162.6%
+-commutative62.6%
unsub-neg62.6%
Simplified62.6%
Taylor expanded in z around inf 22.9%
associate-*r/22.9%
*-commutative22.9%
neg-mul-122.9%
distribute-lft-neg-in22.9%
associate-*r/27.8%
distribute-lft-neg-out27.8%
distribute-rgt-neg-in27.8%
*-lft-identity27.8%
metadata-eval27.8%
times-frac27.8%
neg-mul-127.8%
neg-mul-127.8%
distribute-frac-neg27.8%
remove-double-neg27.8%
Simplified27.8%
associate-*r/22.9%
associate-/l*29.6%
add-sqr-sqrt19.3%
sqrt-unprod48.6%
sqr-neg48.6%
sqrt-prod17.2%
add-sqr-sqrt32.2%
Applied egg-rr32.2%
if 4.3999999999999998e79 < y Initial program 80.9%
associate-*l*80.9%
times-frac95.8%
distribute-lft-in95.9%
fma-def95.9%
*-rgt-identity95.9%
Simplified95.9%
Taylor expanded in z around 0 58.9%
neg-mul-158.9%
+-commutative58.9%
unsub-neg58.9%
Simplified58.9%
Taylor expanded in z around inf 23.3%
associate-*r/23.3%
*-commutative23.3%
neg-mul-123.3%
distribute-lft-neg-in23.3%
associate-*r/31.0%
distribute-lft-neg-out31.0%
distribute-rgt-neg-in31.0%
*-lft-identity31.0%
metadata-eval31.0%
times-frac31.0%
neg-mul-131.0%
neg-mul-131.0%
distribute-frac-neg31.0%
remove-double-neg31.0%
Simplified31.0%
*-commutative31.0%
associate-*l/23.3%
associate-/l*39.1%
add-sqr-sqrt26.5%
sqrt-unprod52.0%
sqr-neg52.0%
sqrt-prod21.3%
add-sqr-sqrt31.5%
Applied egg-rr31.5%
Final simplification32.0%
(FPCore (x y z) :precision binary64 (* (/ x z) (/ y z)))
double code(double x, double y, double z) {
return (x / z) * (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 / z) * (y / z)
end function
public static double code(double x, double y, double z) {
return (x / z) * (y / z);
}
def code(x, y, z): return (x / z) * (y / z)
function code(x, y, z) return Float64(Float64(x / z) * Float64(y / z)) end
function tmp = code(x, y, z) tmp = (x / z) * (y / z); end
code[x_, y_, z_] := N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{z} \cdot \frac{y}{z}
\end{array}
Initial program 81.3%
associate-*l*81.3%
times-frac95.0%
distribute-lft-in95.0%
fma-def95.0%
*-rgt-identity95.0%
Simplified95.0%
Taylor expanded in z around 0 65.9%
unpow265.9%
associate-/l/66.4%
associate-*r/69.6%
associate-*l/72.0%
Simplified72.0%
Final simplification72.0%
(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 81.3%
associate-*l*81.3%
times-frac95.0%
distribute-lft-in95.0%
fma-def95.0%
*-rgt-identity95.0%
Simplified95.0%
Taylor expanded in z around 0 61.9%
neg-mul-161.9%
+-commutative61.9%
unsub-neg61.9%
Simplified61.9%
Taylor expanded in z around inf 23.0%
associate-*r/23.0%
*-commutative23.0%
neg-mul-123.0%
distribute-lft-neg-in23.0%
associate-*r/28.4%
distribute-lft-neg-out28.4%
distribute-rgt-neg-in28.4%
*-lft-identity28.4%
metadata-eval28.4%
times-frac28.4%
neg-mul-128.4%
neg-mul-128.4%
distribute-frac-neg28.4%
remove-double-neg28.4%
Simplified28.4%
expm1-log1p-u23.8%
expm1-udef36.5%
associate-*r/36.1%
add-sqr-sqrt22.3%
sqrt-unprod41.9%
sqr-neg41.9%
sqrt-prod15.9%
add-sqr-sqrt34.5%
Applied egg-rr34.5%
expm1-def18.6%
expm1-log1p23.2%
*-commutative23.2%
associate-*r/26.9%
Simplified26.9%
Final simplification26.9%
(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 2023238
(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))))