
(FPCore (x y z) :precision binary64 (/ (* x (+ (- y z) 1.0)) z))
double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / 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) + 1.0d0)) / z
end function
public static double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / z;
}
def code(x, y, z): return (x * ((y - z) + 1.0)) / z
function code(x, y, z) return Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z) end
function tmp = code(x, y, z) tmp = (x * ((y - z) + 1.0)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* x (+ (- y z) 1.0)) z))
double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / 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) + 1.0d0)) / z
end function
public static double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / z;
}
def code(x, y, z): return (x * ((y - z) + 1.0)) / z
function code(x, y, z) return Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z) end
function tmp = code(x, y, z) tmp = (x * ((y - z) + 1.0)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= z -3.3e+86) (* x (+ -1.0 (/ y z))) (if (<= z 6.2e+15) (* (+ (- y z) 1.0) (/ x z)) (- (/ x (/ z y)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.3e+86) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 6.2e+15) {
tmp = ((y - z) + 1.0) * (x / z);
} else {
tmp = (x / (z / y)) - 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 <= (-3.3d+86)) then
tmp = x * ((-1.0d0) + (y / z))
else if (z <= 6.2d+15) then
tmp = ((y - z) + 1.0d0) * (x / z)
else
tmp = (x / (z / y)) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.3e+86) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 6.2e+15) {
tmp = ((y - z) + 1.0) * (x / z);
} else {
tmp = (x / (z / y)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.3e+86: tmp = x * (-1.0 + (y / z)) elif z <= 6.2e+15: tmp = ((y - z) + 1.0) * (x / z) else: tmp = (x / (z / y)) - x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.3e+86) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); elseif (z <= 6.2e+15) tmp = Float64(Float64(Float64(y - z) + 1.0) * Float64(x / z)); else tmp = Float64(Float64(x / Float64(z / y)) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.3e+86) tmp = x * (-1.0 + (y / z)); elseif (z <= 6.2e+15) tmp = ((y - z) + 1.0) * (x / z); else tmp = (x / (z / y)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.3e+86], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+15], N[(N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+86}:\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(y - z\right) + 1\right) \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}} - x\\
\end{array}
\end{array}
if z < -3.2999999999999999e86Initial program 67.4%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
if -3.2999999999999999e86 < z < 6.2e15Initial program 99.2%
*-commutative99.2%
associate-/l*99.9%
+-commutative99.9%
Applied egg-rr99.9%
if 6.2e15 < z Initial program 67.4%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 99.9%
distribute-rgt-in99.9%
neg-mul-199.9%
unsub-neg99.9%
clear-num99.9%
associate-*l/100.0%
*-un-lft-identity100.0%
Applied egg-rr100.0%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= x 9.6e-75) (/ (fma x (- y z) x) z) (- (/ x (/ z (+ y 1.0))) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 9.6e-75) {
tmp = fma(x, (y - z), x) / z;
} else {
tmp = (x / (z / (y + 1.0))) - x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 9.6e-75) tmp = Float64(fma(x, Float64(y - z), x) / z); else tmp = Float64(Float64(x / Float64(z / Float64(y + 1.0))) - x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 9.6e-75], N[(N[(x * N[(y - z), $MachinePrecision] + x), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / N[(z / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 9.6 \cdot 10^{-75}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y - z, x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + 1}} - x\\
\end{array}
\end{array}
if x < 9.60000000000000077e-75Initial program 89.6%
distribute-lft-in89.6%
fma-define89.6%
*-rgt-identity89.6%
Simplified89.6%
if 9.60000000000000077e-75 < x Initial program 76.2%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
distribute-lft-in99.9%
clear-num99.8%
un-div-inv99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Final simplification92.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ y z))))
(if (<= z -2.2e+104)
(- x)
(if (<= z -4.6e+43)
t_0
(if (<= z -1.0)
(- x)
(if (<= z -3.7e-196)
(/ x z)
(if (<= z -1.5e-243)
t_0
(if (<= z 1.4e-14) (/ x z) (if (<= z 8.5e+15) t_0 (- x))))))))))
double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (z <= -2.2e+104) {
tmp = -x;
} else if (z <= -4.6e+43) {
tmp = t_0;
} else if (z <= -1.0) {
tmp = -x;
} else if (z <= -3.7e-196) {
tmp = x / z;
} else if (z <= -1.5e-243) {
tmp = t_0;
} else if (z <= 1.4e-14) {
tmp = x / z;
} else if (z <= 8.5e+15) {
tmp = t_0;
} else {
tmp = -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) :: t_0
real(8) :: tmp
t_0 = x * (y / z)
if (z <= (-2.2d+104)) then
tmp = -x
else if (z <= (-4.6d+43)) then
tmp = t_0
else if (z <= (-1.0d0)) then
tmp = -x
else if (z <= (-3.7d-196)) then
tmp = x / z
else if (z <= (-1.5d-243)) then
tmp = t_0
else if (z <= 1.4d-14) then
tmp = x / z
else if (z <= 8.5d+15) then
tmp = t_0
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (z <= -2.2e+104) {
tmp = -x;
} else if (z <= -4.6e+43) {
tmp = t_0;
} else if (z <= -1.0) {
tmp = -x;
} else if (z <= -3.7e-196) {
tmp = x / z;
} else if (z <= -1.5e-243) {
tmp = t_0;
} else if (z <= 1.4e-14) {
tmp = x / z;
} else if (z <= 8.5e+15) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y / z) tmp = 0 if z <= -2.2e+104: tmp = -x elif z <= -4.6e+43: tmp = t_0 elif z <= -1.0: tmp = -x elif z <= -3.7e-196: tmp = x / z elif z <= -1.5e-243: tmp = t_0 elif z <= 1.4e-14: tmp = x / z elif z <= 8.5e+15: tmp = t_0 else: tmp = -x return tmp
function code(x, y, z) t_0 = Float64(x * Float64(y / z)) tmp = 0.0 if (z <= -2.2e+104) tmp = Float64(-x); elseif (z <= -4.6e+43) tmp = t_0; elseif (z <= -1.0) tmp = Float64(-x); elseif (z <= -3.7e-196) tmp = Float64(x / z); elseif (z <= -1.5e-243) tmp = t_0; elseif (z <= 1.4e-14) tmp = Float64(x / z); elseif (z <= 8.5e+15) tmp = t_0; else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (y / z); tmp = 0.0; if (z <= -2.2e+104) tmp = -x; elseif (z <= -4.6e+43) tmp = t_0; elseif (z <= -1.0) tmp = -x; elseif (z <= -3.7e-196) tmp = x / z; elseif (z <= -1.5e-243) tmp = t_0; elseif (z <= 1.4e-14) tmp = x / z; elseif (z <= 8.5e+15) tmp = t_0; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+104], (-x), If[LessEqual[z, -4.6e+43], t$95$0, If[LessEqual[z, -1.0], (-x), If[LessEqual[z, -3.7e-196], N[(x / z), $MachinePrecision], If[LessEqual[z, -1.5e-243], t$95$0, If[LessEqual[z, 1.4e-14], N[(x / z), $MachinePrecision], If[LessEqual[z, 8.5e+15], t$95$0, (-x)]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+104}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{+43}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -3.7 \cdot 10^{-196}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-243}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-14}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+15}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -2.2e104 or -4.6000000000000005e43 < z < -1 or 8.5e15 < z Initial program 69.7%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 76.7%
neg-mul-176.7%
Simplified76.7%
if -2.2e104 < z < -4.6000000000000005e43 or -3.7000000000000001e-196 < z < -1.5000000000000001e-243 or 1.4e-14 < z < 8.5e15Initial program 96.2%
associate-/l*99.7%
+-commutative99.7%
associate-+r-99.7%
div-sub99.7%
*-inverses99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 75.8%
associate-/l*75.8%
Simplified75.8%
if -1 < z < -3.7000000000000001e-196 or -1.5000000000000001e-243 < z < 1.4e-14Initial program 99.9%
Taylor expanded in y around 0 62.1%
Taylor expanded in z around 0 61.2%
Final simplification69.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= z -1.2e+78)
(- x)
(if (<= z -3.8e+40)
t_0
(if (<= z -1.0)
(- x)
(if (<= z -3.4e-53)
(/ x z)
(if (<= z 7.2e-178)
t_0
(if (<= z 1.2e-14)
(/ x z)
(if (<= z 6.5e+18) (* x (/ y z)) (- x))))))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -1.2e+78) {
tmp = -x;
} else if (z <= -3.8e+40) {
tmp = t_0;
} else if (z <= -1.0) {
tmp = -x;
} else if (z <= -3.4e-53) {
tmp = x / z;
} else if (z <= 7.2e-178) {
tmp = t_0;
} else if (z <= 1.2e-14) {
tmp = x / z;
} else if (z <= 6.5e+18) {
tmp = x * (y / z);
} else {
tmp = -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) :: t_0
real(8) :: tmp
t_0 = y * (x / z)
if (z <= (-1.2d+78)) then
tmp = -x
else if (z <= (-3.8d+40)) then
tmp = t_0
else if (z <= (-1.0d0)) then
tmp = -x
else if (z <= (-3.4d-53)) then
tmp = x / z
else if (z <= 7.2d-178) then
tmp = t_0
else if (z <= 1.2d-14) then
tmp = x / z
else if (z <= 6.5d+18) then
tmp = x * (y / z)
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -1.2e+78) {
tmp = -x;
} else if (z <= -3.8e+40) {
tmp = t_0;
} else if (z <= -1.0) {
tmp = -x;
} else if (z <= -3.4e-53) {
tmp = x / z;
} else if (z <= 7.2e-178) {
tmp = t_0;
} else if (z <= 1.2e-14) {
tmp = x / z;
} else if (z <= 6.5e+18) {
tmp = x * (y / z);
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) tmp = 0 if z <= -1.2e+78: tmp = -x elif z <= -3.8e+40: tmp = t_0 elif z <= -1.0: tmp = -x elif z <= -3.4e-53: tmp = x / z elif z <= 7.2e-178: tmp = t_0 elif z <= 1.2e-14: tmp = x / z elif z <= 6.5e+18: tmp = x * (y / z) else: tmp = -x return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x / z)) tmp = 0.0 if (z <= -1.2e+78) tmp = Float64(-x); elseif (z <= -3.8e+40) tmp = t_0; elseif (z <= -1.0) tmp = Float64(-x); elseif (z <= -3.4e-53) tmp = Float64(x / z); elseif (z <= 7.2e-178) tmp = t_0; elseif (z <= 1.2e-14) tmp = Float64(x / z); elseif (z <= 6.5e+18) tmp = Float64(x * Float64(y / z)); else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x / z); tmp = 0.0; if (z <= -1.2e+78) tmp = -x; elseif (z <= -3.8e+40) tmp = t_0; elseif (z <= -1.0) tmp = -x; elseif (z <= -3.4e-53) tmp = x / z; elseif (z <= 7.2e-178) tmp = t_0; elseif (z <= 1.2e-14) tmp = x / z; elseif (z <= 6.5e+18) tmp = x * (y / z); else tmp = -x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e+78], (-x), If[LessEqual[z, -3.8e+40], t$95$0, If[LessEqual[z, -1.0], (-x), If[LessEqual[z, -3.4e-53], N[(x / z), $MachinePrecision], If[LessEqual[z, 7.2e-178], t$95$0, If[LessEqual[z, 1.2e-14], N[(x / z), $MachinePrecision], If[LessEqual[z, 6.5e+18], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], (-x)]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+78}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{+40}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-53}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-178}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-14}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+18}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -1.1999999999999999e78 or -3.80000000000000004e40 < z < -1 or 6.5e18 < z Initial program 69.9%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 75.8%
neg-mul-175.8%
Simplified75.8%
if -1.1999999999999999e78 < z < -3.80000000000000004e40 or -3.4e-53 < z < 7.19999999999999987e-178Initial program 99.9%
associate-/l*91.3%
+-commutative91.3%
associate-+r-91.3%
div-sub91.3%
*-inverses91.3%
sub-neg91.3%
metadata-eval91.3%
+-commutative91.3%
Simplified91.3%
Taylor expanded in y around inf 61.9%
*-commutative61.9%
associate-/l*67.3%
Applied egg-rr67.3%
if -1 < z < -3.4e-53 or 7.19999999999999987e-178 < z < 1.2e-14Initial program 99.8%
Taylor expanded in y around 0 68.2%
Taylor expanded in z around 0 65.7%
if 1.2e-14 < z < 6.5e18Initial program 99.4%
associate-/l*99.6%
+-commutative99.6%
associate-+r-99.6%
div-sub99.4%
*-inverses99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in y around inf 75.8%
associate-/l*76.0%
Simplified76.0%
Final simplification71.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -1e-16) (not (<= z 4e-17))) (* x (+ (/ (+ y 1.0) z) -1.0)) (/ (+ x (* x y)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1e-16) || !(z <= 4e-17)) {
tmp = x * (((y + 1.0) / z) + -1.0);
} else {
tmp = (x + (x * 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 <= (-1d-16)) .or. (.not. (z <= 4d-17))) then
tmp = x * (((y + 1.0d0) / z) + (-1.0d0))
else
tmp = (x + (x * y)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1e-16) || !(z <= 4e-17)) {
tmp = x * (((y + 1.0) / z) + -1.0);
} else {
tmp = (x + (x * y)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1e-16) or not (z <= 4e-17): tmp = x * (((y + 1.0) / z) + -1.0) else: tmp = (x + (x * y)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1e-16) || !(z <= 4e-17)) tmp = Float64(x * Float64(Float64(Float64(y + 1.0) / z) + -1.0)); else tmp = Float64(Float64(x + Float64(x * y)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1e-16) || ~((z <= 4e-17))) tmp = x * (((y + 1.0) / z) + -1.0); else tmp = (x + (x * y)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1e-16], N[Not[LessEqual[z, 4e-17]], $MachinePrecision]], N[(x * N[(N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-16} \lor \neg \left(z \leq 4 \cdot 10^{-17}\right):\\
\;\;\;\;x \cdot \left(\frac{y + 1}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + x \cdot y}{z}\\
\end{array}
\end{array}
if z < -9.9999999999999998e-17 or 4.00000000000000029e-17 < z Initial program 74.5%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
if -9.9999999999999998e-17 < z < 4.00000000000000029e-17Initial program 99.9%
distribute-lft-in99.9%
fma-define99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in z around 0 99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.0) (not (<= y 1.0))) (* x (+ -1.0 (/ y z))) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.0) || !(y <= 1.0)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (x / z) - x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-1.0d0)) .or. (.not. (y <= 1.0d0))) then
tmp = x * ((-1.0d0) + (y / z))
else
tmp = (x / z) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.0) || !(y <= 1.0)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.0) or not (y <= 1.0): tmp = x * (-1.0 + (y / z)) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.0) || !(y <= 1.0)) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); else tmp = Float64(Float64(x / z) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.0) || ~((y <= 1.0))) tmp = x * (-1.0 + (y / z)); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 1.0]], $MachinePrecision]], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -1 or 1 < y Initial program 86.9%
associate-/l*90.7%
+-commutative90.7%
associate-+r-90.7%
div-sub90.8%
*-inverses90.8%
sub-neg90.8%
metadata-eval90.8%
+-commutative90.8%
Simplified90.8%
Taylor expanded in y around inf 90.4%
if -1 < y < 1Initial program 85.7%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 98.1%
sub-neg98.1%
metadata-eval98.1%
distribute-rgt-in98.2%
associate-*l/98.3%
*-lft-identity98.3%
neg-mul-198.3%
unsub-neg98.3%
Simplified98.3%
Final simplification94.5%
(FPCore (x y z) :precision binary64 (if (<= y -1.0) (* x (+ -1.0 (/ y z))) (if (<= y 1.0) (- (/ x z) x) (- (/ x (/ z y)) x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.0) {
tmp = x * (-1.0 + (y / z));
} else if (y <= 1.0) {
tmp = (x / z) - x;
} else {
tmp = (x / (z / y)) - x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1.0d0)) then
tmp = x * ((-1.0d0) + (y / z))
else if (y <= 1.0d0) then
tmp = (x / z) - x
else
tmp = (x / (z / y)) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.0) {
tmp = x * (-1.0 + (y / z));
} else if (y <= 1.0) {
tmp = (x / z) - x;
} else {
tmp = (x / (z / y)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.0: tmp = x * (-1.0 + (y / z)) elif y <= 1.0: tmp = (x / z) - x else: tmp = (x / (z / y)) - x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.0) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); elseif (y <= 1.0) tmp = Float64(Float64(x / z) - x); else tmp = Float64(Float64(x / Float64(z / y)) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.0) tmp = x * (-1.0 + (y / z)); elseif (y <= 1.0) tmp = (x / z) - x; else tmp = (x / (z / y)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.0], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}} - x\\
\end{array}
\end{array}
if y < -1Initial program 87.8%
associate-/l*86.4%
+-commutative86.4%
associate-+r-86.4%
div-sub86.4%
*-inverses86.4%
sub-neg86.4%
metadata-eval86.4%
+-commutative86.4%
Simplified86.4%
Taylor expanded in y around inf 86.4%
if -1 < y < 1Initial program 85.7%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 98.1%
sub-neg98.1%
metadata-eval98.1%
distribute-rgt-in98.2%
associate-*l/98.3%
*-lft-identity98.3%
neg-mul-198.3%
unsub-neg98.3%
Simplified98.3%
if 1 < y Initial program 85.9%
associate-/l*95.2%
+-commutative95.2%
associate-+r-95.2%
div-sub95.2%
*-inverses95.2%
sub-neg95.2%
metadata-eval95.2%
+-commutative95.2%
Simplified95.2%
Taylor expanded in y around inf 94.6%
distribute-rgt-in94.6%
neg-mul-194.6%
unsub-neg94.6%
clear-num94.4%
associate-*l/95.3%
*-un-lft-identity95.3%
Applied egg-rr95.3%
Final simplification94.7%
(FPCore (x y z) :precision binary64 (if (<= z -0.95) (* x (+ -1.0 (/ y z))) (if (<= z 0.0063) (/ (+ x (* x y)) z) (- (/ x (/ z y)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.95) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 0.0063) {
tmp = (x + (x * y)) / z;
} else {
tmp = (x / (z / y)) - 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 <= (-0.95d0)) then
tmp = x * ((-1.0d0) + (y / z))
else if (z <= 0.0063d0) then
tmp = (x + (x * y)) / z
else
tmp = (x / (z / y)) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.95) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 0.0063) {
tmp = (x + (x * y)) / z;
} else {
tmp = (x / (z / y)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.95: tmp = x * (-1.0 + (y / z)) elif z <= 0.0063: tmp = (x + (x * y)) / z else: tmp = (x / (z / y)) - x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.95) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); elseif (z <= 0.0063) tmp = Float64(Float64(x + Float64(x * y)) / z); else tmp = Float64(Float64(x / Float64(z / y)) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.95) tmp = x * (-1.0 + (y / z)); elseif (z <= 0.0063) tmp = (x + (x * y)) / z; else tmp = (x / (z / y)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.95], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.0063], N[(N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.95:\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 0.0063:\\
\;\;\;\;\frac{x + x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}} - x\\
\end{array}
\end{array}
if z < -0.94999999999999996Initial program 76.8%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 96.1%
if -0.94999999999999996 < z < 0.0063Initial program 99.9%
distribute-lft-in99.9%
fma-define99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in z around 0 98.6%
if 0.0063 < z Initial program 69.4%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 99.7%
distribute-rgt-in99.8%
neg-mul-199.8%
unsub-neg99.8%
clear-num99.8%
associate-*l/99.8%
*-un-lft-identity99.8%
Applied egg-rr99.8%
Final simplification98.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -5.3e+22) (not (<= y 3.05e+33))) (* y (/ x z)) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -5.3e+22) || !(y <= 3.05e+33)) {
tmp = y * (x / z);
} else {
tmp = (x / 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 <= (-5.3d+22)) .or. (.not. (y <= 3.05d+33))) then
tmp = y * (x / z)
else
tmp = (x / z) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -5.3e+22) || !(y <= 3.05e+33)) {
tmp = y * (x / z);
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -5.3e+22) or not (y <= 3.05e+33): tmp = y * (x / z) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -5.3e+22) || !(y <= 3.05e+33)) tmp = Float64(y * Float64(x / z)); else tmp = Float64(Float64(x / z) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -5.3e+22) || ~((y <= 3.05e+33))) tmp = y * (x / z); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -5.3e+22], N[Not[LessEqual[y, 3.05e+33]], $MachinePrecision]], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.3 \cdot 10^{+22} \lor \neg \left(y \leq 3.05 \cdot 10^{+33}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -5.2999999999999998e22 or 3.0500000000000002e33 < y Initial program 87.6%
associate-/l*90.1%
+-commutative90.1%
associate-+r-90.1%
div-sub90.1%
*-inverses90.1%
sub-neg90.1%
metadata-eval90.1%
+-commutative90.1%
Simplified90.1%
Taylor expanded in y around inf 73.4%
*-commutative73.4%
associate-/l*77.2%
Applied egg-rr77.2%
if -5.2999999999999998e22 < y < 3.0500000000000002e33Initial program 85.2%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 96.5%
sub-neg96.5%
metadata-eval96.5%
distribute-rgt-in96.6%
associate-*l/96.7%
*-lft-identity96.7%
neg-mul-196.7%
unsub-neg96.7%
Simplified96.7%
Final simplification87.9%
(FPCore (x y z) :precision binary64 (if (<= x 4e+28) (/ (* x (+ (- y z) 1.0)) z) (* x (+ (/ (+ y 1.0) z) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4e+28) {
tmp = (x * ((y - z) + 1.0)) / z;
} else {
tmp = x * (((y + 1.0) / z) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 4d+28) then
tmp = (x * ((y - z) + 1.0d0)) / z
else
tmp = x * (((y + 1.0d0) / z) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 4e+28) {
tmp = (x * ((y - z) + 1.0)) / z;
} else {
tmp = x * (((y + 1.0) / z) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 4e+28: tmp = (x * ((y - z) + 1.0)) / z else: tmp = x * (((y + 1.0) / z) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 4e+28) tmp = Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z); else tmp = Float64(x * Float64(Float64(Float64(y + 1.0) / z) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 4e+28) tmp = (x * ((y - z) + 1.0)) / z; else tmp = x * (((y + 1.0) / z) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 4e+28], N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x * N[(N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4 \cdot 10^{+28}:\\
\;\;\;\;\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y + 1}{z} + -1\right)\\
\end{array}
\end{array}
if x < 3.99999999999999983e28Initial program 90.5%
if 3.99999999999999983e28 < x Initial program 65.3%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Final simplification92.1%
(FPCore (x y z) :precision binary64 (if (<= x 8.2e-75) (/ (* x (+ (- y z) 1.0)) z) (- (/ x (/ z (+ y 1.0))) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 8.2e-75) {
tmp = (x * ((y - z) + 1.0)) / z;
} else {
tmp = (x / (z / (y + 1.0))) - 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 <= 8.2d-75) then
tmp = (x * ((y - z) + 1.0d0)) / z
else
tmp = (x / (z / (y + 1.0d0))) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 8.2e-75) {
tmp = (x * ((y - z) + 1.0)) / z;
} else {
tmp = (x / (z / (y + 1.0))) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 8.2e-75: tmp = (x * ((y - z) + 1.0)) / z else: tmp = (x / (z / (y + 1.0))) - x return tmp
function code(x, y, z) tmp = 0.0 if (x <= 8.2e-75) tmp = Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z); else tmp = Float64(Float64(x / Float64(z / Float64(y + 1.0))) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 8.2e-75) tmp = (x * ((y - z) + 1.0)) / z; else tmp = (x / (z / (y + 1.0))) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 8.2e-75], N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / N[(z / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.2 \cdot 10^{-75}:\\
\;\;\;\;\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + 1}} - x\\
\end{array}
\end{array}
if x < 8.20000000000000005e-75Initial program 89.6%
if 8.20000000000000005e-75 < x Initial program 76.2%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
distribute-lft-in99.9%
clear-num99.8%
un-div-inv99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Final simplification92.1%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 2400000000.0))) (- x) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 2400000000.0)) {
tmp = -x;
} else {
tmp = 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 <= (-1.0d0)) .or. (.not. (z <= 2400000000.0d0))) then
tmp = -x
else
tmp = x / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 2400000000.0)) {
tmp = -x;
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 2400000000.0): tmp = -x else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 2400000000.0)) tmp = Float64(-x); else tmp = Float64(x / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 2400000000.0))) tmp = -x; else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 2400000000.0]], $MachinePrecision]], (-x), N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 2400000000\right):\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if z < -1 or 2.4e9 < z Initial program 72.5%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 71.7%
neg-mul-171.7%
Simplified71.7%
if -1 < z < 2.4e9Initial program 99.9%
Taylor expanded in y around 0 58.0%
Taylor expanded in z around 0 56.7%
Final simplification64.1%
(FPCore (x y z) :precision binary64 (- x))
double code(double x, double y, double z) {
return -x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = -x
end function
public static double code(double x, double y, double z) {
return -x;
}
def code(x, y, z): return -x
function code(x, y, z) return Float64(-x) end
function tmp = code(x, y, z) tmp = -x; end
code[x_, y_, z_] := (-x)
\begin{array}{l}
\\
-x
\end{array}
Initial program 86.3%
associate-/l*95.4%
+-commutative95.4%
associate-+r-95.4%
div-sub95.4%
*-inverses95.4%
sub-neg95.4%
metadata-eval95.4%
+-commutative95.4%
Simplified95.4%
Taylor expanded in z around inf 37.3%
neg-mul-137.3%
Simplified37.3%
Final simplification37.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (* (+ 1.0 y) (/ x z)) x)))
(if (< x -2.71483106713436e-162)
t_0
(if (< x 3.874108816439546e-197)
(* (* x (+ (- y z) 1.0)) (/ 1.0 z))
t_0))))
double code(double x, double y, double z) {
double t_0 = ((1.0 + y) * (x / z)) - x;
double tmp;
if (x < -2.71483106713436e-162) {
tmp = t_0;
} else if (x < 3.874108816439546e-197) {
tmp = (x * ((y - z) + 1.0)) * (1.0 / z);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((1.0d0 + y) * (x / z)) - x
if (x < (-2.71483106713436d-162)) then
tmp = t_0
else if (x < 3.874108816439546d-197) then
tmp = (x * ((y - z) + 1.0d0)) * (1.0d0 / z)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((1.0 + y) * (x / z)) - x;
double tmp;
if (x < -2.71483106713436e-162) {
tmp = t_0;
} else if (x < 3.874108816439546e-197) {
tmp = (x * ((y - z) + 1.0)) * (1.0 / z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((1.0 + y) * (x / z)) - x tmp = 0 if x < -2.71483106713436e-162: tmp = t_0 elif x < 3.874108816439546e-197: tmp = (x * ((y - z) + 1.0)) * (1.0 / z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(1.0 + y) * Float64(x / z)) - x) tmp = 0.0 if (x < -2.71483106713436e-162) tmp = t_0; elseif (x < 3.874108816439546e-197) tmp = Float64(Float64(x * Float64(Float64(y - z) + 1.0)) * Float64(1.0 / z)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((1.0 + y) * (x / z)) - x; tmp = 0.0; if (x < -2.71483106713436e-162) tmp = t_0; elseif (x < 3.874108816439546e-197) tmp = (x * ((y - z) + 1.0)) * (1.0 / z); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(1.0 + y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]}, If[Less[x, -2.71483106713436e-162], t$95$0, If[Less[x, 3.874108816439546e-197], N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 + y\right) \cdot \frac{x}{z} - x\\
\mathbf{if}\;x < -2.71483106713436 \cdot 10^{-162}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x < 3.874108816439546 \cdot 10^{-197}:\\
\;\;\;\;\left(x \cdot \left(\left(y - z\right) + 1\right)\right) \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
herbie shell --seed 2024039
(FPCore (x y z)
:name "Diagrams.TwoD.Segment.Bernstein:evaluateBernstein from diagrams-lib-1.3.0.3"
:precision binary64
:herbie-target
(if (< x -2.71483106713436e-162) (- (* (+ 1.0 y) (/ x z)) x) (if (< x 3.874108816439546e-197) (* (* x (+ (- y z) 1.0)) (/ 1.0 z)) (- (* (+ 1.0 y) (/ x z)) x)))
(/ (* x (+ (- y z) 1.0)) z))