
(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 15 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 (or (<= z -1150000000000.0) (not (<= z 85000000.0))) (- (/ x (/ z y)) x) (* (+ (- y z) 1.0) (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1150000000000.0) || !(z <= 85000000.0)) {
tmp = (x / (z / y)) - x;
} else {
tmp = ((y - z) + 1.0) * (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 <= (-1150000000000.0d0)) .or. (.not. (z <= 85000000.0d0))) then
tmp = (x / (z / y)) - x
else
tmp = ((y - z) + 1.0d0) * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1150000000000.0) || !(z <= 85000000.0)) {
tmp = (x / (z / y)) - x;
} else {
tmp = ((y - z) + 1.0) * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1150000000000.0) or not (z <= 85000000.0): tmp = (x / (z / y)) - x else: tmp = ((y - z) + 1.0) * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1150000000000.0) || !(z <= 85000000.0)) tmp = Float64(Float64(x / Float64(z / y)) - x); else tmp = Float64(Float64(Float64(y - z) + 1.0) * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1150000000000.0) || ~((z <= 85000000.0))) tmp = (x / (z / y)) - x; else tmp = ((y - z) + 1.0) * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1150000000000.0], N[Not[LessEqual[z, 85000000.0]], $MachinePrecision]], N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1150000000000 \lor \neg \left(z \leq 85000000\right):\\
\;\;\;\;\frac{x}{\frac{z}{y}} - x\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y - z\right) + 1\right) \cdot \frac{x}{z}\\
\end{array}
\end{array}
if z < -1.15e12 or 8.5e7 < z Initial program 76.6%
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%
distribute-lft-in99.8%
clear-num99.8%
un-div-inv99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 99.9%
if -1.15e12 < z < 8.5e7Initial program 99.8%
*-commutative99.8%
associate-/l*99.8%
+-commutative99.8%
Applied egg-rr99.8%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= z -1.75e+40)
(- x)
(if (<= z -6.5e-60)
(* x (/ y z))
(if (<= z 2.3e-260)
(/ x z)
(if (<= z 4.5e-204)
t_0
(if (<= z 6.4e-71) (/ x z) (if (<= z 1.3e+16) t_0 (- x)))))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -1.75e+40) {
tmp = -x;
} else if (z <= -6.5e-60) {
tmp = x * (y / z);
} else if (z <= 2.3e-260) {
tmp = x / z;
} else if (z <= 4.5e-204) {
tmp = t_0;
} else if (z <= 6.4e-71) {
tmp = x / z;
} else if (z <= 1.3e+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 <= (-1.75d+40)) then
tmp = -x
else if (z <= (-6.5d-60)) then
tmp = x * (y / z)
else if (z <= 2.3d-260) then
tmp = x / z
else if (z <= 4.5d-204) then
tmp = t_0
else if (z <= 6.4d-71) then
tmp = x / z
else if (z <= 1.3d+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 <= -1.75e+40) {
tmp = -x;
} else if (z <= -6.5e-60) {
tmp = x * (y / z);
} else if (z <= 2.3e-260) {
tmp = x / z;
} else if (z <= 4.5e-204) {
tmp = t_0;
} else if (z <= 6.4e-71) {
tmp = x / z;
} else if (z <= 1.3e+16) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) tmp = 0 if z <= -1.75e+40: tmp = -x elif z <= -6.5e-60: tmp = x * (y / z) elif z <= 2.3e-260: tmp = x / z elif z <= 4.5e-204: tmp = t_0 elif z <= 6.4e-71: tmp = x / z elif z <= 1.3e+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 <= -1.75e+40) tmp = Float64(-x); elseif (z <= -6.5e-60) tmp = Float64(x * Float64(y / z)); elseif (z <= 2.3e-260) tmp = Float64(x / z); elseif (z <= 4.5e-204) tmp = t_0; elseif (z <= 6.4e-71) tmp = Float64(x / z); elseif (z <= 1.3e+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 <= -1.75e+40) tmp = -x; elseif (z <= -6.5e-60) tmp = x * (y / z); elseif (z <= 2.3e-260) tmp = x / z; elseif (z <= 4.5e-204) tmp = t_0; elseif (z <= 6.4e-71) tmp = x / z; elseif (z <= 1.3e+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, -1.75e+40], (-x), If[LessEqual[z, -6.5e-60], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e-260], N[(x / z), $MachinePrecision], If[LessEqual[z, 4.5e-204], t$95$0, If[LessEqual[z, 6.4e-71], N[(x / z), $MachinePrecision], If[LessEqual[z, 1.3e+16], t$95$0, (-x)]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+40}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-60}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-260}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-204}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-71}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+16}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -1.75e40 or 1.3e16 < z Initial program 74.7%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 74.1%
neg-mul-174.1%
Simplified74.1%
if -1.75e40 < z < -6.49999999999999995e-60Initial program 99.7%
associate-/l*99.5%
+-commutative99.5%
associate-+r-99.5%
div-sub99.4%
*-inverses99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in y around inf 68.7%
associate-/l*68.6%
Simplified68.6%
if -6.49999999999999995e-60 < z < 2.3e-260 or 4.49999999999999974e-204 < z < 6.3999999999999998e-71Initial program 99.8%
Taylor expanded in y around 0 67.9%
associate-/l*67.7%
Simplified67.7%
Taylor expanded in z around 0 67.7%
Taylor expanded in x around 0 67.9%
if 2.3e-260 < z < 4.49999999999999974e-204 or 6.3999999999999998e-71 < z < 1.3e16Initial program 99.8%
*-commutative99.8%
associate-/l*99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 74.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ y z))))
(if (<= z -1e+39)
(- x)
(if (<= z -1.25e-59)
t_0
(if (<= z 6.2e-71) (/ x z) (if (<= z 1.08e+18) t_0 (- x)))))))
double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (z <= -1e+39) {
tmp = -x;
} else if (z <= -1.25e-59) {
tmp = t_0;
} else if (z <= 6.2e-71) {
tmp = x / z;
} else if (z <= 1.08e+18) {
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 <= (-1d+39)) then
tmp = -x
else if (z <= (-1.25d-59)) then
tmp = t_0
else if (z <= 6.2d-71) then
tmp = x / z
else if (z <= 1.08d+18) 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 <= -1e+39) {
tmp = -x;
} else if (z <= -1.25e-59) {
tmp = t_0;
} else if (z <= 6.2e-71) {
tmp = x / z;
} else if (z <= 1.08e+18) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y / z) tmp = 0 if z <= -1e+39: tmp = -x elif z <= -1.25e-59: tmp = t_0 elif z <= 6.2e-71: tmp = x / z elif z <= 1.08e+18: 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 <= -1e+39) tmp = Float64(-x); elseif (z <= -1.25e-59) tmp = t_0; elseif (z <= 6.2e-71) tmp = Float64(x / z); elseif (z <= 1.08e+18) 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 <= -1e+39) tmp = -x; elseif (z <= -1.25e-59) tmp = t_0; elseif (z <= 6.2e-71) tmp = x / z; elseif (z <= 1.08e+18) 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, -1e+39], (-x), If[LessEqual[z, -1.25e-59], t$95$0, If[LessEqual[z, 6.2e-71], N[(x / z), $MachinePrecision], If[LessEqual[z, 1.08e+18], t$95$0, (-x)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -1 \cdot 10^{+39}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-59}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-71}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{+18}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -9.9999999999999994e38 or 1.08e18 < z Initial program 74.7%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 74.1%
neg-mul-174.1%
Simplified74.1%
if -9.9999999999999994e38 < z < -1.25e-59 or 6.20000000000000004e-71 < z < 1.08e18Initial program 99.7%
associate-/l*99.5%
+-commutative99.5%
associate-+r-99.5%
div-sub99.5%
*-inverses99.5%
sub-neg99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in y around inf 71.3%
associate-/l*71.2%
Simplified71.2%
if -1.25e-59 < z < 6.20000000000000004e-71Initial program 99.8%
Taylor expanded in y around 0 64.6%
associate-/l*64.4%
Simplified64.4%
Taylor expanded in z around 0 64.4%
Taylor expanded in x around 0 64.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1e-20))) (- (/ x (/ z y)) x) (/ x (/ z (+ y 1.0)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1e-20)) {
tmp = (x / (z / y)) - x;
} 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 <= 1d-20))) then
tmp = (x / (z / y)) - x
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 <= 1e-20)) {
tmp = (x / (z / y)) - x;
} else {
tmp = x / (z / (y + 1.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1e-20): tmp = (x / (z / y)) - x else: tmp = x / (z / (y + 1.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1e-20)) tmp = Float64(Float64(x / Float64(z / y)) - x); else tmp = Float64(x / Float64(z / Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1e-20))) tmp = (x / (z / y)) - x; 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, 1e-20]], $MachinePrecision]], N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(x / N[(z / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 10^{-20}\right):\\
\;\;\;\;\frac{x}{\frac{z}{y}} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + 1}}\\
\end{array}
\end{array}
if z < -1 or 9.99999999999999945e-21 < z Initial program 77.7%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
distribute-lft-in99.8%
clear-num99.8%
un-div-inv99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 98.8%
if -1 < z < 9.99999999999999945e-21Initial program 99.8%
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%
Taylor expanded in z around 0 99.3%
associate-/l*91.1%
Simplified91.1%
clear-num91.1%
un-div-inv93.0%
+-commutative93.0%
Applied egg-rr93.0%
Final simplification95.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.96) (not (<= z 1e-20))) (* x (+ -1.0 (/ y z))) (/ x (/ z (+ y 1.0)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.96) || !(z <= 1e-20)) {
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 <= (-0.96d0)) .or. (.not. (z <= 1d-20))) 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 <= -0.96) || !(z <= 1e-20)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = x / (z / (y + 1.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.96) or not (z <= 1e-20): 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 <= -0.96) || !(z <= 1e-20)) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); else tmp = Float64(x / Float64(z / Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.96) || ~((z <= 1e-20))) 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, -0.96], N[Not[LessEqual[z, 1e-20]], $MachinePrecision]], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.96 \lor \neg \left(z \leq 10^{-20}\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + 1}}\\
\end{array}
\end{array}
if z < -0.95999999999999996 or 9.99999999999999945e-21 < z Initial program 77.7%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 98.7%
if -0.95999999999999996 < z < 9.99999999999999945e-21Initial program 99.8%
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%
Taylor expanded in z around 0 99.3%
associate-/l*91.1%
Simplified91.1%
clear-num91.1%
un-div-inv93.0%
+-commutative93.0%
Applied egg-rr93.0%
Final simplification95.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1e-20))) (* x (+ -1.0 (/ y z))) (* x (/ (+ y 1.0) z))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1e-20)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = x * ((y + 1.0) / 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 <= 1d-20))) then
tmp = x * ((-1.0d0) + (y / z))
else
tmp = x * ((y + 1.0d0) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1e-20)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = x * ((y + 1.0) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1e-20): tmp = x * (-1.0 + (y / z)) else: tmp = x * ((y + 1.0) / z) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1e-20)) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); else tmp = Float64(x * Float64(Float64(y + 1.0) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1e-20))) tmp = x * (-1.0 + (y / z)); else tmp = x * ((y + 1.0) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1e-20]], $MachinePrecision]], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 10^{-20}\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y + 1}{z}\\
\end{array}
\end{array}
if z < -1 or 9.99999999999999945e-21 < z Initial program 77.7%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 98.7%
if -1 < z < 9.99999999999999945e-21Initial program 99.8%
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%
Taylor expanded in z around 0 99.3%
associate-/l*91.1%
Simplified91.1%
Final simplification94.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -2020.0) (not (<= y 9.8e-13))) (* x (+ -1.0 (/ y z))) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2020.0) || !(y <= 9.8e-13)) {
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 <= (-2020.0d0)) .or. (.not. (y <= 9.8d-13))) 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 <= -2020.0) || !(y <= 9.8e-13)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2020.0) or not (y <= 9.8e-13): tmp = x * (-1.0 + (y / z)) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2020.0) || !(y <= 9.8e-13)) 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 <= -2020.0) || ~((y <= 9.8e-13))) tmp = x * (-1.0 + (y / z)); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2020.0], N[Not[LessEqual[y, 9.8e-13]], $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 -2020 \lor \neg \left(y \leq 9.8 \cdot 10^{-13}\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -2020 or 9.80000000000000065e-13 < y Initial program 88.7%
associate-/l*92.0%
+-commutative92.0%
associate-+r-92.0%
div-sub92.0%
*-inverses92.0%
sub-neg92.0%
metadata-eval92.0%
+-commutative92.0%
Simplified92.0%
Taylor expanded in y around inf 92.0%
if -2020 < y < 9.80000000000000065e-13Initial program 89.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%
distribute-lft-in99.8%
clear-num99.8%
un-div-inv100.0%
*-commutative100.0%
mul-1-neg100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 98.1%
Final simplification94.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -58000.0) (not (<= y 7.5e+28))) (* y (/ x z)) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -58000.0) || !(y <= 7.5e+28)) {
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 <= (-58000.0d0)) .or. (.not. (y <= 7.5d+28))) 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 <= -58000.0) || !(y <= 7.5e+28)) {
tmp = y * (x / z);
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -58000.0) or not (y <= 7.5e+28): tmp = y * (x / z) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -58000.0) || !(y <= 7.5e+28)) 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 <= -58000.0) || ~((y <= 7.5e+28))) tmp = y * (x / z); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -58000.0], N[Not[LessEqual[y, 7.5e+28]], $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 -58000 \lor \neg \left(y \leq 7.5 \cdot 10^{+28}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -58000 or 7.4999999999999998e28 < y Initial program 88.9%
*-commutative88.9%
associate-/l*87.4%
+-commutative87.4%
Applied egg-rr87.4%
Taylor expanded in y around inf 70.6%
if -58000 < y < 7.4999999999999998e28Initial program 88.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%
distribute-lft-in99.8%
clear-num99.8%
un-div-inv100.0%
*-commutative100.0%
mul-1-neg100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 96.7%
Final simplification83.5%
(FPCore (x y z) :precision binary64 (if (<= y -1.1e+47) (/ (* x y) z) (if (<= y 2e+29) (- (/ x z) x) (* y (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.1e+47) {
tmp = (x * y) / z;
} else if (y <= 2e+29) {
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 <= (-1.1d+47)) then
tmp = (x * y) / z
else if (y <= 2d+29) 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 <= -1.1e+47) {
tmp = (x * y) / z;
} else if (y <= 2e+29) {
tmp = (x / z) - x;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.1e+47: tmp = (x * y) / z elif y <= 2e+29: tmp = (x / z) - x else: tmp = y * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.1e+47) tmp = Float64(Float64(x * y) / z); elseif (y <= 2e+29) 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 <= -1.1e+47) tmp = (x * y) / z; elseif (y <= 2e+29) tmp = (x / z) - x; else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.1e+47], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 2e+29], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+47}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+29}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if y < -1.1e47Initial program 91.1%
associate-/l*91.0%
+-commutative91.0%
associate-+r-91.0%
div-sub91.1%
*-inverses91.1%
sub-neg91.1%
metadata-eval91.1%
+-commutative91.1%
Simplified91.1%
Taylor expanded in y around inf 75.6%
if -1.1e47 < y < 1.99999999999999983e29Initial program 88.3%
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%
distribute-lft-in99.8%
clear-num99.8%
un-div-inv100.0%
*-commutative100.0%
mul-1-neg100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 92.9%
if 1.99999999999999983e29 < y Initial program 87.9%
*-commutative87.9%
associate-/l*89.4%
+-commutative89.4%
Applied egg-rr89.4%
Taylor expanded in y around inf 73.0%
(FPCore (x y z) :precision binary64 (if (<= x 1.7e-114) (/ (* x (+ (- y z) 1.0)) z) (- (/ x (/ z (+ y 1.0))) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.7e-114) {
tmp = (x * ((y - z) + 1.0)) / z;
} else {
tmp = (x / (z / (y + 1.0))) - x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.7d-114) then
tmp = (x * ((y - z) + 1.0d0)) / z
else
tmp = (x / (z / (y + 1.0d0))) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.7e-114) {
tmp = (x * ((y - z) + 1.0)) / z;
} else {
tmp = (x / (z / (y + 1.0))) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.7e-114: tmp = (x * ((y - z) + 1.0)) / z else: tmp = (x / (z / (y + 1.0))) - x return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.7e-114) tmp = Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z); else tmp = Float64(Float64(x / Float64(z / Float64(y + 1.0))) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.7e-114) tmp = (x * ((y - z) + 1.0)) / z; else tmp = (x / (z / (y + 1.0))) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.7e-114], N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / N[(z / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.7 \cdot 10^{-114}:\\
\;\;\;\;\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + 1}} - x\\
\end{array}
\end{array}
if x < 1.69999999999999991e-114Initial program 92.0%
if 1.69999999999999991e-114 < x Initial program 82.6%
associate-/l*99.7%
+-commutative99.7%
associate-+r-99.7%
div-sub99.7%
*-inverses99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
distribute-lft-in99.7%
clear-num99.7%
un-div-inv99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Final simplification94.7%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ (- y z) 1.0))) (if (<= x 0.001) (/ (* x t_0) z) (* t_0 (/ x z)))))
double code(double x, double y, double z) {
double t_0 = (y - z) + 1.0;
double tmp;
if (x <= 0.001) {
tmp = (x * t_0) / z;
} else {
tmp = t_0 * (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) :: t_0
real(8) :: tmp
t_0 = (y - z) + 1.0d0
if (x <= 0.001d0) then
tmp = (x * t_0) / z
else
tmp = t_0 * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y - z) + 1.0;
double tmp;
if (x <= 0.001) {
tmp = (x * t_0) / z;
} else {
tmp = t_0 * (x / z);
}
return tmp;
}
def code(x, y, z): t_0 = (y - z) + 1.0 tmp = 0 if x <= 0.001: tmp = (x * t_0) / z else: tmp = t_0 * (x / z) return tmp
function code(x, y, z) t_0 = Float64(Float64(y - z) + 1.0) tmp = 0.0 if (x <= 0.001) tmp = Float64(Float64(x * t_0) / z); else tmp = Float64(t_0 * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y - z) + 1.0; tmp = 0.0; if (x <= 0.001) tmp = (x * t_0) / z; else tmp = t_0 * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[x, 0.001], N[(N[(x * t$95$0), $MachinePrecision] / z), $MachinePrecision], N[(t$95$0 * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y - z\right) + 1\\
\mathbf{if}\;x \leq 0.001:\\
\;\;\;\;\frac{x \cdot t\_0}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{x}{z}\\
\end{array}
\end{array}
if x < 1e-3Initial program 92.8%
if 1e-3 < x Initial program 77.5%
*-commutative77.5%
associate-/l*99.9%
+-commutative99.9%
Applied egg-rr99.9%
Final simplification94.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 200000000000.0))) (- x) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 200000000000.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 <= 200000000000.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 <= 200000000000.0)) {
tmp = -x;
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 200000000000.0): tmp = -x else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 200000000000.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 <= 200000000000.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, 200000000000.0]], $MachinePrecision]], (-x), N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 200000000000\right):\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if z < -1 or 2e11 < z Initial program 76.8%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 70.4%
neg-mul-170.4%
Simplified70.4%
if -1 < z < 2e11Initial program 99.8%
Taylor expanded in y around 0 56.2%
associate-/l*56.0%
Simplified56.0%
Taylor expanded in z around 0 55.7%
Taylor expanded in x around 0 55.8%
Final simplification62.8%
(FPCore (x y z) :precision binary64 (* x (+ (/ (+ y 1.0) z) -1.0)))
double code(double x, double y, double z) {
return x * (((y + 1.0) / z) + -1.0);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (((y + 1.0d0) / z) + (-1.0d0))
end function
public static double code(double x, double y, double z) {
return x * (((y + 1.0) / z) + -1.0);
}
def code(x, y, z): return x * (((y + 1.0) / z) + -1.0)
function code(x, y, z) return Float64(x * Float64(Float64(Float64(y + 1.0) / z) + -1.0)) end
function tmp = code(x, y, z) tmp = x * (((y + 1.0) / z) + -1.0); end
code[x_, y_, z_] := N[(x * N[(N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y + 1}{z} + -1\right)
\end{array}
Initial program 88.8%
associate-/l*95.7%
+-commutative95.7%
associate-+r-95.7%
div-sub95.7%
*-inverses95.7%
sub-neg95.7%
metadata-eval95.7%
+-commutative95.7%
Simplified95.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.8%
associate-/l*95.7%
+-commutative95.7%
associate-+r-95.7%
div-sub95.7%
*-inverses95.7%
sub-neg95.7%
metadata-eval95.7%
+-commutative95.7%
Simplified95.7%
Taylor expanded in z around inf 35.1%
neg-mul-135.1%
Simplified35.1%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return 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*95.7%
+-commutative95.7%
associate-+r-95.7%
div-sub95.7%
*-inverses95.7%
sub-neg95.7%
metadata-eval95.7%
+-commutative95.7%
Simplified95.7%
Taylor expanded in z around inf 35.1%
neg-mul-135.1%
Simplified35.1%
neg-sub035.1%
sub-neg35.1%
add-sqr-sqrt19.5%
sqrt-unprod17.7%
sqr-neg17.7%
sqrt-unprod1.5%
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 2024110
(FPCore (x y z)
:name "Diagrams.TwoD.Segment.Bernstein:evaluateBernstein from diagrams-lib-1.3.0.3"
:precision binary64
:alt
(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))