
(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 (<= z -1e-21) (* x (+ -1.0 (/ (+ y 1.0) z))) (if (<= z 3e+62) (* (+ (- y z) 1.0) (/ x z)) (* x (+ -1.0 (/ y z))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1e-21) {
tmp = x * (-1.0 + ((y + 1.0) / z));
} else if (z <= 3e+62) {
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 <= (-1d-21)) then
tmp = x * ((-1.0d0) + ((y + 1.0d0) / z))
else if (z <= 3d+62) 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 <= -1e-21) {
tmp = x * (-1.0 + ((y + 1.0) / z));
} else if (z <= 3e+62) {
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 <= -1e-21: tmp = x * (-1.0 + ((y + 1.0) / z)) elif z <= 3e+62: 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 <= -1e-21) tmp = Float64(x * Float64(-1.0 + Float64(Float64(y + 1.0) / z))); elseif (z <= 3e+62) 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 <= -1e-21) tmp = x * (-1.0 + ((y + 1.0) / z)); elseif (z <= 3e+62) 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, -1e-21], N[(x * N[(-1.0 + N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+62], 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 -1 \cdot 10^{-21}:\\
\;\;\;\;x \cdot \left(-1 + \frac{y + 1}{z}\right)\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+62}:\\
\;\;\;\;\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 < -9.99999999999999908e-22Initial program 77.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%
if -9.99999999999999908e-22 < z < 3e62Initial program 99.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
Applied egg-rr99.9%
if 3e62 < z Initial program 69.7%
associate-/l*100.0%
+-commutative100.0%
associate-+r-100.0%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= z -1.06e+39)
(- x)
(if (<= z 5.2e-280)
t_0
(if (<= z 8.2e-101) (/ x z) (if (<= z 15.0) t_0 (- x)))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -1.06e+39) {
tmp = -x;
} else if (z <= 5.2e-280) {
tmp = t_0;
} else if (z <= 8.2e-101) {
tmp = x / z;
} else if (z <= 15.0) {
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.06d+39)) then
tmp = -x
else if (z <= 5.2d-280) then
tmp = t_0
else if (z <= 8.2d-101) then
tmp = x / z
else if (z <= 15.0d0) 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.06e+39) {
tmp = -x;
} else if (z <= 5.2e-280) {
tmp = t_0;
} else if (z <= 8.2e-101) {
tmp = x / z;
} else if (z <= 15.0) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) tmp = 0 if z <= -1.06e+39: tmp = -x elif z <= 5.2e-280: tmp = t_0 elif z <= 8.2e-101: tmp = x / z elif z <= 15.0: 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.06e+39) tmp = Float64(-x); elseif (z <= 5.2e-280) tmp = t_0; elseif (z <= 8.2e-101) tmp = Float64(x / z); elseif (z <= 15.0) 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.06e+39) tmp = -x; elseif (z <= 5.2e-280) tmp = t_0; elseif (z <= 8.2e-101) tmp = x / z; elseif (z <= 15.0) 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.06e+39], (-x), If[LessEqual[z, 5.2e-280], t$95$0, If[LessEqual[z, 8.2e-101], N[(x / z), $MachinePrecision], If[LessEqual[z, 15.0], t$95$0, (-x)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -1.06 \cdot 10^{+39}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-280}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-101}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 15:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -1.06000000000000005e39 or 15 < z Initial program 74.0%
associate-/l*100.0%
+-commutative100.0%
associate-+r-100.0%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 78.3%
neg-mul-178.3%
Simplified78.3%
if -1.06000000000000005e39 < z < 5.2e-280 or 8.20000000000000052e-101 < z < 15Initial program 99.8%
associate-/l*90.8%
+-commutative90.8%
associate-+r-90.8%
div-sub90.9%
*-inverses90.9%
sub-neg90.9%
+-commutative90.9%
metadata-eval90.9%
Simplified90.9%
Taylor expanded in y around inf 68.4%
*-commutative68.4%
associate-/l*71.4%
Applied egg-rr71.4%
if 5.2e-280 < z < 8.20000000000000052e-101Initial program 100.0%
associate-/l*90.6%
+-commutative90.6%
associate-+r-90.6%
div-sub90.6%
*-inverses90.6%
sub-neg90.6%
+-commutative90.6%
metadata-eval90.6%
Simplified90.6%
Taylor expanded in z around 0 100.0%
associate-/l*90.6%
Simplified90.6%
Taylor expanded in y around 0 69.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ y z))))
(if (<= z -8.5e+36)
(- x)
(if (<= z 1.6e-282)
t_0
(if (<= z 8.5e-101) (/ x z) (if (<= z 15.0) t_0 (- x)))))))
double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (z <= -8.5e+36) {
tmp = -x;
} else if (z <= 1.6e-282) {
tmp = t_0;
} else if (z <= 8.5e-101) {
tmp = x / z;
} else if (z <= 15.0) {
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 <= (-8.5d+36)) then
tmp = -x
else if (z <= 1.6d-282) then
tmp = t_0
else if (z <= 8.5d-101) then
tmp = x / z
else if (z <= 15.0d0) 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 <= -8.5e+36) {
tmp = -x;
} else if (z <= 1.6e-282) {
tmp = t_0;
} else if (z <= 8.5e-101) {
tmp = x / z;
} else if (z <= 15.0) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y / z) tmp = 0 if z <= -8.5e+36: tmp = -x elif z <= 1.6e-282: tmp = t_0 elif z <= 8.5e-101: tmp = x / z elif z <= 15.0: 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 <= -8.5e+36) tmp = Float64(-x); elseif (z <= 1.6e-282) tmp = t_0; elseif (z <= 8.5e-101) tmp = Float64(x / z); elseif (z <= 15.0) 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 <= -8.5e+36) tmp = -x; elseif (z <= 1.6e-282) tmp = t_0; elseif (z <= 8.5e-101) tmp = x / z; elseif (z <= 15.0) 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, -8.5e+36], (-x), If[LessEqual[z, 1.6e-282], t$95$0, If[LessEqual[z, 8.5e-101], N[(x / z), $MachinePrecision], If[LessEqual[z, 15.0], t$95$0, (-x)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+36}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-282}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-101}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 15:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -8.50000000000000014e36 or 15 < z Initial program 74.0%
associate-/l*100.0%
+-commutative100.0%
associate-+r-100.0%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 78.3%
neg-mul-178.3%
Simplified78.3%
if -8.50000000000000014e36 < z < 1.59999999999999991e-282 or 8.49999999999999941e-101 < z < 15Initial program 99.8%
associate-/l*90.8%
+-commutative90.8%
associate-+r-90.8%
div-sub90.9%
*-inverses90.9%
sub-neg90.9%
+-commutative90.9%
metadata-eval90.9%
Simplified90.9%
Taylor expanded in y around inf 68.4%
associate-/l*59.5%
Simplified59.5%
if 1.59999999999999991e-282 < z < 8.49999999999999941e-101Initial program 100.0%
associate-/l*90.6%
+-commutative90.6%
associate-+r-90.6%
div-sub90.6%
*-inverses90.6%
sub-neg90.6%
+-commutative90.6%
metadata-eval90.6%
Simplified90.6%
Taylor expanded in z around 0 100.0%
associate-/l*90.6%
Simplified90.6%
Taylor expanded in y around 0 69.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -8.5e-23) (not (<= z 5.5e-37))) (* x (+ -1.0 (/ (+ y 1.0) z))) (/ (* x (+ y 1.0)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -8.5e-23) || !(z <= 5.5e-37)) {
tmp = x * (-1.0 + ((y + 1.0) / 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 <= (-8.5d-23)) .or. (.not. (z <= 5.5d-37))) then
tmp = x * ((-1.0d0) + ((y + 1.0d0) / 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 <= -8.5e-23) || !(z <= 5.5e-37)) {
tmp = x * (-1.0 + ((y + 1.0) / z));
} else {
tmp = (x * (y + 1.0)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -8.5e-23) or not (z <= 5.5e-37): tmp = x * (-1.0 + ((y + 1.0) / z)) else: tmp = (x * (y + 1.0)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -8.5e-23) || !(z <= 5.5e-37)) tmp = Float64(x * Float64(-1.0 + Float64(Float64(y + 1.0) / z))); 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 <= -8.5e-23) || ~((z <= 5.5e-37))) tmp = x * (-1.0 + ((y + 1.0) / z)); else tmp = (x * (y + 1.0)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -8.5e-23], N[Not[LessEqual[z, 5.5e-37]], $MachinePrecision]], N[(x * N[(-1.0 + N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-23} \lor \neg \left(z \leq 5.5 \cdot 10^{-37}\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y + 1}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y + 1\right)}{z}\\
\end{array}
\end{array}
if z < -8.4999999999999996e-23 or 5.4999999999999998e-37 < z Initial program 78.1%
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 -8.4999999999999996e-23 < z < 5.4999999999999998e-37Initial program 99.9%
associate-/l*89.2%
+-commutative89.2%
associate-+r-89.2%
div-sub89.2%
*-inverses89.2%
sub-neg89.2%
+-commutative89.2%
metadata-eval89.2%
Simplified89.2%
Taylor expanded in z around 0 99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -5.8e+14) (not (<= z 1.0))) (* x (+ -1.0 (/ y z))) (/ (* x (+ y 1.0)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.8e+14) || !(z <= 1.0)) {
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 <= (-5.8d+14)) .or. (.not. (z <= 1.0d0))) 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 <= -5.8e+14) || !(z <= 1.0)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (x * (y + 1.0)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.8e+14) or not (z <= 1.0): 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 <= -5.8e+14) || !(z <= 1.0)) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); 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 <= -5.8e+14) || ~((z <= 1.0))) 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, -5.8e+14], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+14} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y + 1\right)}{z}\\
\end{array}
\end{array}
if z < -5.8e14 or 1 < z Initial program 75.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.3%
if -5.8e14 < z < 1Initial program 99.9%
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 z around 0 99.1%
Final simplification99.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -2120000000.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 <= -2120000000.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 <= (-2120000000.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 <= -2120000000.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 <= -2120000000.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 <= -2120000000.0) || !(z <= 1.0)) 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 <= -2120000000.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, -2120000000.0], N[Not[LessEqual[z, 1.0]], $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 -2120000000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + 1}}\\
\end{array}
\end{array}
if z < -2.12e9 or 1 < z Initial program 75.9%
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.3%
if -2.12e9 < z < 1Initial program 99.9%
associate-/l*90.1%
+-commutative90.1%
associate-+r-90.1%
div-sub90.2%
*-inverses90.2%
sub-neg90.2%
+-commutative90.2%
metadata-eval90.2%
Simplified90.2%
Taylor expanded in z around 0 99.1%
associate-/l*89.4%
Simplified89.4%
clear-num89.4%
+-commutative89.4%
div-inv90.0%
Applied egg-rr90.0%
Final simplification94.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -5.8e+14) (not (<= z 1.0))) (* x (+ -1.0 (/ y z))) (* x (/ (+ y 1.0) z))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.8e+14) || !(z <= 1.0)) {
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 <= (-5.8d+14)) .or. (.not. (z <= 1.0d0))) 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 <= -5.8e+14) || !(z <= 1.0)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = x * ((y + 1.0) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.8e+14) or not (z <= 1.0): 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 <= -5.8e+14) || !(z <= 1.0)) 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 <= -5.8e+14) || ~((z <= 1.0))) 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, -5.8e+14], N[Not[LessEqual[z, 1.0]], $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 -5.8 \cdot 10^{+14} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y + 1}{z}\\
\end{array}
\end{array}
if z < -5.8e14 or 1 < z Initial program 75.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.3%
if -5.8e14 < z < 1Initial program 99.9%
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 z around 0 99.1%
associate-/l*89.5%
Simplified89.5%
Final simplification94.1%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.4e+55) (not (<= y 3.6e+93))) (* y (/ x z)) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.4e+55) || !(y <= 3.6e+93)) {
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 <= (-1.4d+55)) .or. (.not. (y <= 3.6d+93))) 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 <= -1.4e+55) || !(y <= 3.6e+93)) {
tmp = y * (x / z);
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.4e+55) or not (y <= 3.6e+93): tmp = y * (x / z) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.4e+55) || !(y <= 3.6e+93)) 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 <= -1.4e+55) || ~((y <= 3.6e+93))) tmp = y * (x / z); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.4e+55], N[Not[LessEqual[y, 3.6e+93]], $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 -1.4 \cdot 10^{+55} \lor \neg \left(y \leq 3.6 \cdot 10^{+93}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -1.4e55 or 3.5999999999999999e93 < y Initial program 91.9%
associate-/l*87.7%
+-commutative87.7%
associate-+r-87.7%
div-sub87.7%
*-inverses87.7%
sub-neg87.7%
+-commutative87.7%
metadata-eval87.7%
Simplified87.7%
Taylor expanded in y around inf 84.1%
*-commutative84.1%
associate-/l*81.8%
Applied egg-rr81.8%
if -1.4e55 < y < 3.5999999999999999e93Initial program 86.1%
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%
Taylor expanded in y around 0 91.6%
Final simplification87.5%
(FPCore (x y z) :precision binary64 (if (<= y -1.0) (* x (+ -1.0 (/ y z))) (if (<= y 8.5e+99) (- (/ x z) x) (/ (* x y) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.0) {
tmp = x * (-1.0 + (y / z));
} else if (y <= 8.5e+99) {
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 <= (-1.0d0)) then
tmp = x * ((-1.0d0) + (y / z))
else if (y <= 8.5d+99) 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 <= -1.0) {
tmp = x * (-1.0 + (y / z));
} else if (y <= 8.5e+99) {
tmp = (x / z) - x;
} else {
tmp = (x * y) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.0: tmp = x * (-1.0 + (y / z)) elif y <= 8.5e+99: tmp = (x / z) - x else: tmp = (x * y) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.0) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); elseif (y <= 8.5e+99) 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 <= -1.0) tmp = x * (-1.0 + (y / z)); elseif (y <= 8.5e+99) tmp = (x / z) - x; else tmp = (x * y) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.0], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+99], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+99}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\end{array}
\end{array}
if y < -1Initial program 86.0%
associate-/l*91.2%
+-commutative91.2%
associate-+r-91.2%
div-sub91.2%
*-inverses91.2%
sub-neg91.2%
+-commutative91.2%
metadata-eval91.2%
Simplified91.2%
Taylor expanded in y around inf 89.3%
if -1 < y < 8.49999999999999984e99Initial program 87.4%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
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 95.1%
if 8.49999999999999984e99 < y Initial program 95.8%
associate-/l*85.9%
+-commutative85.9%
associate-+r-85.9%
div-sub85.9%
*-inverses85.9%
sub-neg85.9%
+-commutative85.9%
metadata-eval85.9%
Simplified85.9%
Taylor expanded in y around inf 93.7%
Final simplification93.2%
(FPCore (x y z) :precision binary64 (if (<= y -9.2e+54) (* y (/ x z)) (if (<= y 1.6e+101) (- (/ x z) x) (/ (* x y) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -9.2e+54) {
tmp = y * (x / z);
} else if (y <= 1.6e+101) {
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 <= (-9.2d+54)) then
tmp = y * (x / z)
else if (y <= 1.6d+101) 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 <= -9.2e+54) {
tmp = y * (x / z);
} else if (y <= 1.6e+101) {
tmp = (x / z) - x;
} else {
tmp = (x * y) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -9.2e+54: tmp = y * (x / z) elif y <= 1.6e+101: tmp = (x / z) - x else: tmp = (x * y) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -9.2e+54) tmp = Float64(y * Float64(x / z)); elseif (y <= 1.6e+101) 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 <= -9.2e+54) tmp = y * (x / z); elseif (y <= 1.6e+101) tmp = (x / z) - x; else tmp = (x * y) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -9.2e+54], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e+101], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{+54}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+101}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\end{array}
\end{array}
if y < -9.19999999999999977e54Initial program 88.9%
associate-/l*89.1%
+-commutative89.1%
associate-+r-89.1%
div-sub89.1%
*-inverses89.1%
sub-neg89.1%
+-commutative89.1%
metadata-eval89.1%
Simplified89.1%
Taylor expanded in y around inf 76.6%
*-commutative76.6%
associate-/l*78.1%
Applied egg-rr78.1%
if -9.19999999999999977e54 < y < 1.60000000000000003e101Initial program 86.1%
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%
Taylor expanded in y around 0 91.6%
if 1.60000000000000003e101 < y Initial program 95.8%
associate-/l*85.9%
+-commutative85.9%
associate-+r-85.9%
div-sub85.9%
*-inverses85.9%
sub-neg85.9%
+-commutative85.9%
metadata-eval85.9%
Simplified85.9%
Taylor expanded in y around inf 93.7%
(FPCore (x y z) :precision binary64 (if (<= x 1.18e-103) (/ (* 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.18e-103) {
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.18d-103) 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.18e-103) {
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.18e-103: 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.18e-103) 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.18e-103) 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.18e-103], 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.18 \cdot 10^{-103}:\\
\;\;\;\;\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.1800000000000001e-103Initial program 90.5%
if 1.1800000000000001e-103 < x Initial program 85.3%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
+-commutative99.8%
metadata-eval99.8%
Simplified99.8%
distribute-lft-in99.8%
clear-num99.8%
un-div-inv99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Final simplification94.0%
(FPCore (x y z) :precision binary64 (if (<= x 1.1e+26) (/ (* x (+ (- y z) 1.0)) z) (* x (+ -1.0 (/ (+ y 1.0) z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.1e+26) {
tmp = (x * ((y - z) + 1.0)) / z;
} else {
tmp = x * (-1.0 + ((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 (x <= 1.1d+26) then
tmp = (x * ((y - z) + 1.0d0)) / z
else
tmp = x * ((-1.0d0) + ((y + 1.0d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.1e+26) {
tmp = (x * ((y - z) + 1.0)) / z;
} else {
tmp = x * (-1.0 + ((y + 1.0) / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.1e+26: tmp = (x * ((y - z) + 1.0)) / z else: tmp = x * (-1.0 + ((y + 1.0) / z)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.1e+26) tmp = Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z); else tmp = Float64(x * Float64(-1.0 + Float64(Float64(y + 1.0) / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.1e+26) tmp = (x * ((y - z) + 1.0)) / z; else tmp = x * (-1.0 + ((y + 1.0) / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.1e+26], N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x * N[(-1.0 + N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.1 \cdot 10^{+26}:\\
\;\;\;\;\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-1 + \frac{y + 1}{z}\right)\\
\end{array}
\end{array}
if x < 1.10000000000000004e26Initial program 92.2%
if 1.10000000000000004e26 < x Initial program 76.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%
Final simplification94.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -5.8e+14) (not (<= z 1.0))) (- x) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.8e+14) || !(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 <= (-5.8d+14)) .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 <= -5.8e+14) || !(z <= 1.0)) {
tmp = -x;
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.8e+14) or not (z <= 1.0): tmp = -x else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.8e+14) || !(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 <= -5.8e+14) || ~((z <= 1.0))) tmp = -x; else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.8e+14], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], (-x), N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+14} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if z < -5.8e14 or 1 < z Initial program 75.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 z around inf 74.9%
neg-mul-174.9%
Simplified74.9%
if -5.8e14 < z < 1Initial program 99.9%
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 z around 0 99.1%
associate-/l*89.5%
Simplified89.5%
Taylor expanded in y around 0 52.7%
Final simplification63.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 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*94.8%
+-commutative94.8%
associate-+r-94.8%
div-sub94.8%
*-inverses94.8%
sub-neg94.8%
+-commutative94.8%
metadata-eval94.8%
Simplified94.8%
Taylor expanded in z around inf 36.5%
neg-mul-136.5%
Simplified36.5%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return 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*94.8%
+-commutative94.8%
associate-+r-94.8%
div-sub94.8%
*-inverses94.8%
sub-neg94.8%
+-commutative94.8%
metadata-eval94.8%
Simplified94.8%
Taylor expanded in z around inf 36.5%
neg-mul-136.5%
Simplified36.5%
neg-sub036.5%
sub-neg36.5%
add-sqr-sqrt17.2%
sqrt-unprod19.3%
sqr-neg19.3%
sqrt-unprod1.9%
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 2024149
(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))