
(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 -4.6e-11) (* x (+ (/ (+ 1.0 y) z) -1.0)) (if (<= z 1.3e+16) (* (+ 1.0 (- y z)) (/ x z)) (- (/ x (/ z y)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.6e-11) {
tmp = x * (((1.0 + y) / z) + -1.0);
} else if (z <= 1.3e+16) {
tmp = (1.0 + (y - z)) * (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 <= (-4.6d-11)) then
tmp = x * (((1.0d0 + y) / z) + (-1.0d0))
else if (z <= 1.3d+16) then
tmp = (1.0d0 + (y - z)) * (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 <= -4.6e-11) {
tmp = x * (((1.0 + y) / z) + -1.0);
} else if (z <= 1.3e+16) {
tmp = (1.0 + (y - z)) * (x / z);
} else {
tmp = (x / (z / y)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.6e-11: tmp = x * (((1.0 + y) / z) + -1.0) elif z <= 1.3e+16: tmp = (1.0 + (y - z)) * (x / z) else: tmp = (x / (z / y)) - x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.6e-11) tmp = Float64(x * Float64(Float64(Float64(1.0 + y) / z) + -1.0)); elseif (z <= 1.3e+16) tmp = Float64(Float64(1.0 + Float64(y - z)) * 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 <= -4.6e-11) tmp = x * (((1.0 + y) / z) + -1.0); elseif (z <= 1.3e+16) tmp = (1.0 + (y - z)) * (x / z); else tmp = (x / (z / y)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.6e-11], N[(x * N[(N[(N[(1.0 + y), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+16], N[(N[(1.0 + N[(y - z), $MachinePrecision]), $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 -4.6 \cdot 10^{-11}:\\
\;\;\;\;x \cdot \left(\frac{1 + y}{z} + -1\right)\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+16}:\\
\;\;\;\;\left(1 + \left(y - z\right)\right) \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}} - x\\
\end{array}
\end{array}
if z < -4.60000000000000027e-11Initial program 78.7%
associate-/l*100.0%
+-commutative100.0%
associate-+r-100.0%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
if -4.60000000000000027e-11 < z < 1.3e16Initial program 99.8%
*-commutative99.8%
associate-/l*99.9%
+-commutative99.9%
Applied egg-rr99.9%
if 1.3e16 < z Initial program 75.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%
distribute-lft-in99.9%
clear-num100.0%
un-div-inv100.0%
*-commutative100.0%
mul-1-neg100.0%
Applied egg-rr100.0%
Taylor expanded in y around inf 100.0%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ y z))))
(if (<= z -28000.0)
(- x)
(if (<= z -4.6e-145)
t_0
(if (<= z 2.35e-58) (/ x z) (if (<= z 8.2e+19) t_0 (- x)))))))
double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (z <= -28000.0) {
tmp = -x;
} else if (z <= -4.6e-145) {
tmp = t_0;
} else if (z <= 2.35e-58) {
tmp = x / z;
} else if (z <= 8.2e+19) {
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 <= (-28000.0d0)) then
tmp = -x
else if (z <= (-4.6d-145)) then
tmp = t_0
else if (z <= 2.35d-58) then
tmp = x / z
else if (z <= 8.2d+19) 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 <= -28000.0) {
tmp = -x;
} else if (z <= -4.6e-145) {
tmp = t_0;
} else if (z <= 2.35e-58) {
tmp = x / z;
} else if (z <= 8.2e+19) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y / z) tmp = 0 if z <= -28000.0: tmp = -x elif z <= -4.6e-145: tmp = t_0 elif z <= 2.35e-58: tmp = x / z elif z <= 8.2e+19: 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 <= -28000.0) tmp = Float64(-x); elseif (z <= -4.6e-145) tmp = t_0; elseif (z <= 2.35e-58) tmp = Float64(x / z); elseif (z <= 8.2e+19) 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 <= -28000.0) tmp = -x; elseif (z <= -4.6e-145) tmp = t_0; elseif (z <= 2.35e-58) tmp = x / z; elseif (z <= 8.2e+19) 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, -28000.0], (-x), If[LessEqual[z, -4.6e-145], t$95$0, If[LessEqual[z, 2.35e-58], N[(x / z), $MachinePrecision], If[LessEqual[z, 8.2e+19], t$95$0, (-x)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -28000:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{-145}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-58}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+19}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -28000 or 8.2e19 < z Initial program 75.6%
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 z around inf 78.5%
neg-mul-178.5%
Simplified78.5%
if -28000 < z < -4.60000000000000014e-145 or 2.34999999999999997e-58 < z < 8.2e19Initial program 99.7%
associate-/l*93.5%
+-commutative93.5%
associate-+r-93.5%
div-sub93.5%
*-inverses93.5%
sub-neg93.5%
metadata-eval93.5%
+-commutative93.5%
Simplified93.5%
Taylor expanded in y around inf 76.0%
associate-/l*69.9%
Simplified69.9%
if -4.60000000000000014e-145 < z < 2.34999999999999997e-58Initial program 99.9%
associate-/l*85.0%
+-commutative85.0%
associate-+r-85.0%
div-sub85.0%
*-inverses85.0%
sub-neg85.0%
metadata-eval85.0%
+-commutative85.0%
Simplified85.0%
Taylor expanded in y around 0 50.9%
sub-neg50.9%
metadata-eval50.9%
distribute-rgt-in50.9%
associate-*l/51.0%
*-lft-identity51.0%
neg-mul-151.0%
unsub-neg51.0%
Simplified51.0%
Taylor expanded in z around 0 51.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -6e-17) (not (<= z 1.05e-16))) (* x (+ (/ (+ 1.0 y) z) -1.0)) (* (+ 1.0 y) (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -6e-17) || !(z <= 1.05e-16)) {
tmp = x * (((1.0 + y) / z) + -1.0);
} else {
tmp = (1.0 + 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 <= (-6d-17)) .or. (.not. (z <= 1.05d-16))) then
tmp = x * (((1.0d0 + y) / z) + (-1.0d0))
else
tmp = (1.0d0 + y) * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -6e-17) || !(z <= 1.05e-16)) {
tmp = x * (((1.0 + y) / z) + -1.0);
} else {
tmp = (1.0 + y) * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -6e-17) or not (z <= 1.05e-16): tmp = x * (((1.0 + y) / z) + -1.0) else: tmp = (1.0 + y) * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -6e-17) || !(z <= 1.05e-16)) tmp = Float64(x * Float64(Float64(Float64(1.0 + y) / z) + -1.0)); else tmp = Float64(Float64(1.0 + y) * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -6e-17) || ~((z <= 1.05e-16))) tmp = x * (((1.0 + y) / z) + -1.0); else tmp = (1.0 + y) * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -6e-17], N[Not[LessEqual[z, 1.05e-16]], $MachinePrecision]], N[(x * N[(N[(N[(1.0 + y), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-17} \lor \neg \left(z \leq 1.05 \cdot 10^{-16}\right):\\
\;\;\;\;x \cdot \left(\frac{1 + y}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + y\right) \cdot \frac{x}{z}\\
\end{array}
\end{array}
if z < -6.00000000000000012e-17 or 1.0500000000000001e-16 < z Initial program 77.0%
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 -6.00000000000000012e-17 < z < 1.0500000000000001e-16Initial program 99.8%
associate-/l*87.1%
+-commutative87.1%
associate-+r-87.1%
div-sub87.1%
*-inverses87.1%
sub-neg87.1%
metadata-eval87.1%
+-commutative87.1%
Simplified87.1%
Taylor expanded in z around 0 99.8%
+-commutative99.8%
associate-*l/99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -3e-9) (not (<= z 1.0))) (* x (+ -1.0 (/ y z))) (* (+ 1.0 y) (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3e-9) || !(z <= 1.0)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (1.0 + 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 <= (-3d-9)) .or. (.not. (z <= 1.0d0))) then
tmp = x * ((-1.0d0) + (y / z))
else
tmp = (1.0d0 + y) * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -3e-9) || !(z <= 1.0)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (1.0 + y) * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3e-9) or not (z <= 1.0): tmp = x * (-1.0 + (y / z)) else: tmp = (1.0 + y) * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3e-9) || !(z <= 1.0)) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); else tmp = Float64(Float64(1.0 + y) * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3e-9) || ~((z <= 1.0))) tmp = x * (-1.0 + (y / z)); else tmp = (1.0 + y) * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3e-9], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-9} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + y\right) \cdot \frac{x}{z}\\
\end{array}
\end{array}
if z < -2.99999999999999998e-9 or 1 < z Initial program 76.8%
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 98.6%
if -2.99999999999999998e-9 < z < 1Initial program 99.8%
associate-/l*87.2%
+-commutative87.2%
associate-+r-87.2%
div-sub87.2%
*-inverses87.2%
sub-neg87.2%
metadata-eval87.2%
+-commutative87.2%
Simplified87.2%
Taylor expanded in z around 0 99.7%
+-commutative99.7%
associate-*l/99.8%
Applied egg-rr99.8%
Final simplification99.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.0) (not (<= y 6.2e-10))) (* x (+ -1.0 (/ y z))) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.0) || !(y <= 6.2e-10)) {
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 <= 6.2d-10))) 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 <= 6.2e-10)) {
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 <= 6.2e-10): 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 <= 6.2e-10)) 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 <= 6.2e-10))) 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, 6.2e-10]], $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 6.2 \cdot 10^{-10}\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -1 or 6.2000000000000003e-10 < y Initial program 91.4%
associate-/l*87.4%
+-commutative87.4%
associate-+r-87.4%
div-sub87.4%
*-inverses87.4%
sub-neg87.4%
metadata-eval87.4%
+-commutative87.4%
Simplified87.4%
Taylor expanded in y around inf 86.8%
if -1 < y < 6.2000000000000003e-10Initial program 86.0%
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 0 98.9%
sub-neg98.9%
metadata-eval98.9%
distribute-rgt-in98.8%
associate-*l/99.0%
*-lft-identity99.0%
neg-mul-199.0%
unsub-neg99.0%
Simplified99.0%
Final simplification92.5%
(FPCore (x y z) :precision binary64 (if (<= z -3e-9) (* x (+ -1.0 (/ y z))) (if (<= z 1.0) (* (+ 1.0 y) (/ x z)) (- (/ x (/ z y)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3e-9) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 1.0) {
tmp = (1.0 + 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 <= (-3d-9)) then
tmp = x * ((-1.0d0) + (y / z))
else if (z <= 1.0d0) then
tmp = (1.0d0 + 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 <= -3e-9) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 1.0) {
tmp = (1.0 + y) * (x / z);
} else {
tmp = (x / (z / y)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3e-9: tmp = x * (-1.0 + (y / z)) elif z <= 1.0: tmp = (1.0 + y) * (x / z) else: tmp = (x / (z / y)) - x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3e-9) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); elseif (z <= 1.0) tmp = Float64(Float64(1.0 + y) * 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 <= -3e-9) tmp = x * (-1.0 + (y / z)); elseif (z <= 1.0) tmp = (1.0 + y) * (x / z); else tmp = (x / (z / y)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3e-9], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(1.0 + y), $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 \cdot 10^{-9}:\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\left(1 + y\right) \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}} - x\\
\end{array}
\end{array}
if z < -2.99999999999999998e-9Initial program 78.7%
associate-/l*100.0%
+-commutative100.0%
associate-+r-100.0%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 96.8%
if -2.99999999999999998e-9 < z < 1Initial program 99.8%
associate-/l*87.2%
+-commutative87.2%
associate-+r-87.2%
div-sub87.2%
*-inverses87.2%
sub-neg87.2%
metadata-eval87.2%
+-commutative87.2%
Simplified87.2%
Taylor expanded in z around 0 99.7%
+-commutative99.7%
associate-*l/99.8%
Applied egg-rr99.8%
if 1 < z Initial program 75.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%
distribute-lft-in99.9%
clear-num100.0%
un-div-inv100.0%
*-commutative100.0%
mul-1-neg100.0%
Applied egg-rr100.0%
Taylor expanded in y around inf 100.0%
Final simplification99.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -80000.0) (not (<= y 2.3e+42))) (* y (/ x z)) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -80000.0) || !(y <= 2.3e+42)) {
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 <= (-80000.0d0)) .or. (.not. (y <= 2.3d+42))) 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 <= -80000.0) || !(y <= 2.3e+42)) {
tmp = y * (x / z);
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -80000.0) or not (y <= 2.3e+42): tmp = y * (x / z) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -80000.0) || !(y <= 2.3e+42)) 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 <= -80000.0) || ~((y <= 2.3e+42))) tmp = y * (x / z); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -80000.0], N[Not[LessEqual[y, 2.3e+42]], $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 -80000 \lor \neg \left(y \leq 2.3 \cdot 10^{+42}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -8e4 or 2.3e42 < y Initial program 93.0%
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 80.1%
associate-/l*68.2%
Simplified68.2%
clear-num68.2%
un-div-inv69.8%
Applied egg-rr69.8%
associate-/r/80.0%
Applied egg-rr80.0%
if -8e4 < y < 2.3e42Initial program 84.9%
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.9%
sub-neg96.9%
metadata-eval96.9%
distribute-rgt-in96.9%
associate-*l/97.0%
*-lft-identity97.0%
neg-mul-197.0%
unsub-neg97.0%
Simplified97.0%
Final simplification88.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -28000.0) (not (<= z 9.6e+19))) (- x) (* y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -28000.0) || !(z <= 9.6e+19)) {
tmp = -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 ((z <= (-28000.0d0)) .or. (.not. (z <= 9.6d+19))) then
tmp = -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 ((z <= -28000.0) || !(z <= 9.6e+19)) {
tmp = -x;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -28000.0) or not (z <= 9.6e+19): tmp = -x else: tmp = y * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -28000.0) || !(z <= 9.6e+19)) tmp = Float64(-x); else tmp = Float64(y * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -28000.0) || ~((z <= 9.6e+19))) tmp = -x; else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -28000.0], N[Not[LessEqual[z, 9.6e+19]], $MachinePrecision]], (-x), N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -28000 \lor \neg \left(z \leq 9.6 \cdot 10^{+19}\right):\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if z < -28000 or 9.6e19 < z Initial program 75.6%
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 z around inf 78.5%
neg-mul-178.5%
Simplified78.5%
if -28000 < z < 9.6e19Initial program 99.8%
associate-/l*87.7%
+-commutative87.7%
associate-+r-87.7%
div-sub87.7%
*-inverses87.7%
sub-neg87.7%
metadata-eval87.7%
+-commutative87.7%
Simplified87.7%
Taylor expanded in y around inf 60.4%
associate-/l*48.4%
Simplified48.4%
clear-num48.4%
un-div-inv49.9%
Applied egg-rr49.9%
associate-/r/61.9%
Applied egg-rr61.9%
Final simplification69.4%
(FPCore (x y z) :precision binary64 (if (<= y -35000000000.0) (/ (* x y) z) (if (<= y 2e+41) (- (/ x z) x) (* y (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -35000000000.0) {
tmp = (x * y) / z;
} else if (y <= 2e+41) {
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 <= (-35000000000.0d0)) then
tmp = (x * y) / z
else if (y <= 2d+41) 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 <= -35000000000.0) {
tmp = (x * y) / z;
} else if (y <= 2e+41) {
tmp = (x / z) - x;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -35000000000.0: tmp = (x * y) / z elif y <= 2e+41: tmp = (x / z) - x else: tmp = y * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -35000000000.0) tmp = Float64(Float64(x * y) / z); elseif (y <= 2e+41) 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 <= -35000000000.0) tmp = (x * y) / z; elseif (y <= 2e+41) tmp = (x / z) - x; else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -35000000000.0], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 2e+41], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -35000000000:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+41}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if y < -3.5e10Initial program 95.7%
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 83.2%
if -3.5e10 < y < 2.00000000000000001e41Initial program 84.9%
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.9%
sub-neg96.9%
metadata-eval96.9%
distribute-rgt-in96.9%
associate-*l/97.0%
*-lft-identity97.0%
neg-mul-197.0%
unsub-neg97.0%
Simplified97.0%
if 2.00000000000000001e41 < y Initial program 89.7%
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 76.3%
associate-/l*64.6%
Simplified64.6%
clear-num64.6%
un-div-inv66.2%
Applied egg-rr66.2%
associate-/r/77.7%
Applied egg-rr77.7%
Final simplification89.0%
(FPCore (x y z) :precision binary64 (if (<= x 1e-26) (- (/ (* x (+ 1.0 y)) z) x) (- (/ x (/ z (+ 1.0 y))) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 1e-26) {
tmp = ((x * (1.0 + y)) / z) - x;
} else {
tmp = (x / (z / (1.0 + 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 (x <= 1d-26) then
tmp = ((x * (1.0d0 + y)) / z) - x
else
tmp = (x / (z / (1.0d0 + y))) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1e-26) {
tmp = ((x * (1.0 + y)) / z) - x;
} else {
tmp = (x / (z / (1.0 + y))) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1e-26: tmp = ((x * (1.0 + y)) / z) - x else: tmp = (x / (z / (1.0 + y))) - x return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1e-26) tmp = Float64(Float64(Float64(x * Float64(1.0 + y)) / z) - x); else tmp = Float64(Float64(x / Float64(z / Float64(1.0 + y))) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1e-26) tmp = ((x * (1.0 + y)) / z) - x; else tmp = (x / (z / (1.0 + y))) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1e-26], N[(N[(N[(x * N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] - x), $MachinePrecision], N[(N[(x / N[(z / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{-26}:\\
\;\;\;\;\frac{x \cdot \left(1 + y\right)}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{1 + y}} - x\\
\end{array}
\end{array}
if x < 1e-26Initial program 92.8%
associate-/l*90.8%
+-commutative90.8%
associate-+r-90.8%
div-sub90.8%
*-inverses90.8%
sub-neg90.8%
metadata-eval90.8%
+-commutative90.8%
Simplified90.8%
distribute-lft-in90.8%
clear-num90.8%
un-div-inv91.9%
*-commutative91.9%
mul-1-neg91.9%
Applied egg-rr91.9%
Taylor expanded in z around inf 97.8%
if 1e-26 < x Initial program 78.1%
associate-/l*100.0%
+-commutative100.0%
associate-+r-100.0%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
distribute-lft-in99.9%
clear-num100.0%
un-div-inv100.0%
*-commutative100.0%
mul-1-neg100.0%
Applied egg-rr100.0%
Final simplification98.4%
(FPCore (x y z) :precision binary64 (if (<= x 3.2e+32) (- (/ (* x (+ 1.0 y)) z) x) (* x (+ (/ (+ 1.0 y) z) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 3.2e+32) {
tmp = ((x * (1.0 + y)) / z) - x;
} else {
tmp = x * (((1.0 + y) / 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 <= 3.2d+32) then
tmp = ((x * (1.0d0 + y)) / z) - x
else
tmp = x * (((1.0d0 + y) / z) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 3.2e+32) {
tmp = ((x * (1.0 + y)) / z) - x;
} else {
tmp = x * (((1.0 + y) / z) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 3.2e+32: tmp = ((x * (1.0 + y)) / z) - x else: tmp = x * (((1.0 + y) / z) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 3.2e+32) tmp = Float64(Float64(Float64(x * Float64(1.0 + y)) / z) - x); else tmp = Float64(x * Float64(Float64(Float64(1.0 + y) / z) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 3.2e+32) tmp = ((x * (1.0 + y)) / z) - x; else tmp = x * (((1.0 + y) / z) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 3.2e+32], N[(N[(N[(x * N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] - x), $MachinePrecision], N[(x * N[(N[(N[(1.0 + y), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.2 \cdot 10^{+32}:\\
\;\;\;\;\frac{x \cdot \left(1 + y\right)}{z} - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{1 + y}{z} + -1\right)\\
\end{array}
\end{array}
if x < 3.1999999999999999e32Initial program 93.4%
associate-/l*91.6%
+-commutative91.6%
associate-+r-91.6%
div-sub91.6%
*-inverses91.6%
sub-neg91.6%
metadata-eval91.6%
+-commutative91.6%
Simplified91.6%
distribute-lft-in91.6%
clear-num91.6%
un-div-inv92.6%
*-commutative92.6%
mul-1-neg92.6%
Applied egg-rr92.6%
Taylor expanded in z around inf 98.0%
if 3.1999999999999999e32 < x Initial program 71.0%
associate-/l*100.0%
+-commutative100.0%
associate-+r-100.0%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Final simplification98.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -7.8e-7) (not (<= z 1.7e+19))) (- x) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -7.8e-7) || !(z <= 1.7e+19)) {
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 <= (-7.8d-7)) .or. (.not. (z <= 1.7d+19))) 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 <= -7.8e-7) || !(z <= 1.7e+19)) {
tmp = -x;
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -7.8e-7) or not (z <= 1.7e+19): tmp = -x else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -7.8e-7) || !(z <= 1.7e+19)) tmp = Float64(-x); else tmp = Float64(x / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -7.8e-7) || ~((z <= 1.7e+19))) tmp = -x; else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -7.8e-7], N[Not[LessEqual[z, 1.7e+19]], $MachinePrecision]], (-x), N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{-7} \lor \neg \left(z \leq 1.7 \cdot 10^{+19}\right):\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if z < -7.80000000000000049e-7 or 1.7e19 < z Initial program 76.0%
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 z around inf 77.2%
neg-mul-177.2%
Simplified77.2%
if -7.80000000000000049e-7 < z < 1.7e19Initial program 99.8%
associate-/l*87.6%
+-commutative87.6%
associate-+r-87.6%
div-sub87.6%
*-inverses87.6%
sub-neg87.6%
metadata-eval87.6%
+-commutative87.6%
Simplified87.6%
Taylor expanded in y around 0 44.4%
sub-neg44.4%
metadata-eval44.4%
distribute-rgt-in44.4%
associate-*l/44.5%
*-lft-identity44.5%
neg-mul-144.5%
unsub-neg44.5%
Simplified44.5%
Taylor expanded in z around 0 44.4%
Final simplification59.5%
(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.8%
associate-/l*93.3%
+-commutative93.3%
associate-+r-93.3%
div-sub93.3%
*-inverses93.3%
sub-neg93.3%
metadata-eval93.3%
+-commutative93.3%
Simplified93.3%
Taylor expanded in z around inf 37.3%
neg-mul-137.3%
Simplified37.3%
(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.8%
associate-/l*93.3%
+-commutative93.3%
associate-+r-93.3%
div-sub93.3%
*-inverses93.3%
sub-neg93.3%
metadata-eval93.3%
+-commutative93.3%
Simplified93.3%
Taylor expanded in z around inf 37.3%
neg-mul-137.3%
Simplified37.3%
neg-sub037.3%
sub-neg37.3%
add-sqr-sqrt17.0%
sqrt-unprod15.0%
sqr-neg15.0%
sqrt-unprod1.4%
add-sqr-sqrt2.9%
Applied egg-rr2.9%
Taylor expanded in x around 0 2.9%
(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 2024132
(FPCore (x y z)
:name "Diagrams.TwoD.Segment.Bernstein:evaluateBernstein from diagrams-lib-1.3.0.3"
:precision binary64
:alt
(! :herbie-platform default (if (< x -67870776678359/25000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* (+ 1 y) (/ x z)) x) (if (< x 1937054408219773/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* (* x (+ (- y z) 1)) (/ 1 z)) (- (* (+ 1 y) (/ x z)) x))))
(/ (* x (+ (- y z) 1.0)) z))