
(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 -3e-58) (* x (+ (/ (+ y 1.0) z) -1.0)) (if (<= z 28000.0) (* (+ (- y z) 1.0) (/ x z)) (- (* x (/ y z)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3e-58) {
tmp = x * (((y + 1.0) / z) + -1.0);
} else if (z <= 28000.0) {
tmp = ((y - z) + 1.0) * (x / z);
} 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 (z <= (-3d-58)) then
tmp = x * (((y + 1.0d0) / z) + (-1.0d0))
else if (z <= 28000.0d0) then
tmp = ((y - z) + 1.0d0) * (x / z)
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 (z <= -3e-58) {
tmp = x * (((y + 1.0) / z) + -1.0);
} else if (z <= 28000.0) {
tmp = ((y - z) + 1.0) * (x / z);
} else {
tmp = (x * (y / z)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3e-58: tmp = x * (((y + 1.0) / z) + -1.0) elif z <= 28000.0: tmp = ((y - z) + 1.0) * (x / z) else: tmp = (x * (y / z)) - x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3e-58) tmp = Float64(x * Float64(Float64(Float64(y + 1.0) / z) + -1.0)); elseif (z <= 28000.0) tmp = Float64(Float64(Float64(y - z) + 1.0) * Float64(x / z)); else tmp = Float64(Float64(x * Float64(y / z)) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3e-58) tmp = x * (((y + 1.0) / z) + -1.0); elseif (z <= 28000.0) tmp = ((y - z) + 1.0) * (x / z); else tmp = (x * (y / z)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3e-58], N[(x * N[(N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 28000.0], N[(N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-58}:\\
\;\;\;\;x \cdot \left(\frac{y + 1}{z} + -1\right)\\
\mathbf{elif}\;z \leq 28000:\\
\;\;\;\;\left(\left(y - z\right) + 1\right) \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\end{array}
\end{array}
if z < -3.00000000000000008e-58Initial program 79.0%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
if -3.00000000000000008e-58 < z < 28000Initial program 99.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
Applied egg-rr99.9%
if 28000 < z Initial program 77.2%
associate-/l*100.0%
+-commutative100.0%
associate-+r-100.0%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
distribute-lft-in100.0%
clear-num99.9%
un-div-inv99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 99.9%
unsub-neg99.9%
div-inv99.9%
clear-num100.0%
Applied egg-rr100.0%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= z -3.4e+97)
(- x)
(if (<= z -9.5e-40)
(* x (/ y z))
(if (<= z -5.9e-204)
(/ x z)
(if (<= z 4.6e-255)
t_0
(if (<= z 3.7e-73) (/ x z) (if (<= z 1.2e+17) t_0 (- x)))))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -3.4e+97) {
tmp = -x;
} else if (z <= -9.5e-40) {
tmp = x * (y / z);
} else if (z <= -5.9e-204) {
tmp = x / z;
} else if (z <= 4.6e-255) {
tmp = t_0;
} else if (z <= 3.7e-73) {
tmp = x / z;
} else if (z <= 1.2e+17) {
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 <= (-3.4d+97)) then
tmp = -x
else if (z <= (-9.5d-40)) then
tmp = x * (y / z)
else if (z <= (-5.9d-204)) then
tmp = x / z
else if (z <= 4.6d-255) then
tmp = t_0
else if (z <= 3.7d-73) then
tmp = x / z
else if (z <= 1.2d+17) 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 <= -3.4e+97) {
tmp = -x;
} else if (z <= -9.5e-40) {
tmp = x * (y / z);
} else if (z <= -5.9e-204) {
tmp = x / z;
} else if (z <= 4.6e-255) {
tmp = t_0;
} else if (z <= 3.7e-73) {
tmp = x / z;
} else if (z <= 1.2e+17) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) tmp = 0 if z <= -3.4e+97: tmp = -x elif z <= -9.5e-40: tmp = x * (y / z) elif z <= -5.9e-204: tmp = x / z elif z <= 4.6e-255: tmp = t_0 elif z <= 3.7e-73: tmp = x / z elif z <= 1.2e+17: 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 <= -3.4e+97) tmp = Float64(-x); elseif (z <= -9.5e-40) tmp = Float64(x * Float64(y / z)); elseif (z <= -5.9e-204) tmp = Float64(x / z); elseif (z <= 4.6e-255) tmp = t_0; elseif (z <= 3.7e-73) tmp = Float64(x / z); elseif (z <= 1.2e+17) 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 <= -3.4e+97) tmp = -x; elseif (z <= -9.5e-40) tmp = x * (y / z); elseif (z <= -5.9e-204) tmp = x / z; elseif (z <= 4.6e-255) tmp = t_0; elseif (z <= 3.7e-73) tmp = x / z; elseif (z <= 1.2e+17) 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, -3.4e+97], (-x), If[LessEqual[z, -9.5e-40], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.9e-204], N[(x / z), $MachinePrecision], If[LessEqual[z, 4.6e-255], t$95$0, If[LessEqual[z, 3.7e-73], N[(x / z), $MachinePrecision], If[LessEqual[z, 1.2e+17], t$95$0, (-x)]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{+97}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-40}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq -5.9 \cdot 10^{-204}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-255}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-73}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+17}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -3.4000000000000001e97 or 1.2e17 < z Initial program 72.4%
associate-/l*100.0%
+-commutative100.0%
associate-+r-100.0%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 81.2%
neg-mul-181.2%
Simplified81.2%
if -3.4000000000000001e97 < z < -9.5000000000000006e-40Initial program 95.9%
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%
Taylor expanded in y around inf 66.6%
associate-/l*66.3%
Simplified66.3%
if -9.5000000000000006e-40 < z < -5.9000000000000003e-204 or 4.5999999999999997e-255 < z < 3.7000000000000001e-73Initial program 100.0%
Taylor expanded in y around 0 72.1%
*-commutative72.1%
sub-neg72.1%
metadata-eval72.1%
distribute-neg-in72.1%
+-commutative72.1%
associate-/l*72.1%
+-commutative72.1%
distribute-neg-in72.1%
metadata-eval72.1%
sub-neg72.1%
Simplified72.1%
Taylor expanded in z around 0 72.1%
if -5.9000000000000003e-204 < z < 4.5999999999999997e-255 or 3.7000000000000001e-73 < z < 1.2e17Initial program 99.9%
associate-/l*85.6%
+-commutative85.6%
associate-+r-85.6%
div-sub85.6%
*-inverses85.6%
sub-neg85.6%
metadata-eval85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in y around inf 70.4%
*-commutative70.4%
associate-*r/74.4%
Simplified74.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ y z))))
(if (<= z -9e+100)
(- x)
(if (<= z -1.35e-39)
t_0
(if (<= z 4.8e-73) (/ x z) (if (<= z 9e+16) t_0 (- x)))))))
double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (z <= -9e+100) {
tmp = -x;
} else if (z <= -1.35e-39) {
tmp = t_0;
} else if (z <= 4.8e-73) {
tmp = x / z;
} else if (z <= 9e+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 = x * (y / z)
if (z <= (-9d+100)) then
tmp = -x
else if (z <= (-1.35d-39)) then
tmp = t_0
else if (z <= 4.8d-73) then
tmp = x / z
else if (z <= 9d+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 = x * (y / z);
double tmp;
if (z <= -9e+100) {
tmp = -x;
} else if (z <= -1.35e-39) {
tmp = t_0;
} else if (z <= 4.8e-73) {
tmp = x / z;
} else if (z <= 9e+16) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y / z) tmp = 0 if z <= -9e+100: tmp = -x elif z <= -1.35e-39: tmp = t_0 elif z <= 4.8e-73: tmp = x / z elif z <= 9e+16: 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 <= -9e+100) tmp = Float64(-x); elseif (z <= -1.35e-39) tmp = t_0; elseif (z <= 4.8e-73) tmp = Float64(x / z); elseif (z <= 9e+16) 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 <= -9e+100) tmp = -x; elseif (z <= -1.35e-39) tmp = t_0; elseif (z <= 4.8e-73) tmp = x / z; elseif (z <= 9e+16) 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, -9e+100], (-x), If[LessEqual[z, -1.35e-39], t$95$0, If[LessEqual[z, 4.8e-73], N[(x / z), $MachinePrecision], If[LessEqual[z, 9e+16], t$95$0, (-x)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -9 \cdot 10^{+100}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-39}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-73}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+16}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -9.00000000000000073e100 or 9e16 < z Initial program 72.4%
associate-/l*100.0%
+-commutative100.0%
associate-+r-100.0%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 81.2%
neg-mul-181.2%
Simplified81.2%
if -9.00000000000000073e100 < z < -1.35e-39 or 4.80000000000000011e-73 < z < 9e16Initial program 97.4%
associate-/l*97.2%
+-commutative97.2%
associate-+r-97.2%
div-sub97.3%
*-inverses97.3%
sub-neg97.3%
metadata-eval97.3%
+-commutative97.3%
Simplified97.3%
Taylor expanded in y around inf 69.7%
associate-/l*67.2%
Simplified67.2%
if -1.35e-39 < z < 4.80000000000000011e-73Initial program 100.0%
Taylor expanded in y around 0 64.9%
*-commutative64.9%
sub-neg64.9%
metadata-eval64.9%
distribute-neg-in64.9%
+-commutative64.9%
associate-/l*64.9%
+-commutative64.9%
distribute-neg-in64.9%
metadata-eval64.9%
sub-neg64.9%
Simplified64.9%
Taylor expanded in z around 0 64.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -9.2e-7) (not (<= z 7e-17))) (* x (+ (/ (+ y 1.0) z) -1.0)) (/ (* x (+ y 1.0)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -9.2e-7) || !(z <= 7e-17)) {
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 <= (-9.2d-7)) .or. (.not. (z <= 7d-17))) 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 <= -9.2e-7) || !(z <= 7e-17)) {
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 <= -9.2e-7) or not (z <= 7e-17): 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 <= -9.2e-7) || !(z <= 7e-17)) 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 <= -9.2e-7) || ~((z <= 7e-17))) 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, -9.2e-7], N[Not[LessEqual[z, 7e-17]], $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 -9.2 \cdot 10^{-7} \lor \neg \left(z \leq 7 \cdot 10^{-17}\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 < -9.1999999999999998e-7 or 7.0000000000000003e-17 < z Initial program 77.0%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
if -9.1999999999999998e-7 < z < 7.0000000000000003e-17Initial program 100.0%
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 100.0%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.0) (not (<= y 2.75e-11))) (- (* x (/ y z)) x) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.0) || !(y <= 2.75e-11)) {
tmp = (x * (y / z)) - x;
} else {
tmp = (x / z) - x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-1.0d0)) .or. (.not. (y <= 2.75d-11))) then
tmp = (x * (y / z)) - x
else
tmp = (x / z) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.0) || !(y <= 2.75e-11)) {
tmp = (x * (y / z)) - x;
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.0) or not (y <= 2.75e-11): tmp = (x * (y / z)) - x else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.0) || !(y <= 2.75e-11)) tmp = Float64(Float64(x * Float64(y / z)) - x); else tmp = Float64(Float64(x / z) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.0) || ~((y <= 2.75e-11))) tmp = (x * (y / z)) - x; else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 2.75e-11]], $MachinePrecision]], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 2.75 \cdot 10^{-11}\right):\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -1 or 2.74999999999999987e-11 < y Initial program 88.1%
associate-/l*91.7%
+-commutative91.7%
associate-+r-91.7%
div-sub91.7%
*-inverses91.7%
sub-neg91.7%
metadata-eval91.7%
+-commutative91.7%
Simplified91.7%
distribute-lft-in91.8%
clear-num91.7%
un-div-inv92.0%
*-commutative92.0%
mul-1-neg92.0%
Applied egg-rr92.0%
Taylor expanded in y around inf 92.0%
unsub-neg92.0%
div-inv91.7%
clear-num91.8%
Applied egg-rr91.8%
if -1 < y < 2.74999999999999987e-11Initial program 88.3%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
distribute-lft-in99.9%
clear-num99.9%
un-div-inv100.0%
*-commutative100.0%
mul-1-neg100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 99.9%
Final simplification95.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.0) (not (<= y 2.75e-11))) (* x (+ -1.0 (/ y z))) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.0) || !(y <= 2.75e-11)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (x / z) - x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-1.0d0)) .or. (.not. (y <= 2.75d-11))) then
tmp = x * ((-1.0d0) + (y / z))
else
tmp = (x / z) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.0) || !(y <= 2.75e-11)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.0) or not (y <= 2.75e-11): tmp = x * (-1.0 + (y / z)) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.0) || !(y <= 2.75e-11)) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); else tmp = Float64(Float64(x / z) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.0) || ~((y <= 2.75e-11))) tmp = x * (-1.0 + (y / z)); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 2.75e-11]], $MachinePrecision]], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 2.75 \cdot 10^{-11}\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -1 or 2.74999999999999987e-11 < y Initial program 88.1%
associate-/l*91.7%
+-commutative91.7%
associate-+r-91.7%
div-sub91.7%
*-inverses91.7%
sub-neg91.7%
metadata-eval91.7%
+-commutative91.7%
Simplified91.7%
Taylor expanded in y around inf 91.7%
if -1 < y < 2.74999999999999987e-11Initial program 88.3%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
distribute-lft-in99.9%
clear-num99.9%
un-div-inv100.0%
*-commutative100.0%
mul-1-neg100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 99.9%
Final simplification95.9%
(FPCore (x y z) :precision binary64 (if (<= z -1.0) (- (/ x (/ z y)) x) (if (<= z 1.0) (/ (* x (+ y 1.0)) z) (- (* x (/ y z)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x / (z / y)) - x;
} else if (z <= 1.0) {
tmp = (x * (y + 1.0)) / z;
} 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 (z <= (-1.0d0)) then
tmp = (x / (z / y)) - x
else if (z <= 1.0d0) then
tmp = (x * (y + 1.0d0)) / z
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 (z <= -1.0) {
tmp = (x / (z / y)) - x;
} else if (z <= 1.0) {
tmp = (x * (y + 1.0)) / z;
} else {
tmp = (x * (y / z)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (x / (z / y)) - x elif z <= 1.0: tmp = (x * (y + 1.0)) / z else: tmp = (x * (y / z)) - x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x / Float64(z / y)) - x); elseif (z <= 1.0) tmp = Float64(Float64(x * Float64(y + 1.0)) / z); else tmp = Float64(Float64(x * Float64(y / z)) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.0) tmp = (x / (z / y)) - x; elseif (z <= 1.0) tmp = (x * (y + 1.0)) / z; else tmp = (x * (y / z)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{x}{\frac{z}{y}} - x\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{x \cdot \left(y + 1\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\end{array}
\end{array}
if z < -1Initial program 75.2%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
distribute-lft-in99.9%
clear-num99.9%
un-div-inv99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 97.5%
if -1 < z < 1Initial program 100.0%
associate-/l*91.8%
+-commutative91.8%
associate-+r-91.8%
div-sub91.8%
*-inverses91.8%
sub-neg91.8%
metadata-eval91.8%
+-commutative91.8%
Simplified91.8%
Taylor expanded in z around 0 99.5%
if 1 < z Initial program 77.5%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
distribute-lft-in100.0%
clear-num99.9%
un-div-inv99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 99.0%
unsub-neg99.0%
div-inv99.0%
clear-num99.1%
Applied egg-rr99.1%
Final simplification98.9%
(FPCore (x y z) :precision binary64 (if (<= z -0.95) (* x (+ -1.0 (/ y z))) (if (<= z 1.0) (/ (* x (+ y 1.0)) z) (- (* x (/ y z)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.95) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 1.0) {
tmp = (x * (y + 1.0)) / z;
} 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 (z <= (-0.95d0)) then
tmp = x * ((-1.0d0) + (y / z))
else if (z <= 1.0d0) then
tmp = (x * (y + 1.0d0)) / z
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 (z <= -0.95) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 1.0) {
tmp = (x * (y + 1.0)) / z;
} else {
tmp = (x * (y / z)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.95: tmp = x * (-1.0 + (y / z)) elif z <= 1.0: tmp = (x * (y + 1.0)) / z else: tmp = (x * (y / z)) - x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.95) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); elseif (z <= 1.0) tmp = Float64(Float64(x * Float64(y + 1.0)) / z); else tmp = Float64(Float64(x * Float64(y / z)) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.95) tmp = x * (-1.0 + (y / z)); elseif (z <= 1.0) tmp = (x * (y + 1.0)) / z; else tmp = (x * (y / z)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.95], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.95:\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{x \cdot \left(y + 1\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\end{array}
\end{array}
if z < -0.94999999999999996Initial program 75.2%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 97.4%
if -0.94999999999999996 < z < 1Initial program 100.0%
associate-/l*91.8%
+-commutative91.8%
associate-+r-91.8%
div-sub91.8%
*-inverses91.8%
sub-neg91.8%
metadata-eval91.8%
+-commutative91.8%
Simplified91.8%
Taylor expanded in z around 0 99.5%
if 1 < z Initial program 77.5%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
distribute-lft-in100.0%
clear-num99.9%
un-div-inv99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 99.0%
unsub-neg99.0%
div-inv99.0%
clear-num99.1%
Applied egg-rr99.1%
Final simplification98.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.6e+97) (not (<= y 3.4e+214))) (/ (* x y) z) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.6e+97) || !(y <= 3.4e+214)) {
tmp = (x * y) / z;
} else {
tmp = (x / z) - x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-1.6d+97)) .or. (.not. (y <= 3.4d+214))) then
tmp = (x * y) / z
else
tmp = (x / z) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.6e+97) || !(y <= 3.4e+214)) {
tmp = (x * y) / z;
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.6e+97) or not (y <= 3.4e+214): tmp = (x * y) / z else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.6e+97) || !(y <= 3.4e+214)) tmp = Float64(Float64(x * y) / z); else tmp = Float64(Float64(x / z) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.6e+97) || ~((y <= 3.4e+214))) tmp = (x * y) / z; else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.6e+97], N[Not[LessEqual[y, 3.4e+214]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+97} \lor \neg \left(y \leq 3.4 \cdot 10^{+214}\right):\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -1.60000000000000008e97 or 3.3999999999999998e214 < y Initial program 91.5%
associate-/l*86.6%
+-commutative86.6%
associate-+r-86.6%
div-sub86.6%
*-inverses86.6%
sub-neg86.6%
metadata-eval86.6%
+-commutative86.6%
Simplified86.6%
Taylor expanded in y around inf 84.2%
if -1.60000000000000008e97 < y < 3.3999999999999998e214Initial program 86.7%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
distribute-lft-in99.9%
clear-num99.9%
un-div-inv100.0%
*-commutative100.0%
mul-1-neg100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 90.1%
Final simplification88.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.3e+97) (not (<= y 3.4e+214))) (* y (/ x z)) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.3e+97) || !(y <= 3.4e+214)) {
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 <= (-3.3d+97)) .or. (.not. (y <= 3.4d+214))) 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 <= -3.3e+97) || !(y <= 3.4e+214)) {
tmp = y * (x / z);
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.3e+97) or not (y <= 3.4e+214): tmp = y * (x / z) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.3e+97) || !(y <= 3.4e+214)) 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 <= -3.3e+97) || ~((y <= 3.4e+214))) tmp = y * (x / z); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.3e+97], N[Not[LessEqual[y, 3.4e+214]], $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 -3.3 \cdot 10^{+97} \lor \neg \left(y \leq 3.4 \cdot 10^{+214}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -3.3000000000000001e97 or 3.3999999999999998e214 < y Initial program 91.5%
associate-/l*86.6%
+-commutative86.6%
associate-+r-86.6%
div-sub86.6%
*-inverses86.6%
sub-neg86.6%
metadata-eval86.6%
+-commutative86.6%
Simplified86.6%
Taylor expanded in y around inf 84.2%
*-commutative84.2%
associate-*r/82.1%
Simplified82.1%
if -3.3000000000000001e97 < y < 3.3999999999999998e214Initial program 86.7%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
distribute-lft-in99.9%
clear-num99.9%
un-div-inv100.0%
*-commutative100.0%
mul-1-neg100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 90.1%
Final simplification87.6%
(FPCore (x y z) :precision binary64 (if (<= x 1e-86) (/ (* x (+ (- y z) 1.0)) z) (- (/ x (/ z (+ y 1.0))) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 1e-86) {
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 <= 1d-86) 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 <= 1e-86) {
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 <= 1e-86: 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 <= 1e-86) 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 <= 1e-86) 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, 1e-86], 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 10^{-86}:\\
\;\;\;\;\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.00000000000000008e-86Initial program 94.4%
if 1.00000000000000008e-86 < x Initial program 75.9%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
distribute-lft-in99.9%
clear-num99.9%
un-div-inv100.0%
*-commutative100.0%
mul-1-neg100.0%
Applied egg-rr100.0%
Final simplification96.3%
(FPCore (x y z) :precision binary64 (if (<= x 0.2) (/ (* x (+ (- y z) 1.0)) z) (* x (+ (/ (+ y 1.0) z) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.2) {
tmp = (x * ((y - z) + 1.0)) / z;
} else {
tmp = x * (((y + 1.0) / z) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 0.2d0) then
tmp = (x * ((y - z) + 1.0d0)) / z
else
tmp = x * (((y + 1.0d0) / z) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 0.2) {
tmp = (x * ((y - z) + 1.0)) / z;
} else {
tmp = x * (((y + 1.0) / z) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 0.2: tmp = (x * ((y - z) + 1.0)) / z else: tmp = x * (((y + 1.0) / z) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 0.2) tmp = Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z); else tmp = Float64(x * Float64(Float64(Float64(y + 1.0) / z) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 0.2) tmp = (x * ((y - z) + 1.0)) / z; else tmp = x * (((y + 1.0) / z) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 0.2], N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x * N[(N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.2:\\
\;\;\;\;\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y + 1}{z} + -1\right)\\
\end{array}
\end{array}
if x < 0.20000000000000001Initial program 94.8%
if 0.20000000000000001 < x Initial program 71.6%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -9e-7) (not (<= z 1.0))) (- x) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -9e-7) || !(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 <= (-9d-7)) .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 <= -9e-7) || !(z <= 1.0)) {
tmp = -x;
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -9e-7) or not (z <= 1.0): tmp = -x else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -9e-7) || !(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 <= -9e-7) || ~((z <= 1.0))) tmp = -x; else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -9e-7], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], (-x), N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-7} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if z < -8.99999999999999959e-7 or 1 < z Initial program 76.6%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 72.6%
neg-mul-172.6%
Simplified72.6%
if -8.99999999999999959e-7 < z < 1Initial program 100.0%
Taylor expanded in y around 0 61.4%
*-commutative61.4%
sub-neg61.4%
metadata-eval61.4%
distribute-neg-in61.4%
+-commutative61.4%
associate-/l*61.4%
+-commutative61.4%
distribute-neg-in61.4%
metadata-eval61.4%
sub-neg61.4%
Simplified61.4%
Taylor expanded in z around 0 60.9%
Final simplification66.8%
(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.2%
associate-/l*95.8%
+-commutative95.8%
associate-+r-95.8%
div-sub95.8%
*-inverses95.8%
sub-neg95.8%
metadata-eval95.8%
+-commutative95.8%
Simplified95.8%
Taylor expanded in z around inf 38.2%
neg-mul-138.2%
Simplified38.2%
(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.2%
associate-/l*95.8%
+-commutative95.8%
associate-+r-95.8%
div-sub95.8%
*-inverses95.8%
sub-neg95.8%
metadata-eval95.8%
+-commutative95.8%
Simplified95.8%
Taylor expanded in z around inf 38.2%
neg-mul-138.2%
Simplified38.2%
neg-sub038.2%
sub-neg38.2%
add-sqr-sqrt16.0%
sqrt-unprod20.6%
sqr-neg20.6%
sqrt-unprod1.6%
add-sqr-sqrt2.8%
Applied egg-rr2.8%
+-lft-identity2.8%
Simplified2.8%
(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 2024146
(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))