
(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 -7.6e-54) (* x (+ (/ (+ y 1.0) z) -1.0)) (if (<= z 1.65e+16) (* (+ (- y z) 1.0) (/ x z)) (* x (+ -1.0 (/ y z))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -7.6e-54) {
tmp = x * (((y + 1.0) / z) + -1.0);
} else if (z <= 1.65e+16) {
tmp = ((y - z) + 1.0) * (x / z);
} else {
tmp = x * (-1.0 + (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 <= (-7.6d-54)) then
tmp = x * (((y + 1.0d0) / z) + (-1.0d0))
else if (z <= 1.65d+16) then
tmp = ((y - z) + 1.0d0) * (x / z)
else
tmp = x * ((-1.0d0) + (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -7.6e-54) {
tmp = x * (((y + 1.0) / z) + -1.0);
} else if (z <= 1.65e+16) {
tmp = ((y - z) + 1.0) * (x / z);
} else {
tmp = x * (-1.0 + (y / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -7.6e-54: tmp = x * (((y + 1.0) / z) + -1.0) elif z <= 1.65e+16: tmp = ((y - z) + 1.0) * (x / z) else: tmp = x * (-1.0 + (y / z)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -7.6e-54) tmp = Float64(x * Float64(Float64(Float64(y + 1.0) / z) + -1.0)); elseif (z <= 1.65e+16) tmp = Float64(Float64(Float64(y - z) + 1.0) * Float64(x / z)); else tmp = Float64(x * Float64(-1.0 + Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -7.6e-54) tmp = x * (((y + 1.0) / z) + -1.0); elseif (z <= 1.65e+16) tmp = ((y - z) + 1.0) * (x / z); else tmp = x * (-1.0 + (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -7.6e-54], N[(x * N[(N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e+16], N[(N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{-54}:\\
\;\;\;\;x \cdot \left(\frac{y + 1}{z} + -1\right)\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+16}:\\
\;\;\;\;\left(\left(y - z\right) + 1\right) \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\end{array}
\end{array}
if z < -7.6000000000000005e-54Initial program 80.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 -7.6000000000000005e-54 < z < 1.65e16Initial program 99.8%
*-commutative99.8%
associate-/l*99.9%
+-commutative99.9%
Applied egg-rr99.9%
if 1.65e16 < z Initial program 80.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 y around inf 99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= z -8.8e+15)
(- x)
(if (<= z 3.3e-297)
t_0
(if (<= z 9.5e-23) (/ x z) (if (<= z 1.3e+37) t_0 (- x)))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -8.8e+15) {
tmp = -x;
} else if (z <= 3.3e-297) {
tmp = t_0;
} else if (z <= 9.5e-23) {
tmp = x / z;
} else if (z <= 1.3e+37) {
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 <= (-8.8d+15)) then
tmp = -x
else if (z <= 3.3d-297) then
tmp = t_0
else if (z <= 9.5d-23) then
tmp = x / z
else if (z <= 1.3d+37) 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 <= -8.8e+15) {
tmp = -x;
} else if (z <= 3.3e-297) {
tmp = t_0;
} else if (z <= 9.5e-23) {
tmp = x / z;
} else if (z <= 1.3e+37) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) tmp = 0 if z <= -8.8e+15: tmp = -x elif z <= 3.3e-297: tmp = t_0 elif z <= 9.5e-23: tmp = x / z elif z <= 1.3e+37: 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 <= -8.8e+15) tmp = Float64(-x); elseif (z <= 3.3e-297) tmp = t_0; elseif (z <= 9.5e-23) tmp = Float64(x / z); elseif (z <= 1.3e+37) 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 <= -8.8e+15) tmp = -x; elseif (z <= 3.3e-297) tmp = t_0; elseif (z <= 9.5e-23) tmp = x / z; elseif (z <= 1.3e+37) 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, -8.8e+15], (-x), If[LessEqual[z, 3.3e-297], t$95$0, If[LessEqual[z, 9.5e-23], N[(x / z), $MachinePrecision], If[LessEqual[z, 1.3e+37], t$95$0, (-x)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -8.8 \cdot 10^{+15}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-297}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-23}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+37}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -8.8e15 or 1.3e37 < z Initial program 76.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 78.0%
neg-mul-178.0%
Simplified78.0%
if -8.8e15 < z < 3.2999999999999998e-297 or 9.50000000000000058e-23 < z < 1.3e37Initial program 99.0%
distribute-lft-in99.0%
*-rgt-identity99.0%
Applied egg-rr99.0%
Taylor expanded in y around inf 58.5%
*-commutative58.5%
associate-*r/62.8%
Simplified62.8%
if 3.2999999999999998e-297 < z < 9.50000000000000058e-23Initial program 99.8%
associate-/l*91.2%
+-commutative91.2%
associate-+r-91.2%
div-sub91.2%
*-inverses91.2%
sub-neg91.2%
metadata-eval91.2%
+-commutative91.2%
Simplified91.2%
Taylor expanded in y around 0 68.0%
sub-neg68.0%
metadata-eval68.0%
distribute-rgt-in68.0%
associate-*l/68.1%
*-lft-identity68.1%
neg-mul-168.1%
unsub-neg68.1%
Simplified68.1%
Taylor expanded in z around 0 68.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ y z))))
(if (<= z -52000000000000.0)
(- x)
(if (<= z -6.5e-56)
t_0
(if (<= z 6.8e-25) (/ x z) (if (<= z 9.1e+36) t_0 (- x)))))))
double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (z <= -52000000000000.0) {
tmp = -x;
} else if (z <= -6.5e-56) {
tmp = t_0;
} else if (z <= 6.8e-25) {
tmp = x / z;
} else if (z <= 9.1e+36) {
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 <= (-52000000000000.0d0)) then
tmp = -x
else if (z <= (-6.5d-56)) then
tmp = t_0
else if (z <= 6.8d-25) then
tmp = x / z
else if (z <= 9.1d+36) 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 <= -52000000000000.0) {
tmp = -x;
} else if (z <= -6.5e-56) {
tmp = t_0;
} else if (z <= 6.8e-25) {
tmp = x / z;
} else if (z <= 9.1e+36) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y / z) tmp = 0 if z <= -52000000000000.0: tmp = -x elif z <= -6.5e-56: tmp = t_0 elif z <= 6.8e-25: tmp = x / z elif z <= 9.1e+36: 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 <= -52000000000000.0) tmp = Float64(-x); elseif (z <= -6.5e-56) tmp = t_0; elseif (z <= 6.8e-25) tmp = Float64(x / z); elseif (z <= 9.1e+36) 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 <= -52000000000000.0) tmp = -x; elseif (z <= -6.5e-56) tmp = t_0; elseif (z <= 6.8e-25) tmp = x / z; elseif (z <= 9.1e+36) 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, -52000000000000.0], (-x), If[LessEqual[z, -6.5e-56], t$95$0, If[LessEqual[z, 6.8e-25], N[(x / z), $MachinePrecision], If[LessEqual[z, 9.1e+36], t$95$0, (-x)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -52000000000000:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-56}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-25}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 9.1 \cdot 10^{+36}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -5.2e13 or 9.0999999999999999e36 < z Initial program 76.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 78.0%
neg-mul-178.0%
Simplified78.0%
if -5.2e13 < z < -6.4999999999999997e-56 or 6.80000000000000003e-25 < z < 9.0999999999999999e36Initial program 97.5%
associate-/l*99.7%
+-commutative99.7%
associate-+r-99.7%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 62.8%
associate-/l*62.8%
Simplified62.8%
if -6.4999999999999997e-56 < z < 6.80000000000000003e-25Initial program 99.9%
associate-/l*89.6%
+-commutative89.6%
associate-+r-89.6%
div-sub89.6%
*-inverses89.6%
sub-neg89.6%
metadata-eval89.6%
+-commutative89.6%
Simplified89.6%
Taylor expanded in y around 0 61.8%
sub-neg61.8%
metadata-eval61.8%
distribute-rgt-in61.8%
associate-*l/62.0%
*-lft-identity62.0%
neg-mul-162.0%
unsub-neg62.0%
Simplified62.0%
Taylor expanded in z around 0 62.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -4.5e-54) (not (<= z 6e-17))) (* x (+ (/ (+ y 1.0) z) -1.0)) (* (/ x z) (+ y 1.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4.5e-54) || !(z <= 6e-17)) {
tmp = x * (((y + 1.0) / z) + -1.0);
} else {
tmp = (x / z) * (y + 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 ((z <= (-4.5d-54)) .or. (.not. (z <= 6d-17))) then
tmp = x * (((y + 1.0d0) / z) + (-1.0d0))
else
tmp = (x / z) * (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -4.5e-54) || !(z <= 6e-17)) {
tmp = x * (((y + 1.0) / z) + -1.0);
} else {
tmp = (x / z) * (y + 1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4.5e-54) or not (z <= 6e-17): tmp = x * (((y + 1.0) / z) + -1.0) else: tmp = (x / z) * (y + 1.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4.5e-54) || !(z <= 6e-17)) tmp = Float64(x * Float64(Float64(Float64(y + 1.0) / z) + -1.0)); else tmp = Float64(Float64(x / z) * Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -4.5e-54) || ~((z <= 6e-17))) tmp = x * (((y + 1.0) / z) + -1.0); else tmp = (x / z) * (y + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4.5e-54], N[Not[LessEqual[z, 6e-17]], $MachinePrecision]], N[(x * N[(N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-54} \lor \neg \left(z \leq 6 \cdot 10^{-17}\right):\\
\;\;\;\;x \cdot \left(\frac{y + 1}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(y + 1\right)\\
\end{array}
\end{array}
if z < -4.4999999999999998e-54 or 6.00000000000000012e-17 < z Initial program 81.3%
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 -4.4999999999999998e-54 < z < 6.00000000000000012e-17Initial program 99.8%
*-commutative99.8%
associate-/l*99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (* x (+ -1.0 (/ y z))) (* (/ x z) (+ y 1.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (x / z) * (y + 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 ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x * ((-1.0d0) + (y / z))
else
tmp = (x / z) * (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (x / z) * (y + 1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = x * (-1.0 + (y / z)) else: tmp = (x / z) * (y + 1.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); else tmp = Float64(Float64(x / z) * Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.0))) tmp = x * (-1.0 + (y / z)); else tmp = (x / z) * (y + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(y + 1\right)\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 78.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 97.9%
if -1 < z < 1Initial program 99.8%
*-commutative99.8%
associate-/l*99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 98.3%
Final simplification98.1%
(FPCore (x y z) :precision binary64 (if (or (<= y -22000.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 <= -22000.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 <= (-22000.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 <= -22000.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 <= -22000.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 <= -22000.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 <= -22000.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, -22000.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 -22000 \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 < -22000 or 1 < y Initial program 89.0%
associate-/l*91.1%
+-commutative91.1%
associate-+r-91.1%
div-sub91.1%
*-inverses91.1%
sub-neg91.1%
metadata-eval91.1%
+-commutative91.1%
Simplified91.1%
Taylor expanded in y around inf 90.2%
if -22000 < y < 1Initial program 89.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 0 99.3%
sub-neg99.3%
metadata-eval99.3%
distribute-rgt-in99.3%
associate-*l/99.4%
*-lft-identity99.4%
neg-mul-199.4%
unsub-neg99.4%
Simplified99.4%
Final simplification94.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -210000.0) (not (<= y 25000000000000.0))) (* y (/ x z)) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -210000.0) || !(y <= 25000000000000.0)) {
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 <= (-210000.0d0)) .or. (.not. (y <= 25000000000000.0d0))) 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 <= -210000.0) || !(y <= 25000000000000.0)) {
tmp = y * (x / z);
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -210000.0) or not (y <= 25000000000000.0): tmp = y * (x / z) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -210000.0) || !(y <= 25000000000000.0)) 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 <= -210000.0) || ~((y <= 25000000000000.0))) tmp = y * (x / z); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -210000.0], N[Not[LessEqual[y, 25000000000000.0]], $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 -210000 \lor \neg \left(y \leq 25000000000000\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -2.1e5 or 2.5e13 < y Initial program 88.7%
distribute-lft-in88.7%
*-rgt-identity88.7%
Applied egg-rr88.7%
Taylor expanded in y around inf 73.6%
*-commutative73.6%
associate-*r/74.0%
Simplified74.0%
if -2.1e5 < y < 2.5e13Initial program 90.0%
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 99.1%
sub-neg99.1%
metadata-eval99.1%
distribute-rgt-in99.1%
associate-*l/99.3%
*-lft-identity99.3%
neg-mul-199.3%
unsub-neg99.3%
Simplified99.3%
Final simplification86.9%
(FPCore (x y z) :precision binary64 (if (<= y -2400000.0) (/ (* x y) z) (if (<= y 30500000000000.0) (- (/ x z) x) (/ y (/ z x)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2400000.0) {
tmp = (x * y) / z;
} else if (y <= 30500000000000.0) {
tmp = (x / z) - x;
} else {
tmp = y / (z / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-2400000.0d0)) then
tmp = (x * y) / z
else if (y <= 30500000000000.0d0) then
tmp = (x / z) - x
else
tmp = y / (z / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2400000.0) {
tmp = (x * y) / z;
} else if (y <= 30500000000000.0) {
tmp = (x / z) - x;
} else {
tmp = y / (z / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2400000.0: tmp = (x * y) / z elif y <= 30500000000000.0: tmp = (x / z) - x else: tmp = y / (z / x) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2400000.0) tmp = Float64(Float64(x * y) / z); elseif (y <= 30500000000000.0) tmp = Float64(Float64(x / z) - x); else tmp = Float64(y / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2400000.0) tmp = (x * y) / z; elseif (y <= 30500000000000.0) tmp = (x / z) - x; else tmp = y / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2400000.0], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 30500000000000.0], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2400000:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;y \leq 30500000000000:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if y < -2.4e6Initial program 90.9%
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%
Taylor expanded in y around inf 75.6%
if -2.4e6 < y < 3.05e13Initial program 90.0%
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 99.1%
sub-neg99.1%
metadata-eval99.1%
distribute-rgt-in99.1%
associate-*l/99.3%
*-lft-identity99.3%
neg-mul-199.3%
unsub-neg99.3%
Simplified99.3%
if 3.05e13 < y Initial program 86.6%
distribute-lft-in86.6%
*-rgt-identity86.6%
Applied egg-rr86.6%
Taylor expanded in y around inf 71.6%
*-commutative71.6%
associate-*r/74.3%
Simplified74.3%
clear-num74.2%
un-div-inv74.3%
Applied egg-rr74.3%
(FPCore (x y z) :precision binary64 (if (<= y -1350000.0) (* y (/ x z)) (if (<= y 4300000000000.0) (- (/ x z) x) (/ y (/ z x)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1350000.0) {
tmp = y * (x / z);
} else if (y <= 4300000000000.0) {
tmp = (x / z) - x;
} else {
tmp = y / (z / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1350000.0d0)) then
tmp = y * (x / z)
else if (y <= 4300000000000.0d0) then
tmp = (x / z) - x
else
tmp = y / (z / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1350000.0) {
tmp = y * (x / z);
} else if (y <= 4300000000000.0) {
tmp = (x / z) - x;
} else {
tmp = y / (z / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1350000.0: tmp = y * (x / z) elif y <= 4300000000000.0: tmp = (x / z) - x else: tmp = y / (z / x) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1350000.0) tmp = Float64(y * Float64(x / z)); elseif (y <= 4300000000000.0) tmp = Float64(Float64(x / z) - x); else tmp = Float64(y / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1350000.0) tmp = y * (x / z); elseif (y <= 4300000000000.0) tmp = (x / z) - x; else tmp = y / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1350000.0], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4300000000000.0], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1350000:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 4300000000000:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if y < -1.35e6Initial program 90.9%
distribute-lft-in90.9%
*-rgt-identity90.9%
Applied egg-rr90.9%
Taylor expanded in y around inf 75.6%
*-commutative75.6%
associate-*r/73.8%
Simplified73.8%
if -1.35e6 < y < 4.3e12Initial program 90.0%
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 99.1%
sub-neg99.1%
metadata-eval99.1%
distribute-rgt-in99.1%
associate-*l/99.3%
*-lft-identity99.3%
neg-mul-199.3%
unsub-neg99.3%
Simplified99.3%
if 4.3e12 < y Initial program 86.6%
distribute-lft-in86.6%
*-rgt-identity86.6%
Applied egg-rr86.6%
Taylor expanded in y around inf 71.6%
*-commutative71.6%
associate-*r/74.3%
Simplified74.3%
clear-num74.2%
un-div-inv74.3%
Applied egg-rr74.3%
(FPCore (x y z) :precision binary64 (if (<= x 3.8e+24) (/ (+ x (* x (- y z))) z) (* x (+ (/ (+ y 1.0) z) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 3.8e+24) {
tmp = (x + (x * (y - z))) / 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 <= 3.8d+24) then
tmp = (x + (x * (y - z))) / 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 <= 3.8e+24) {
tmp = (x + (x * (y - z))) / z;
} else {
tmp = x * (((y + 1.0) / z) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 3.8e+24: tmp = (x + (x * (y - z))) / z else: tmp = x * (((y + 1.0) / z) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 3.8e+24) tmp = Float64(Float64(x + Float64(x * Float64(y - z))) / 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 <= 3.8e+24) tmp = (x + (x * (y - z))) / z; else tmp = x * (((y + 1.0) / z) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 3.8e+24], N[(N[(x + N[(x * N[(y - z), $MachinePrecision]), $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 3.8 \cdot 10^{+24}:\\
\;\;\;\;\frac{x + x \cdot \left(y - z\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y + 1}{z} + -1\right)\\
\end{array}
\end{array}
if x < 3.80000000000000015e24Initial program 92.9%
distribute-lft-in93.0%
*-rgt-identity93.0%
Applied egg-rr93.0%
if 3.80000000000000015e24 < x Initial program 79.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%
Final simplification94.8%
(FPCore (x y z) :precision binary64 (if (<= x 3.8e+24) (/ (* 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 <= 3.8e+24) {
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 <= 3.8d+24) 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 <= 3.8e+24) {
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 <= 3.8e+24: 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 <= 3.8e+24) 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 <= 3.8e+24) 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, 3.8e+24], 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 3.8 \cdot 10^{+24}:\\
\;\;\;\;\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.80000000000000015e24Initial program 92.9%
if 3.80000000000000015e24 < x Initial program 79.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%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (- x) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.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 <= 1.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 <= 1.0)) {
tmp = -x;
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = -x else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.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 <= 1.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, 1.0]], $MachinePrecision]], (-x), N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 78.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 z around inf 70.9%
neg-mul-170.9%
Simplified70.9%
if -1 < z < 1Initial program 99.8%
associate-/l*91.1%
+-commutative91.1%
associate-+r-91.1%
div-sub91.1%
*-inverses91.1%
sub-neg91.1%
metadata-eval91.1%
+-commutative91.1%
Simplified91.1%
Taylor expanded in y around 0 58.6%
sub-neg58.6%
metadata-eval58.6%
distribute-rgt-in58.6%
associate-*l/58.7%
*-lft-identity58.7%
neg-mul-158.7%
unsub-neg58.7%
Simplified58.7%
Taylor expanded in z around 0 57.1%
Final simplification64.0%
(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 89.4%
associate-/l*95.4%
+-commutative95.4%
associate-+r-95.4%
div-sub95.5%
*-inverses95.5%
sub-neg95.5%
metadata-eval95.5%
+-commutative95.5%
Simplified95.5%
Taylor expanded in z around inf 36.7%
neg-mul-136.7%
Simplified36.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 x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 89.4%
associate-/l*95.4%
+-commutative95.4%
associate-+r-95.4%
div-sub95.5%
*-inverses95.5%
sub-neg95.5%
metadata-eval95.5%
+-commutative95.5%
Simplified95.5%
Taylor expanded in z around inf 36.7%
neg-mul-136.7%
Simplified36.7%
neg-sub036.7%
sub-neg36.7%
add-sqr-sqrt16.7%
sqrt-unprod17.5%
sqr-neg17.5%
sqrt-unprod1.8%
add-sqr-sqrt3.2%
Applied egg-rr3.2%
+-lft-identity3.2%
Simplified3.2%
(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 2024112
(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))