
(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 14 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 -1.8e+22) (- (* x (/ y z)) x) (if (<= z 6.5e-13) (* (/ x z) (+ 1.0 (- y z))) (- (/ x (/ z y)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.8e+22) {
tmp = (x * (y / z)) - x;
} else if (z <= 6.5e-13) {
tmp = (x / z) * (1.0 + (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 <= (-1.8d+22)) then
tmp = (x * (y / z)) - x
else if (z <= 6.5d-13) then
tmp = (x / z) * (1.0d0 + (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 <= -1.8e+22) {
tmp = (x * (y / z)) - x;
} else if (z <= 6.5e-13) {
tmp = (x / z) * (1.0 + (y - z));
} else {
tmp = (x / (z / y)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.8e+22: tmp = (x * (y / z)) - x elif z <= 6.5e-13: tmp = (x / z) * (1.0 + (y - z)) else: tmp = (x / (z / y)) - x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.8e+22) tmp = Float64(Float64(x * Float64(y / z)) - x); elseif (z <= 6.5e-13) tmp = Float64(Float64(x / z) * Float64(1.0 + Float64(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 <= -1.8e+22) tmp = (x * (y / z)) - x; elseif (z <= 6.5e-13) tmp = (x / z) * (1.0 + (y - z)); else tmp = (x / (z / y)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.8e+22], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[z, 6.5e-13], N[(N[(x / z), $MachinePrecision] * N[(1.0 + N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+22}:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-13}:\\
\;\;\;\;\frac{x}{z} \cdot \left(1 + \left(y - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}} - x\\
\end{array}
\end{array}
if z < -1.8e22Initial program 76.0%
Taylor expanded in x around 0 76.0%
associate--l+76.0%
+-commutative76.0%
associate-*r/100.0%
+-commutative100.0%
associate--l+100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
distribute-rgt-in100.0%
neg-mul-1100.0%
unsub-neg100.0%
div-inv99.9%
associate-*l*99.2%
associate-/r/98.8%
clear-num99.3%
Applied egg-rr99.3%
Taylor expanded in y around inf 93.6%
associate-*r/100.0%
Simplified100.0%
if -1.8e22 < z < 6.49999999999999957e-13Initial program 99.9%
associate-/l*94.3%
associate-/r/99.9%
Applied egg-rr99.9%
if 6.49999999999999957e-13 < z Initial program 79.2%
Taylor expanded in x around 0 79.2%
associate--l+79.2%
+-commutative79.2%
associate-*r/99.8%
+-commutative99.8%
associate--l+99.8%
div-sub99.8%
sub-neg99.8%
*-inverses99.8%
metadata-eval99.8%
Simplified99.8%
distribute-rgt-in99.8%
neg-mul-199.8%
unsub-neg99.8%
div-inv99.8%
associate-*l*95.9%
associate-/r/95.6%
clear-num95.9%
Applied egg-rr95.9%
Taylor expanded in y around inf 92.8%
associate-*r/99.8%
Simplified99.8%
associate-*r/92.8%
associate-/l*99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= z -2.85e+35)
(- x)
(if (<= z 7.3e-102)
t_0
(if (<= z 7e-25) (/ x z) (if (<= z 2.55e+16) t_0 (- x)))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -2.85e+35) {
tmp = -x;
} else if (z <= 7.3e-102) {
tmp = t_0;
} else if (z <= 7e-25) {
tmp = x / z;
} else if (z <= 2.55e+16) {
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 = y * (x / z)
if (z <= (-2.85d+35)) then
tmp = -x
else if (z <= 7.3d-102) then
tmp = t_0
else if (z <= 7d-25) then
tmp = x / z
else if (z <= 2.55d+16) 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 = y * (x / z);
double tmp;
if (z <= -2.85e+35) {
tmp = -x;
} else if (z <= 7.3e-102) {
tmp = t_0;
} else if (z <= 7e-25) {
tmp = x / z;
} else if (z <= 2.55e+16) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) tmp = 0 if z <= -2.85e+35: tmp = -x elif z <= 7.3e-102: tmp = t_0 elif z <= 7e-25: tmp = x / z elif z <= 2.55e+16: tmp = t_0 else: tmp = -x return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x / z)) tmp = 0.0 if (z <= -2.85e+35) tmp = Float64(-x); elseif (z <= 7.3e-102) tmp = t_0; elseif (z <= 7e-25) tmp = Float64(x / z); elseif (z <= 2.55e+16) tmp = t_0; 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 <= -2.85e+35) tmp = -x; elseif (z <= 7.3e-102) tmp = t_0; elseif (z <= 7e-25) tmp = x / z; elseif (z <= 2.55e+16) tmp = t_0; 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, -2.85e+35], (-x), If[LessEqual[z, 7.3e-102], t$95$0, If[LessEqual[z, 7e-25], N[(x / z), $MachinePrecision], If[LessEqual[z, 2.55e+16], t$95$0, (-x)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -2.85 \cdot 10^{+35}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq 7.3 \cdot 10^{-102}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-25}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{+16}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -2.84999999999999997e35 or 2.55e16 < z Initial program 76.0%
Taylor expanded in z around inf 80.9%
mul-1-neg80.9%
Simplified80.9%
if -2.84999999999999997e35 < z < 7.29999999999999973e-102 or 7.0000000000000004e-25 < z < 2.55e16Initial program 99.9%
Taylor expanded in y around inf 63.9%
*-commutative63.9%
associate-/l*66.9%
Simplified66.9%
clear-num66.9%
associate-/r/67.6%
clear-num67.7%
Applied egg-rr67.7%
if 7.29999999999999973e-102 < z < 7.0000000000000004e-25Initial program 99.9%
Taylor expanded in y around 0 69.6%
associate-/l*69.6%
Simplified69.6%
Taylor expanded in z around 0 69.6%
Final simplification73.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -5e-7) (not (<= z 5.8e-160))) (* x (+ (/ (+ 1.0 y) z) -1.0)) (/ (+ x (* y x)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5e-7) || !(z <= 5.8e-160)) {
tmp = x * (((1.0 + y) / z) + -1.0);
} else {
tmp = (x + (y * x)) / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-5d-7)) .or. (.not. (z <= 5.8d-160))) then
tmp = x * (((1.0d0 + y) / z) + (-1.0d0))
else
tmp = (x + (y * x)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -5e-7) || !(z <= 5.8e-160)) {
tmp = x * (((1.0 + y) / z) + -1.0);
} else {
tmp = (x + (y * x)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5e-7) or not (z <= 5.8e-160): tmp = x * (((1.0 + y) / z) + -1.0) else: tmp = (x + (y * x)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5e-7) || !(z <= 5.8e-160)) tmp = Float64(x * Float64(Float64(Float64(1.0 + y) / z) + -1.0)); else tmp = Float64(Float64(x + Float64(y * x)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5e-7) || ~((z <= 5.8e-160))) tmp = x * (((1.0 + y) / z) + -1.0); else tmp = (x + (y * x)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5e-7], N[Not[LessEqual[z, 5.8e-160]], $MachinePrecision]], N[(x * N[(N[(N[(1.0 + y), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-7} \lor \neg \left(z \leq 5.8 \cdot 10^{-160}\right):\\
\;\;\;\;x \cdot \left(\frac{1 + y}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot x}{z}\\
\end{array}
\end{array}
if z < -4.99999999999999977e-7 or 5.7999999999999998e-160 < z Initial program 83.1%
Taylor expanded in x around 0 83.1%
associate--l+83.1%
+-commutative83.1%
associate-*r/99.9%
+-commutative99.9%
associate--l+99.9%
div-sub99.9%
sub-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
if -4.99999999999999977e-7 < z < 5.7999999999999998e-160Initial program 99.9%
distribute-lft-in99.9%
fma-def99.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 (+ (/ y z) -1.0)) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.0) || !(y <= 1.0)) {
tmp = x * ((y / z) + -1.0);
} 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 * ((y / z) + (-1.0d0))
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 * ((y / z) + -1.0);
} 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 * ((y / z) + -1.0) 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(Float64(y / z) + -1.0)); 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 * ((y / z) + -1.0); 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[(N[(y / z), $MachinePrecision] + -1.0), $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(\frac{y}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -1 or 1 < y Initial program 89.3%
Taylor expanded in x around 0 89.3%
associate--l+89.3%
+-commutative89.3%
associate-*r/93.4%
+-commutative93.4%
associate--l+93.4%
div-sub93.4%
sub-neg93.4%
*-inverses93.4%
metadata-eval93.4%
Simplified93.4%
Taylor expanded in y around inf 93.4%
if -1 < y < 1Initial program 88.6%
Taylor expanded in x around 0 88.6%
associate--l+88.6%
+-commutative88.6%
associate-*r/99.9%
+-commutative99.9%
associate--l+99.9%
div-sub99.9%
sub-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 99.4%
sub-neg99.4%
metadata-eval99.4%
distribute-rgt-in99.4%
associate-*l/99.5%
*-lft-identity99.5%
neg-mul-199.5%
unsub-neg99.5%
Simplified99.5%
Final simplification96.4%
(FPCore (x y z) :precision binary64 (if (<= y -1.0) (* x (+ (/ y z) -1.0)) (if (<= y 1.0) (- (/ x z) x) (- (* x (/ y z)) x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.0) {
tmp = x * ((y / z) + -1.0);
} else if (y <= 1.0) {
tmp = (x / z) - x;
} else {
tmp = (x * (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 <= (-1.0d0)) then
tmp = x * ((y / z) + (-1.0d0))
else if (y <= 1.0d0) then
tmp = (x / z) - x
else
tmp = (x * (y / z)) - 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 * ((y / z) + -1.0);
} else if (y <= 1.0) {
tmp = (x / z) - x;
} else {
tmp = (x * (y / z)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.0: tmp = x * ((y / z) + -1.0) elif y <= 1.0: tmp = (x / z) - x else: tmp = (x * (y / z)) - x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.0) tmp = Float64(x * Float64(Float64(y / z) + -1.0)); elseif (y <= 1.0) tmp = Float64(Float64(x / z) - x); else tmp = Float64(Float64(x * Float64(y / z)) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.0) tmp = x * ((y / z) + -1.0); elseif (y <= 1.0) tmp = (x / z) - x; else tmp = (x * (y / z)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.0], N[(x * N[(N[(y / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + -1\right)\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\end{array}
\end{array}
if y < -1Initial program 93.9%
Taylor expanded in x around 0 93.9%
associate--l+93.9%
+-commutative93.9%
associate-*r/93.7%
+-commutative93.7%
associate--l+93.7%
div-sub93.7%
sub-neg93.7%
*-inverses93.7%
metadata-eval93.7%
Simplified93.7%
Taylor expanded in y around inf 93.7%
if -1 < y < 1Initial program 88.6%
Taylor expanded in x around 0 88.6%
associate--l+88.6%
+-commutative88.6%
associate-*r/99.9%
+-commutative99.9%
associate--l+99.9%
div-sub99.9%
sub-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 99.4%
sub-neg99.4%
metadata-eval99.4%
distribute-rgt-in99.4%
associate-*l/99.5%
*-lft-identity99.5%
neg-mul-199.5%
unsub-neg99.5%
Simplified99.5%
if 1 < y Initial program 85.2%
Taylor expanded in x around 0 85.2%
associate--l+85.2%
+-commutative85.2%
associate-*r/93.2%
+-commutative93.2%
associate--l+93.2%
div-sub93.2%
sub-neg93.2%
*-inverses93.2%
metadata-eval93.2%
Simplified93.2%
distribute-rgt-in93.2%
neg-mul-193.2%
unsub-neg93.2%
div-inv93.2%
associate-*l*98.5%
associate-/r/98.2%
clear-num98.6%
Applied egg-rr98.6%
Taylor expanded in y around inf 91.8%
associate-*r/93.2%
Simplified93.2%
Final simplification96.4%
(FPCore (x y z) :precision binary64 (if (<= y -1.0) (- (/ x (/ z y)) x) (if (<= y 1.0) (- (/ x z) x) (- (* x (/ y z)) x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.0) {
tmp = (x / (z / y)) - x;
} else if (y <= 1.0) {
tmp = (x / z) - x;
} else {
tmp = (x * (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 <= (-1.0d0)) then
tmp = (x / (z / y)) - x
else if (y <= 1.0d0) then
tmp = (x / z) - x
else
tmp = (x * (y / z)) - 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 / (z / y)) - x;
} else if (y <= 1.0) {
tmp = (x / z) - x;
} else {
tmp = (x * (y / z)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.0: tmp = (x / (z / y)) - x elif y <= 1.0: tmp = (x / z) - x else: tmp = (x * (y / z)) - x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.0) tmp = Float64(Float64(x / Float64(z / y)) - x); elseif (y <= 1.0) tmp = Float64(Float64(x / z) - x); else tmp = Float64(Float64(x * Float64(y / z)) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.0) tmp = (x / (z / y)) - x; elseif (y <= 1.0) tmp = (x / z) - x; else tmp = (x * (y / z)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.0], N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[y, 1.0], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;\frac{x}{\frac{z}{y}} - x\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\end{array}
\end{array}
if y < -1Initial program 93.9%
Taylor expanded in x around 0 93.9%
associate--l+93.9%
+-commutative93.9%
associate-*r/93.7%
+-commutative93.7%
associate--l+93.7%
div-sub93.7%
sub-neg93.7%
*-inverses93.7%
metadata-eval93.7%
Simplified93.7%
distribute-rgt-in93.6%
neg-mul-193.6%
unsub-neg93.6%
div-inv93.6%
associate-*l*96.1%
associate-/r/95.8%
clear-num96.2%
Applied egg-rr96.2%
Taylor expanded in y around inf 95.2%
associate-*r/93.6%
Simplified93.6%
associate-*r/95.2%
associate-/l*95.6%
Applied egg-rr95.6%
if -1 < y < 1Initial program 88.6%
Taylor expanded in x around 0 88.6%
associate--l+88.6%
+-commutative88.6%
associate-*r/99.9%
+-commutative99.9%
associate--l+99.9%
div-sub99.9%
sub-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 99.4%
sub-neg99.4%
metadata-eval99.4%
distribute-rgt-in99.4%
associate-*l/99.5%
*-lft-identity99.5%
neg-mul-199.5%
unsub-neg99.5%
Simplified99.5%
if 1 < y Initial program 85.2%
Taylor expanded in x around 0 85.2%
associate--l+85.2%
+-commutative85.2%
associate-*r/93.2%
+-commutative93.2%
associate--l+93.2%
div-sub93.2%
sub-neg93.2%
*-inverses93.2%
metadata-eval93.2%
Simplified93.2%
distribute-rgt-in93.2%
neg-mul-193.2%
unsub-neg93.2%
div-inv93.2%
associate-*l*98.5%
associate-/r/98.2%
clear-num98.6%
Applied egg-rr98.6%
Taylor expanded in y around inf 91.8%
associate-*r/93.2%
Simplified93.2%
Final simplification96.8%
(FPCore (x y z) :precision binary64 (if (<= z -0.34) (- (* x (/ y z)) x) (if (<= z 6.5e-13) (/ (+ x (* y x)) z) (- (/ x (/ z y)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.34) {
tmp = (x * (y / z)) - x;
} else if (z <= 6.5e-13) {
tmp = (x + (y * 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 <= (-0.34d0)) then
tmp = (x * (y / z)) - x
else if (z <= 6.5d-13) then
tmp = (x + (y * 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 <= -0.34) {
tmp = (x * (y / z)) - x;
} else if (z <= 6.5e-13) {
tmp = (x + (y * x)) / z;
} else {
tmp = (x / (z / y)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.34: tmp = (x * (y / z)) - x elif z <= 6.5e-13: tmp = (x + (y * x)) / z else: tmp = (x / (z / y)) - x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.34) tmp = Float64(Float64(x * Float64(y / z)) - x); elseif (z <= 6.5e-13) tmp = Float64(Float64(x + Float64(y * 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 <= -0.34) tmp = (x * (y / z)) - x; elseif (z <= 6.5e-13) tmp = (x + (y * x)) / z; else tmp = (x / (z / y)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.34], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[z, 6.5e-13], N[(N[(x + N[(y * x), $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.34:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-13}:\\
\;\;\;\;\frac{x + y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}} - x\\
\end{array}
\end{array}
if z < -0.340000000000000024Initial program 79.1%
Taylor expanded in x around 0 79.1%
associate--l+79.1%
+-commutative79.1%
associate-*r/100.0%
+-commutative100.0%
associate--l+100.0%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
distribute-rgt-in100.0%
neg-mul-1100.0%
unsub-neg100.0%
div-inv99.9%
associate-*l*99.3%
associate-/r/98.9%
clear-num99.3%
Applied egg-rr99.3%
Taylor expanded in y around inf 92.0%
associate-*r/97.6%
Simplified97.6%
if -0.340000000000000024 < z < 6.49999999999999957e-13Initial program 99.9%
distribute-lft-in99.9%
fma-def99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in z around 0 99.4%
if 6.49999999999999957e-13 < z Initial program 79.2%
Taylor expanded in x around 0 79.2%
associate--l+79.2%
+-commutative79.2%
associate-*r/99.8%
+-commutative99.8%
associate--l+99.8%
div-sub99.8%
sub-neg99.8%
*-inverses99.8%
metadata-eval99.8%
Simplified99.8%
distribute-rgt-in99.8%
neg-mul-199.8%
unsub-neg99.8%
div-inv99.8%
associate-*l*95.9%
associate-/r/95.6%
clear-num95.9%
Applied egg-rr95.9%
Taylor expanded in y around inf 92.8%
associate-*r/99.8%
Simplified99.8%
associate-*r/92.8%
associate-/l*99.9%
Applied egg-rr99.9%
Final simplification99.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -2300000.0) (not (<= y 1.05e+56))) (* y (/ x z)) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2300000.0) || !(y <= 1.05e+56)) {
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 <= (-2300000.0d0)) .or. (.not. (y <= 1.05d+56))) 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 <= -2300000.0) || !(y <= 1.05e+56)) {
tmp = y * (x / z);
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2300000.0) or not (y <= 1.05e+56): tmp = y * (x / z) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2300000.0) || !(y <= 1.05e+56)) 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 <= -2300000.0) || ~((y <= 1.05e+56))) tmp = y * (x / z); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2300000.0], N[Not[LessEqual[y, 1.05e+56]], $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 -2300000 \lor \neg \left(y \leq 1.05 \cdot 10^{+56}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -2.3e6 or 1.05000000000000009e56 < y Initial program 91.6%
Taylor expanded in y around inf 77.0%
*-commutative77.0%
associate-/l*76.6%
Simplified76.6%
clear-num76.6%
associate-/r/76.5%
clear-num76.7%
Applied egg-rr76.7%
if -2.3e6 < y < 1.05000000000000009e56Initial program 86.5%
Taylor expanded in x around 0 86.5%
associate--l+86.5%
+-commutative86.5%
associate-*r/99.9%
+-commutative99.9%
associate--l+99.9%
div-sub99.9%
sub-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 98.0%
sub-neg98.0%
metadata-eval98.0%
distribute-rgt-in98.0%
associate-*l/98.2%
*-lft-identity98.2%
neg-mul-198.2%
unsub-neg98.2%
Simplified98.2%
Final simplification87.8%
(FPCore (x y z) :precision binary64 (if (<= y -450000000.0) (/ y (/ z x)) (if (<= y 1.12e+57) (- (/ x z) x) (* y (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -450000000.0) {
tmp = y / (z / x);
} else if (y <= 1.12e+57) {
tmp = (x / z) - x;
} else {
tmp = y * (x / z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-450000000.0d0)) then
tmp = y / (z / x)
else if (y <= 1.12d+57) then
tmp = (x / z) - x
else
tmp = y * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -450000000.0) {
tmp = y / (z / x);
} else if (y <= 1.12e+57) {
tmp = (x / z) - x;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -450000000.0: tmp = y / (z / x) elif y <= 1.12e+57: tmp = (x / z) - x else: tmp = y * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -450000000.0) tmp = Float64(y / Float64(z / x)); elseif (y <= 1.12e+57) tmp = Float64(Float64(x / z) - x); else tmp = Float64(y * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -450000000.0) tmp = y / (z / x); elseif (y <= 1.12e+57) tmp = (x / z) - x; else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -450000000.0], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.12e+57], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -450000000:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{+57}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if y < -4.5e8Initial program 93.9%
Taylor expanded in y around inf 76.9%
*-commutative76.9%
associate-/l*76.3%
Simplified76.3%
if -4.5e8 < y < 1.12000000000000003e57Initial program 86.5%
Taylor expanded in x around 0 86.5%
associate--l+86.5%
+-commutative86.5%
associate-*r/99.9%
+-commutative99.9%
associate--l+99.9%
div-sub99.9%
sub-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 98.0%
sub-neg98.0%
metadata-eval98.0%
distribute-rgt-in98.0%
associate-*l/98.2%
*-lft-identity98.2%
neg-mul-198.2%
unsub-neg98.2%
Simplified98.2%
if 1.12000000000000003e57 < y Initial program 89.3%
Taylor expanded in y around inf 77.0%
*-commutative77.0%
associate-/l*76.9%
Simplified76.9%
clear-num76.9%
associate-/r/76.9%
clear-num77.3%
Applied egg-rr77.3%
Final simplification87.8%
(FPCore (x y z) :precision binary64 (if (<= y -2600000000.0) (/ (* y x) z) (if (<= y 6.8e+55) (- (/ x z) x) (* y (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2600000000.0) {
tmp = (y * x) / z;
} else if (y <= 6.8e+55) {
tmp = (x / z) - x;
} else {
tmp = y * (x / z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-2600000000.0d0)) then
tmp = (y * x) / z
else if (y <= 6.8d+55) then
tmp = (x / z) - x
else
tmp = y * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2600000000.0) {
tmp = (y * x) / z;
} else if (y <= 6.8e+55) {
tmp = (x / z) - x;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2600000000.0: tmp = (y * x) / z elif y <= 6.8e+55: tmp = (x / z) - x else: tmp = y * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2600000000.0) tmp = Float64(Float64(y * x) / z); elseif (y <= 6.8e+55) tmp = Float64(Float64(x / z) - x); else tmp = Float64(y * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2600000000.0) tmp = (y * x) / z; elseif (y <= 6.8e+55) tmp = (x / z) - x; else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2600000000.0], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 6.8e+55], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2600000000:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+55}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if y < -2.6e9Initial program 93.9%
Taylor expanded in y around inf 76.9%
if -2.6e9 < y < 6.7999999999999996e55Initial program 86.5%
Taylor expanded in x around 0 86.5%
associate--l+86.5%
+-commutative86.5%
associate-*r/99.9%
+-commutative99.9%
associate--l+99.9%
div-sub99.9%
sub-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 98.0%
sub-neg98.0%
metadata-eval98.0%
distribute-rgt-in98.0%
associate-*l/98.2%
*-lft-identity98.2%
neg-mul-198.2%
unsub-neg98.2%
Simplified98.2%
if 6.7999999999999996e55 < y Initial program 89.3%
Taylor expanded in y around inf 77.0%
*-commutative77.0%
associate-/l*76.9%
Simplified76.9%
clear-num76.9%
associate-/r/76.9%
clear-num77.3%
Applied egg-rr77.3%
Final simplification88.0%
(FPCore (x y z) :precision binary64 (- (* (+ 1.0 y) (/ x z)) x))
double code(double x, double y, double z) {
return ((1.0 + y) * (x / z)) - x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((1.0d0 + y) * (x / z)) - x
end function
public static double code(double x, double y, double z) {
return ((1.0 + y) * (x / z)) - x;
}
def code(x, y, z): return ((1.0 + y) * (x / z)) - x
function code(x, y, z) return Float64(Float64(Float64(1.0 + y) * Float64(x / z)) - x) end
function tmp = code(x, y, z) tmp = ((1.0 + y) * (x / z)) - x; end
code[x_, y_, z_] := N[(N[(N[(1.0 + y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]
\begin{array}{l}
\\
\left(1 + y\right) \cdot \frac{x}{z} - x
\end{array}
Initial program 88.9%
Taylor expanded in x around 0 88.9%
associate--l+88.9%
+-commutative88.9%
associate-*r/96.5%
+-commutative96.5%
associate--l+96.5%
div-sub96.5%
sub-neg96.5%
*-inverses96.5%
metadata-eval96.5%
Simplified96.5%
distribute-rgt-in96.5%
neg-mul-196.5%
unsub-neg96.5%
div-inv96.5%
associate-*l*98.6%
associate-/r/98.4%
clear-num98.7%
Applied egg-rr98.7%
Final simplification98.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 6.5e-13))) (- x) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 6.5e-13)) {
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 <= 6.5d-13))) 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 <= 6.5e-13)) {
tmp = -x;
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 6.5e-13): tmp = -x else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 6.5e-13)) 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 <= 6.5e-13))) 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, 6.5e-13]], $MachinePrecision]], (-x), N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 6.5 \cdot 10^{-13}\right):\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if z < -1 or 6.49999999999999957e-13 < z Initial program 78.5%
Taylor expanded in z around inf 74.9%
mul-1-neg74.9%
Simplified74.9%
if -1 < z < 6.49999999999999957e-13Initial program 99.8%
Taylor expanded in y around 0 53.7%
associate-/l*53.7%
Simplified53.7%
Taylor expanded in z around 0 51.9%
Final simplification63.7%
(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 88.9%
Taylor expanded in z around inf 39.9%
mul-1-neg39.9%
Simplified39.9%
Final simplification39.9%
(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 x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 88.9%
Taylor expanded in z around inf 29.9%
associate-*r*29.9%
mul-1-neg29.9%
Simplified29.9%
div-inv29.8%
associate-*l*39.8%
div-inv39.9%
*-inverses39.9%
*-commutative39.9%
*-un-lft-identity39.9%
neg-sub039.9%
sub-neg39.9%
add-sqr-sqrt16.1%
sqrt-unprod16.2%
sqr-neg16.2%
sqrt-unprod1.6%
add-sqr-sqrt2.8%
Applied egg-rr2.8%
+-lft-identity2.8%
Simplified2.8%
Final simplification2.8%
(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 2023320
(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))