
(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 -9e+26)
(- (* x (/ y z)) x)
(if (<= z 5e-38)
(* (+ (- y z) 1.0) (/ x z))
(* x (+ (/ (+ y 1.0) z) -1.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -9e+26) {
tmp = (x * (y / z)) - x;
} else if (z <= 5e-38) {
tmp = ((y - z) + 1.0) * (x / 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 (z <= (-9d+26)) then
tmp = (x * (y / z)) - x
else if (z <= 5d-38) then
tmp = ((y - z) + 1.0d0) * (x / 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 (z <= -9e+26) {
tmp = (x * (y / z)) - x;
} else if (z <= 5e-38) {
tmp = ((y - z) + 1.0) * (x / z);
} else {
tmp = x * (((y + 1.0) / z) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -9e+26: tmp = (x * (y / z)) - x elif z <= 5e-38: tmp = ((y - z) + 1.0) * (x / z) else: tmp = x * (((y + 1.0) / z) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -9e+26) tmp = Float64(Float64(x * Float64(y / z)) - x); elseif (z <= 5e-38) tmp = Float64(Float64(Float64(y - z) + 1.0) * Float64(x / 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 (z <= -9e+26) tmp = (x * (y / z)) - x; elseif (z <= 5e-38) tmp = ((y - z) + 1.0) * (x / z); else tmp = x * (((y + 1.0) / z) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -9e+26], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[z, 5e-38], N[(N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+26}:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-38}:\\
\;\;\;\;\left(\left(y - z\right) + 1\right) \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y + 1}{z} + -1\right)\\
\end{array}
\end{array}
if z < -8.99999999999999957e26Initial program 70.3%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 99.9%
distribute-rgt-in99.9%
neg-mul-199.9%
unsub-neg99.9%
*-commutative99.9%
Applied egg-rr99.9%
if -8.99999999999999957e26 < z < 5.00000000000000033e-38Initial program 99.2%
*-commutative99.2%
associate-/l*99.9%
+-commutative99.9%
Applied egg-rr99.9%
if 5.00000000000000033e-38 < z Initial program 82.5%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ y z))))
(if (<= z -2.1e+16)
(- x)
(if (<= z -4.8e-83)
t_0
(if (<= z -3.6e-199)
(/ x z)
(if (<= z 3.2e-241) t_0 (if (<= z 1.0) (/ x z) (- x))))))))
double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (z <= -2.1e+16) {
tmp = -x;
} else if (z <= -4.8e-83) {
tmp = t_0;
} else if (z <= -3.6e-199) {
tmp = x / z;
} else if (z <= 3.2e-241) {
tmp = t_0;
} else if (z <= 1.0) {
tmp = x / z;
} else {
tmp = -x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (y / z)
if (z <= (-2.1d+16)) then
tmp = -x
else if (z <= (-4.8d-83)) then
tmp = t_0
else if (z <= (-3.6d-199)) then
tmp = x / z
else if (z <= 3.2d-241) then
tmp = t_0
else if (z <= 1.0d0) then
tmp = x / z
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (z <= -2.1e+16) {
tmp = -x;
} else if (z <= -4.8e-83) {
tmp = t_0;
} else if (z <= -3.6e-199) {
tmp = x / z;
} else if (z <= 3.2e-241) {
tmp = t_0;
} else if (z <= 1.0) {
tmp = x / z;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y / z) tmp = 0 if z <= -2.1e+16: tmp = -x elif z <= -4.8e-83: tmp = t_0 elif z <= -3.6e-199: tmp = x / z elif z <= 3.2e-241: tmp = t_0 elif z <= 1.0: tmp = x / z else: tmp = -x return tmp
function code(x, y, z) t_0 = Float64(x * Float64(y / z)) tmp = 0.0 if (z <= -2.1e+16) tmp = Float64(-x); elseif (z <= -4.8e-83) tmp = t_0; elseif (z <= -3.6e-199) tmp = Float64(x / z); elseif (z <= 3.2e-241) tmp = t_0; elseif (z <= 1.0) tmp = Float64(x / z); else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (y / z); tmp = 0.0; if (z <= -2.1e+16) tmp = -x; elseif (z <= -4.8e-83) tmp = t_0; elseif (z <= -3.6e-199) tmp = x / z; elseif (z <= 3.2e-241) tmp = t_0; elseif (z <= 1.0) tmp = x / z; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+16], (-x), If[LessEqual[z, -4.8e-83], t$95$0, If[LessEqual[z, -3.6e-199], N[(x / z), $MachinePrecision], If[LessEqual[z, 3.2e-241], t$95$0, If[LessEqual[z, 1.0], N[(x / z), $MachinePrecision], (-x)]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+16}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-83}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-199}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-241}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -2.1e16 or 1 < z Initial program 75.8%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 75.2%
neg-mul-175.2%
Simplified75.2%
if -2.1e16 < z < -4.8000000000000002e-83 or -3.6000000000000002e-199 < z < 3.2e-241Initial program 99.8%
associate-/l*90.0%
+-commutative90.0%
associate-+r-90.0%
div-sub90.0%
*-inverses90.0%
sub-neg90.0%
+-commutative90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in y around inf 71.2%
associate-/l*61.5%
Simplified61.5%
if -4.8000000000000002e-83 < z < -3.6000000000000002e-199 or 3.2e-241 < z < 1Initial program 99.9%
Taylor expanded in y around 0 67.1%
*-commutative67.1%
sub-neg67.1%
metadata-eval67.1%
distribute-neg-in67.1%
+-commutative67.1%
associate-/l*67.1%
+-commutative67.1%
distribute-neg-in67.1%
metadata-eval67.1%
sub-neg67.1%
Simplified67.1%
Taylor expanded in z around 0 66.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= z -2.9e+16)
(- x)
(if (<= z -5.4e-84)
t_0
(if (<= z -4e-191) (/ x z) (if (<= z 1.55e+45) t_0 (- x)))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -2.9e+16) {
tmp = -x;
} else if (z <= -5.4e-84) {
tmp = t_0;
} else if (z <= -4e-191) {
tmp = x / z;
} else if (z <= 1.55e+45) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = y * (x / z)
if (z <= (-2.9d+16)) then
tmp = -x
else if (z <= (-5.4d-84)) then
tmp = t_0
else if (z <= (-4d-191)) then
tmp = x / z
else if (z <= 1.55d+45) then
tmp = t_0
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -2.9e+16) {
tmp = -x;
} else if (z <= -5.4e-84) {
tmp = t_0;
} else if (z <= -4e-191) {
tmp = x / z;
} else if (z <= 1.55e+45) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) tmp = 0 if z <= -2.9e+16: tmp = -x elif z <= -5.4e-84: tmp = t_0 elif z <= -4e-191: tmp = x / z elif z <= 1.55e+45: tmp = t_0 else: tmp = -x return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x / z)) tmp = 0.0 if (z <= -2.9e+16) tmp = Float64(-x); elseif (z <= -5.4e-84) tmp = t_0; elseif (z <= -4e-191) tmp = Float64(x / z); elseif (z <= 1.55e+45) tmp = t_0; else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x / z); tmp = 0.0; if (z <= -2.9e+16) tmp = -x; elseif (z <= -5.4e-84) tmp = t_0; elseif (z <= -4e-191) tmp = x / z; elseif (z <= 1.55e+45) tmp = t_0; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+16], (-x), If[LessEqual[z, -5.4e-84], t$95$0, If[LessEqual[z, -4e-191], N[(x / z), $MachinePrecision], If[LessEqual[z, 1.55e+45], t$95$0, (-x)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+16}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -5.4 \cdot 10^{-84}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-191}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+45}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -2.9e16 or 1.54999999999999994e45 < z Initial program 74.3%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 77.6%
neg-mul-177.6%
Simplified77.6%
if -2.9e16 < z < -5.3999999999999998e-84 or -4.0000000000000001e-191 < z < 1.54999999999999994e45Initial program 99.8%
associate-/l*91.0%
+-commutative91.0%
associate-+r-91.0%
div-sub91.0%
*-inverses91.0%
sub-neg91.0%
+-commutative91.0%
metadata-eval91.0%
Simplified91.0%
Taylor expanded in y around inf 62.7%
*-commutative62.7%
associate-/l*65.2%
Applied egg-rr65.2%
if -5.3999999999999998e-84 < z < -4.0000000000000001e-191Initial program 100.0%
Taylor expanded in y around 0 71.9%
*-commutative71.9%
sub-neg71.9%
metadata-eval71.9%
distribute-neg-in71.9%
+-commutative71.9%
associate-/l*71.9%
+-commutative71.9%
distribute-neg-in71.9%
metadata-eval71.9%
sub-neg71.9%
Simplified71.9%
Taylor expanded in z around 0 71.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -10000000.0) (not (<= z 4e-39))) (* x (+ (/ (+ y 1.0) z) -1.0)) (/ (* x (+ y 1.0)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -10000000.0) || !(z <= 4e-39)) {
tmp = x * (((y + 1.0) / z) + -1.0);
} 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 <= (-10000000.0d0)) .or. (.not. (z <= 4d-39))) then
tmp = x * (((y + 1.0d0) / z) + (-1.0d0))
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 <= -10000000.0) || !(z <= 4e-39)) {
tmp = x * (((y + 1.0) / z) + -1.0);
} else {
tmp = (x * (y + 1.0)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -10000000.0) or not (z <= 4e-39): tmp = x * (((y + 1.0) / z) + -1.0) else: tmp = (x * (y + 1.0)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -10000000.0) || !(z <= 4e-39)) tmp = Float64(x * Float64(Float64(Float64(y + 1.0) / z) + -1.0)); else tmp = Float64(Float64(x * Float64(y + 1.0)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -10000000.0) || ~((z <= 4e-39))) tmp = x * (((y + 1.0) / z) + -1.0); else tmp = (x * (y + 1.0)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -10000000.0], N[Not[LessEqual[z, 4e-39]], $MachinePrecision]], N[(x * N[(N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -10000000 \lor \neg \left(z \leq 4 \cdot 10^{-39}\right):\\
\;\;\;\;x \cdot \left(\frac{y + 1}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y + 1\right)}{z}\\
\end{array}
\end{array}
if z < -1e7 or 3.99999999999999972e-39 < z Initial program 77.6%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
Simplified99.9%
if -1e7 < z < 3.99999999999999972e-39Initial program 99.9%
associate-/l*91.7%
+-commutative91.7%
associate-+r-91.7%
div-sub91.7%
*-inverses91.7%
sub-neg91.7%
+-commutative91.7%
metadata-eval91.7%
Simplified91.7%
Taylor expanded in z around 0 99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -4000.0) (not (<= y 1.0))) (* x (+ (/ y z) -1.0)) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4000.0) || !(y <= 1.0)) {
tmp = x * ((y / z) + -1.0);
} else {
tmp = (x / z) - x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-4000.0d0)) .or. (.not. (y <= 1.0d0))) then
tmp = x * ((y / z) + (-1.0d0))
else
tmp = (x / z) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -4000.0) || !(y <= 1.0)) {
tmp = x * ((y / z) + -1.0);
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4000.0) or not (y <= 1.0): tmp = x * ((y / z) + -1.0) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4000.0) || !(y <= 1.0)) tmp = Float64(x * Float64(Float64(y / z) + -1.0)); else tmp = Float64(Float64(x / z) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -4000.0) || ~((y <= 1.0))) tmp = x * ((y / z) + -1.0); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4000.0], N[Not[LessEqual[y, 1.0]], $MachinePrecision]], N[(x * N[(N[(y / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4000 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;x \cdot \left(\frac{y}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -4e3 or 1 < y Initial program 88.7%
associate-/l*92.3%
+-commutative92.3%
associate-+r-92.3%
div-sub92.3%
*-inverses92.3%
sub-neg92.3%
+-commutative92.3%
metadata-eval92.3%
Simplified92.3%
Taylor expanded in y around inf 92.1%
if -4e3 < y < 1Initial program 88.4%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
Simplified99.9%
distribute-lft-in99.9%
clear-num99.8%
un-div-inv100.0%
*-commutative100.0%
mul-1-neg100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 99.3%
Final simplification95.5%
(FPCore (x y z) :precision binary64 (if (<= z -10000000.0) (- (* x (/ y z)) x) (if (<= z 1.0) (/ (* x (+ y 1.0)) z) (* x (+ (/ y z) -1.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -10000000.0) {
tmp = (x * (y / z)) - x;
} else if (z <= 1.0) {
tmp = (x * (y + 1.0)) / z;
} else {
tmp = x * ((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 (z <= (-10000000.0d0)) then
tmp = (x * (y / z)) - x
else if (z <= 1.0d0) then
tmp = (x * (y + 1.0d0)) / z
else
tmp = x * ((y / z) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -10000000.0) {
tmp = (x * (y / z)) - x;
} else if (z <= 1.0) {
tmp = (x * (y + 1.0)) / z;
} else {
tmp = x * ((y / z) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -10000000.0: tmp = (x * (y / z)) - x elif z <= 1.0: tmp = (x * (y + 1.0)) / z else: tmp = x * ((y / z) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -10000000.0) tmp = Float64(Float64(x * Float64(y / z)) - x); elseif (z <= 1.0) tmp = Float64(Float64(x * Float64(y + 1.0)) / z); else tmp = Float64(x * Float64(Float64(y / z) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -10000000.0) tmp = (x * (y / z)) - x; elseif (z <= 1.0) tmp = (x * (y + 1.0)) / z; else tmp = x * ((y / z) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -10000000.0], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -10000000:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{x \cdot \left(y + 1\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + -1\right)\\
\end{array}
\end{array}
if z < -1e7Initial program 71.8%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 99.2%
distribute-rgt-in99.2%
neg-mul-199.2%
unsub-neg99.2%
*-commutative99.2%
Applied egg-rr99.2%
if -1e7 < z < 1Initial program 99.9%
associate-/l*92.1%
+-commutative92.1%
associate-+r-92.1%
div-sub92.1%
*-inverses92.1%
sub-neg92.1%
+-commutative92.1%
metadata-eval92.1%
Simplified92.1%
Taylor expanded in z around 0 99.7%
if 1 < z Initial program 80.7%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 99.0%
Final simplification99.4%
(FPCore (x y z) :precision binary64 (if (<= y -4000.0) (* x (+ (/ y z) -1.0)) (if (<= y 1.0) (- (/ x z) x) (- (* x (/ y z)) x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -4000.0) {
tmp = x * ((y / z) + -1.0);
} else if (y <= 1.0) {
tmp = (x / z) - x;
} else {
tmp = (x * (y / z)) - x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-4000.0d0)) then
tmp = x * ((y / z) + (-1.0d0))
else if (y <= 1.0d0) then
tmp = (x / z) - x
else
tmp = (x * (y / z)) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -4000.0) {
tmp = x * ((y / z) + -1.0);
} else if (y <= 1.0) {
tmp = (x / z) - x;
} else {
tmp = (x * (y / z)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -4000.0: tmp = x * ((y / z) + -1.0) elif y <= 1.0: tmp = (x / z) - x else: tmp = (x * (y / z)) - x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -4000.0) tmp = Float64(x * Float64(Float64(y / z) + -1.0)); elseif (y <= 1.0) tmp = Float64(Float64(x / z) - x); else tmp = Float64(Float64(x * Float64(y / z)) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -4000.0) tmp = x * ((y / z) + -1.0); elseif (y <= 1.0) tmp = (x / z) - x; else tmp = (x * (y / z)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -4000.0], N[(x * N[(N[(y / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4000:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + -1\right)\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\end{array}
\end{array}
if y < -4e3Initial program 90.2%
associate-/l*91.5%
+-commutative91.5%
associate-+r-91.5%
div-sub91.5%
*-inverses91.5%
sub-neg91.5%
+-commutative91.5%
metadata-eval91.5%
Simplified91.5%
Taylor expanded in y around inf 91.5%
if -4e3 < y < 1Initial program 88.4%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
Simplified99.9%
distribute-lft-in99.9%
clear-num99.8%
un-div-inv100.0%
*-commutative100.0%
mul-1-neg100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 99.3%
if 1 < y Initial program 87.2%
associate-/l*93.1%
+-commutative93.1%
associate-+r-93.1%
div-sub93.1%
*-inverses93.1%
sub-neg93.1%
+-commutative93.1%
metadata-eval93.1%
Simplified93.1%
Taylor expanded in y around inf 92.7%
distribute-rgt-in92.8%
neg-mul-192.8%
unsub-neg92.8%
*-commutative92.8%
Applied egg-rr92.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -10000.0) (not (<= y 1.8e+186))) (* y (/ x z)) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -10000.0) || !(y <= 1.8e+186)) {
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 <= (-10000.0d0)) .or. (.not. (y <= 1.8d+186))) 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 <= -10000.0) || !(y <= 1.8e+186)) {
tmp = y * (x / z);
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -10000.0) or not (y <= 1.8e+186): tmp = y * (x / z) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -10000.0) || !(y <= 1.8e+186)) 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 <= -10000.0) || ~((y <= 1.8e+186))) tmp = y * (x / z); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -10000.0], N[Not[LessEqual[y, 1.8e+186]], $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 -10000 \lor \neg \left(y \leq 1.8 \cdot 10^{+186}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -1e4 or 1.8000000000000001e186 < y Initial program 89.2%
associate-/l*90.2%
+-commutative90.2%
associate-+r-90.2%
div-sub90.2%
*-inverses90.2%
sub-neg90.2%
+-commutative90.2%
metadata-eval90.2%
Simplified90.2%
Taylor expanded in y around inf 80.6%
*-commutative80.6%
associate-/l*81.3%
Applied egg-rr81.3%
if -1e4 < y < 1.8000000000000001e186Initial program 88.2%
associate-/l*99.3%
+-commutative99.3%
associate-+r-99.3%
div-sub99.3%
*-inverses99.3%
sub-neg99.3%
+-commutative99.3%
metadata-eval99.3%
Simplified99.3%
distribute-lft-in99.3%
clear-num99.3%
un-div-inv99.4%
*-commutative99.4%
mul-1-neg99.4%
Applied egg-rr99.4%
Taylor expanded in y around 0 91.1%
Final simplification87.4%
(FPCore (x y z) :precision binary64 (if (<= y -6800.0) (* y (/ x z)) (if (<= y 1.8e+186) (- (/ x z) x) (/ (* x y) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -6800.0) {
tmp = y * (x / z);
} else if (y <= 1.8e+186) {
tmp = (x / z) - x;
} else {
tmp = (x * y) / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-6800.0d0)) then
tmp = y * (x / z)
else if (y <= 1.8d+186) then
tmp = (x / z) - x
else
tmp = (x * y) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -6800.0) {
tmp = y * (x / z);
} else if (y <= 1.8e+186) {
tmp = (x / z) - x;
} else {
tmp = (x * y) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -6800.0: tmp = y * (x / z) elif y <= 1.8e+186: tmp = (x / z) - x else: tmp = (x * y) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -6800.0) tmp = Float64(y * Float64(x / z)); elseif (y <= 1.8e+186) tmp = Float64(Float64(x / z) - x); else tmp = Float64(Float64(x * y) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -6800.0) tmp = y * (x / z); elseif (y <= 1.8e+186) tmp = (x / z) - x; else tmp = (x * y) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -6800.0], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e+186], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6800:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+186}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\end{array}
\end{array}
if y < -6800Initial program 90.2%
associate-/l*91.5%
+-commutative91.5%
associate-+r-91.5%
div-sub91.5%
*-inverses91.5%
sub-neg91.5%
+-commutative91.5%
metadata-eval91.5%
Simplified91.5%
Taylor expanded in y around inf 81.0%
*-commutative81.0%
associate-/l*83.1%
Applied egg-rr83.1%
if -6800 < y < 1.8000000000000001e186Initial program 88.2%
associate-/l*99.3%
+-commutative99.3%
associate-+r-99.3%
div-sub99.3%
*-inverses99.3%
sub-neg99.3%
+-commutative99.3%
metadata-eval99.3%
Simplified99.3%
distribute-lft-in99.3%
clear-num99.3%
un-div-inv99.4%
*-commutative99.4%
mul-1-neg99.4%
Applied egg-rr99.4%
Taylor expanded in y around 0 91.1%
if 1.8000000000000001e186 < y Initial program 86.7%
associate-/l*87.0%
+-commutative87.0%
associate-+r-87.0%
div-sub87.0%
*-inverses87.0%
sub-neg87.0%
+-commutative87.0%
metadata-eval87.0%
Simplified87.0%
Taylor expanded in y around inf 79.5%
(FPCore (x y z) :precision binary64 (if (<= x 2e-67) (/ (* x (+ (- y z) 1.0)) z) (- (/ x (/ z (+ y 1.0))) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 2e-67) {
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 <= 2d-67) 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 <= 2e-67) {
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 <= 2e-67: 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 <= 2e-67) 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 <= 2e-67) 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, 2e-67], 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 2 \cdot 10^{-67}:\\
\;\;\;\;\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.99999999999999989e-67Initial program 89.9%
if 1.99999999999999989e-67 < x Initial program 86.0%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
Simplified99.9%
distribute-lft-in99.9%
clear-num99.9%
un-div-inv99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Final simplification93.3%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ (- y z) 1.0))) (if (<= x 2.5e-46) (/ (* 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 <= 2.5e-46) {
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 <= 2.5d-46) 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 <= 2.5e-46) {
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 <= 2.5e-46: 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 <= 2.5e-46) 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 <= 2.5e-46) 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, 2.5e-46], 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 2.5 \cdot 10^{-46}:\\
\;\;\;\;\frac{x \cdot t\_0}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{x}{z}\\
\end{array}
\end{array}
if x < 2.49999999999999996e-46Initial program 90.2%
if 2.49999999999999996e-46 < x Initial program 85.1%
*-commutative85.1%
associate-/l*100.0%
+-commutative100.0%
Applied egg-rr100.0%
Final simplification93.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.5e-15) (not (<= z 1.0))) (- x) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.5e-15) || !(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 <= (-2.5d-15)) .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 <= -2.5e-15) || !(z <= 1.0)) {
tmp = -x;
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.5e-15) or not (z <= 1.0): tmp = -x else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.5e-15) || !(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 <= -2.5e-15) || ~((z <= 1.0))) tmp = -x; else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.5e-15], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], (-x), N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-15} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if z < -2.5e-15 or 1 < z Initial program 76.9%
associate-/l*99.1%
+-commutative99.1%
associate-+r-99.1%
div-sub99.1%
*-inverses99.1%
sub-neg99.1%
+-commutative99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in z around inf 72.2%
neg-mul-172.2%
Simplified72.2%
if -2.5e-15 < z < 1Initial program 99.9%
Taylor expanded in y around 0 54.4%
*-commutative54.4%
sub-neg54.4%
metadata-eval54.4%
distribute-neg-in54.4%
+-commutative54.4%
associate-/l*54.4%
+-commutative54.4%
distribute-neg-in54.4%
metadata-eval54.4%
sub-neg54.4%
Simplified54.4%
Taylor expanded in z around 0 54.1%
Final simplification63.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 88.6%
associate-/l*95.9%
+-commutative95.9%
associate-+r-95.9%
div-sub95.9%
*-inverses95.9%
sub-neg95.9%
+-commutative95.9%
metadata-eval95.9%
Simplified95.9%
Taylor expanded in z around inf 37.1%
neg-mul-137.1%
Simplified37.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.6%
associate-/l*95.9%
+-commutative95.9%
associate-+r-95.9%
div-sub95.9%
*-inverses95.9%
sub-neg95.9%
+-commutative95.9%
metadata-eval95.9%
Simplified95.9%
Taylor expanded in z around inf 37.1%
neg-mul-137.1%
Simplified37.1%
neg-sub037.1%
sub-neg37.1%
add-sqr-sqrt16.6%
sqrt-unprod18.6%
sqr-neg18.6%
sqrt-unprod1.9%
add-sqr-sqrt3.1%
Applied egg-rr3.1%
+-lft-identity3.1%
Simplified3.1%
(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 2024191
(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))