
(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 -1e-62) (* x (+ (/ (+ y 1.0) z) -1.0)) (if (<= z 4e+23) (* (+ (- y z) 1.0) (/ x z)) (- (* x (/ y z)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1e-62) {
tmp = x * (((y + 1.0) / z) + -1.0);
} else if (z <= 4e+23) {
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 <= (-1d-62)) then
tmp = x * (((y + 1.0d0) / z) + (-1.0d0))
else if (z <= 4d+23) 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 <= -1e-62) {
tmp = x * (((y + 1.0) / z) + -1.0);
} else if (z <= 4e+23) {
tmp = ((y - z) + 1.0) * (x / z);
} else {
tmp = (x * (y / z)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1e-62: tmp = x * (((y + 1.0) / z) + -1.0) elif z <= 4e+23: 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 <= -1e-62) tmp = Float64(x * Float64(Float64(Float64(y + 1.0) / z) + -1.0)); elseif (z <= 4e+23) 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 <= -1e-62) tmp = x * (((y + 1.0) / z) + -1.0); elseif (z <= 4e+23) 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, -1e-62], N[(x * N[(N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e+23], 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 -1 \cdot 10^{-62}:\\
\;\;\;\;x \cdot \left(\frac{y + 1}{z} + -1\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+23}:\\
\;\;\;\;\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 < -1e-62Initial 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%
if -1e-62 < z < 3.9999999999999997e23Initial program 99.8%
*-commutative99.8%
associate-/l*99.8%
+-commutative99.8%
Applied egg-rr99.8%
if 3.9999999999999997e23 < z Initial program 70.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-inv99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 89.4%
associate-/l*99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= x 5.5e-173) (/ (fma x (- y z) x) z) (- (/ x (/ z (+ y 1.0))) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 5.5e-173) {
tmp = fma(x, (y - z), x) / z;
} else {
tmp = (x / (z / (y + 1.0))) - x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 5.5e-173) tmp = Float64(fma(x, Float64(y - z), x) / z); else tmp = Float64(Float64(x / Float64(z / Float64(y + 1.0))) - x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 5.5e-173], N[(N[(x * N[(y - z), $MachinePrecision] + x), $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 5.5 \cdot 10^{-173}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y - z, x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + 1}} - x\\
\end{array}
\end{array}
if x < 5.50000000000000022e-173Initial program 89.3%
distribute-lft-in89.3%
fma-define89.3%
*-rgt-identity89.3%
Simplified89.3%
if 5.50000000000000022e-173 < x Initial program 82.2%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
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 (* x (/ y z))))
(if (<= z -1.12e+21)
(- x)
(if (<= z -2.1e-39)
t_0
(if (<= z 1.65e-193)
(/ x z)
(if (<= z 2.15e-159) 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 <= -1.12e+21) {
tmp = -x;
} else if (z <= -2.1e-39) {
tmp = t_0;
} else if (z <= 1.65e-193) {
tmp = x / z;
} else if (z <= 2.15e-159) {
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 <= (-1.12d+21)) then
tmp = -x
else if (z <= (-2.1d-39)) then
tmp = t_0
else if (z <= 1.65d-193) then
tmp = x / z
else if (z <= 2.15d-159) 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 <= -1.12e+21) {
tmp = -x;
} else if (z <= -2.1e-39) {
tmp = t_0;
} else if (z <= 1.65e-193) {
tmp = x / z;
} else if (z <= 2.15e-159) {
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 <= -1.12e+21: tmp = -x elif z <= -2.1e-39: tmp = t_0 elif z <= 1.65e-193: tmp = x / z elif z <= 2.15e-159: 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 <= -1.12e+21) tmp = Float64(-x); elseif (z <= -2.1e-39) tmp = t_0; elseif (z <= 1.65e-193) tmp = Float64(x / z); elseif (z <= 2.15e-159) 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 <= -1.12e+21) tmp = -x; elseif (z <= -2.1e-39) tmp = t_0; elseif (z <= 1.65e-193) tmp = x / z; elseif (z <= 2.15e-159) 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, -1.12e+21], (-x), If[LessEqual[z, -2.1e-39], t$95$0, If[LessEqual[z, 1.65e-193], N[(x / z), $MachinePrecision], If[LessEqual[z, 2.15e-159], 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 -1.12 \cdot 10^{+21}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-39}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-193}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-159}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -1.12e21 or 1 < z Initial program 72.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 75.5%
neg-mul-175.5%
Simplified75.5%
if -1.12e21 < z < -2.09999999999999993e-39 or 1.6499999999999999e-193 < z < 2.15e-159Initial program 99.8%
associate-/l*94.9%
+-commutative94.9%
associate-+r-94.9%
div-sub95.0%
*-inverses95.0%
sub-neg95.0%
metadata-eval95.0%
+-commutative95.0%
Simplified95.0%
Taylor expanded in y around inf 76.0%
associate-/l*71.3%
Simplified71.3%
if -2.09999999999999993e-39 < z < 1.6499999999999999e-193 or 2.15e-159 < z < 1Initial program 99.8%
associate-/l*89.7%
+-commutative89.7%
associate-+r-89.7%
div-sub89.7%
*-inverses89.7%
sub-neg89.7%
metadata-eval89.7%
+-commutative89.7%
Simplified89.7%
Taylor expanded in z around 0 99.7%
associate-/l*89.5%
Simplified89.5%
clear-num89.5%
+-commutative89.5%
div-inv89.6%
Applied egg-rr89.6%
Taylor expanded in y around 0 61.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= z -3.3e+17)
(- x)
(if (<= z -1.14e-82)
t_0
(if (<= z 1.16e-304) (/ x z) (if (<= z 8.2e+36) t_0 (- x)))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -3.3e+17) {
tmp = -x;
} else if (z <= -1.14e-82) {
tmp = t_0;
} else if (z <= 1.16e-304) {
tmp = x / z;
} else if (z <= 8.2e+36) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = y * (x / z)
if (z <= (-3.3d+17)) then
tmp = -x
else if (z <= (-1.14d-82)) then
tmp = t_0
else if (z <= 1.16d-304) then
tmp = x / z
else if (z <= 8.2d+36) then
tmp = t_0
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -3.3e+17) {
tmp = -x;
} else if (z <= -1.14e-82) {
tmp = t_0;
} else if (z <= 1.16e-304) {
tmp = x / z;
} else if (z <= 8.2e+36) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) tmp = 0 if z <= -3.3e+17: tmp = -x elif z <= -1.14e-82: tmp = t_0 elif z <= 1.16e-304: tmp = x / z elif z <= 8.2e+36: 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.3e+17) tmp = Float64(-x); elseif (z <= -1.14e-82) tmp = t_0; elseif (z <= 1.16e-304) tmp = Float64(x / z); elseif (z <= 8.2e+36) 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.3e+17) tmp = -x; elseif (z <= -1.14e-82) tmp = t_0; elseif (z <= 1.16e-304) tmp = x / z; elseif (z <= 8.2e+36) 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.3e+17], (-x), If[LessEqual[z, -1.14e-82], t$95$0, If[LessEqual[z, 1.16e-304], N[(x / z), $MachinePrecision], If[LessEqual[z, 8.2e+36], t$95$0, (-x)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{+17}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -1.14 \cdot 10^{-82}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-304}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+36}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -3.3e17 or 8.20000000000000026e36 < z Initial program 72.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%
Taylor expanded in z around inf 77.5%
neg-mul-177.5%
Simplified77.5%
if -3.3e17 < z < -1.14e-82 or 1.15999999999999995e-304 < z < 8.20000000000000026e36Initial program 98.8%
associate-/l*87.9%
+-commutative87.9%
associate-+r-87.9%
div-sub87.9%
*-inverses87.9%
sub-neg87.9%
metadata-eval87.9%
+-commutative87.9%
Simplified87.9%
Taylor expanded in y around inf 58.3%
*-commutative58.3%
associate-/l*65.8%
Applied egg-rr65.8%
if -1.14e-82 < z < 1.15999999999999995e-304Initial program 99.8%
associate-/l*96.0%
+-commutative96.0%
associate-+r-96.0%
div-sub96.0%
*-inverses96.0%
sub-neg96.0%
metadata-eval96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in z around 0 99.8%
associate-/l*96.0%
Simplified96.0%
clear-num96.0%
+-commutative96.0%
div-inv96.1%
Applied egg-rr96.1%
Taylor expanded in y around 0 70.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.55e-62) (not (<= z 9.2e-17))) (* x (+ (/ (+ y 1.0) z) -1.0)) (/ (+ x (* x y)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.55e-62) || !(z <= 9.2e-17)) {
tmp = x * (((y + 1.0) / z) + -1.0);
} else {
tmp = (x + (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 ((z <= (-1.55d-62)) .or. (.not. (z <= 9.2d-17))) then
tmp = x * (((y + 1.0d0) / z) + (-1.0d0))
else
tmp = (x + (x * y)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.55e-62) || !(z <= 9.2e-17)) {
tmp = x * (((y + 1.0) / z) + -1.0);
} else {
tmp = (x + (x * y)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.55e-62) or not (z <= 9.2e-17): tmp = x * (((y + 1.0) / z) + -1.0) else: tmp = (x + (x * y)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.55e-62) || !(z <= 9.2e-17)) tmp = Float64(x * Float64(Float64(Float64(y + 1.0) / z) + -1.0)); else tmp = Float64(Float64(x + Float64(x * y)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.55e-62) || ~((z <= 9.2e-17))) tmp = x * (((y + 1.0) / z) + -1.0); else tmp = (x + (x * y)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.55e-62], N[Not[LessEqual[z, 9.2e-17]], $MachinePrecision]], N[(x * N[(N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-62} \lor \neg \left(z \leq 9.2 \cdot 10^{-17}\right):\\
\;\;\;\;x \cdot \left(\frac{y + 1}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + x \cdot y}{z}\\
\end{array}
\end{array}
if z < -1.55e-62 or 9.20000000000000035e-17 < z 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%
if -1.55e-62 < z < 9.20000000000000035e-17Initial program 99.8%
distribute-lft-in99.9%
fma-define99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in z around 0 99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 2.3))) (- (* x (/ y z)) x) (/ (+ x (* x y)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 2.3)) {
tmp = (x * (y / z)) - x;
} else {
tmp = (x + (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 ((z <= (-1.0d0)) .or. (.not. (z <= 2.3d0))) then
tmp = (x * (y / z)) - x
else
tmp = (x + (x * y)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 2.3)) {
tmp = (x * (y / z)) - x;
} else {
tmp = (x + (x * y)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 2.3): tmp = (x * (y / z)) - x else: tmp = (x + (x * y)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 2.3)) tmp = Float64(Float64(x * Float64(y / z)) - x); else tmp = Float64(Float64(x + Float64(x * y)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 2.3))) tmp = (x * (y / z)) - x; else tmp = (x + (x * y)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 2.3]], $MachinePrecision]], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 2.3\right):\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x + x \cdot y}{z}\\
\end{array}
\end{array}
if z < -1Initial program 72.8%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
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 88.5%
associate-/l*100.0%
Simplified100.0%
unsub-neg100.0%
Applied egg-rr100.0%
if -1 < z < 2.2999999999999998Initial program 99.8%
distribute-lft-in99.8%
fma-define99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in z around 0 98.8%
if 2.2999999999999998 < z Initial program 72.4%
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 90.0%
associate-/l*99.9%
Simplified99.9%
Final simplification99.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 2.3))) (- (* x (/ y z)) x) (* x (/ (+ y 1.0) z))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 2.3)) {
tmp = (x * (y / z)) - x;
} else {
tmp = x * ((y + 1.0) / z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 2.3d0))) then
tmp = (x * (y / z)) - x
else
tmp = x * ((y + 1.0d0) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 2.3)) {
tmp = (x * (y / z)) - x;
} else {
tmp = x * ((y + 1.0) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 2.3): tmp = (x * (y / z)) - x else: tmp = x * ((y + 1.0) / z) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 2.3)) tmp = Float64(Float64(x * Float64(y / z)) - x); else tmp = Float64(x * Float64(Float64(y + 1.0) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 2.3))) tmp = (x * (y / z)) - x; else tmp = x * ((y + 1.0) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 2.3]], $MachinePrecision]], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(x * N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 2.3\right):\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y + 1}{z}\\
\end{array}
\end{array}
if z < -1 or 2.2999999999999998 < z Initial program 72.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%
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 89.2%
associate-/l*99.9%
Simplified99.9%
unsub-neg99.9%
Applied egg-rr99.9%
if -1 < z < 2.2999999999999998Initial program 99.8%
associate-/l*90.5%
+-commutative90.5%
associate-+r-90.5%
div-sub90.5%
*-inverses90.5%
sub-neg90.5%
metadata-eval90.5%
+-commutative90.5%
Simplified90.5%
Taylor expanded in z around 0 98.7%
associate-/l*89.4%
Simplified89.4%
Final simplification94.5%
(FPCore (x y z) :precision binary64 (if (<= y -1.0) (- (/ (* x y) z) x) (if (<= y 102000.0) (- (/ x z) x) (- (* x (/ y z)) x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.0) {
tmp = ((x * y) / z) - x;
} else if (y <= 102000.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 <= (-1.0d0)) then
tmp = ((x * y) / z) - x
else if (y <= 102000.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 <= -1.0) {
tmp = ((x * y) / z) - x;
} else if (y <= 102000.0) {
tmp = (x / z) - x;
} else {
tmp = (x * (y / z)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.0: tmp = ((x * y) / z) - x elif y <= 102000.0: tmp = (x / z) - x else: tmp = (x * (y / z)) - x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.0) tmp = Float64(Float64(Float64(x * y) / z) - x); elseif (y <= 102000.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 <= -1.0) tmp = ((x * y) / z) - x; elseif (y <= 102000.0) tmp = (x / z) - x; else tmp = (x * (y / z)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.0], N[(N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[y, 102000.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 -1:\\
\;\;\;\;\frac{x \cdot y}{z} - x\\
\mathbf{elif}\;y \leq 102000:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\end{array}
\end{array}
if y < -1Initial program 94.3%
associate-/l*87.5%
+-commutative87.5%
associate-+r-87.5%
div-sub87.5%
*-inverses87.5%
sub-neg87.5%
metadata-eval87.5%
+-commutative87.5%
Simplified87.5%
distribute-lft-in87.6%
clear-num87.5%
un-div-inv87.5%
*-commutative87.5%
mul-1-neg87.5%
Applied egg-rr87.5%
Taylor expanded in y around inf 93.1%
associate-/l*86.4%
Simplified86.4%
Taylor expanded in y around 0 93.1%
if -1 < y < 102000Initial program 87.1%
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 0 98.8%
sub-neg98.8%
metadata-eval98.8%
distribute-rgt-in98.8%
associate-*l/98.9%
*-lft-identity98.9%
neg-mul-198.9%
unsub-neg98.9%
Simplified98.9%
if 102000 < y Initial program 75.4%
associate-/l*93.0%
+-commutative93.0%
associate-+r-93.0%
div-sub93.0%
*-inverses93.0%
sub-neg93.0%
metadata-eval93.0%
+-commutative93.0%
Simplified93.0%
distribute-lft-in93.0%
clear-num93.0%
un-div-inv93.0%
*-commutative93.0%
mul-1-neg93.0%
Applied egg-rr93.0%
Taylor expanded in y around inf 81.3%
associate-/l*92.0%
Simplified92.0%
unsub-neg92.0%
Applied egg-rr92.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -5.5) (not (<= y 7.2e+71))) (* y (/ x z)) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -5.5) || !(y <= 7.2e+71)) {
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 <= (-5.5d0)) .or. (.not. (y <= 7.2d+71))) 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 <= -5.5) || !(y <= 7.2e+71)) {
tmp = y * (x / z);
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -5.5) or not (y <= 7.2e+71): tmp = y * (x / z) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -5.5) || !(y <= 7.2e+71)) 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 <= -5.5) || ~((y <= 7.2e+71))) tmp = y * (x / z); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -5.5], N[Not[LessEqual[y, 7.2e+71]], $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 -5.5 \lor \neg \left(y \leq 7.2 \cdot 10^{+71}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -5.5 or 7.1999999999999999e71 < y Initial program 87.0%
associate-/l*89.4%
+-commutative89.4%
associate-+r-89.4%
div-sub89.4%
*-inverses89.4%
sub-neg89.4%
metadata-eval89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in y around inf 70.0%
*-commutative70.0%
associate-/l*70.6%
Applied egg-rr70.6%
if -5.5 < y < 7.1999999999999999e71Initial program 86.4%
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 0 97.5%
sub-neg97.5%
metadata-eval97.5%
distribute-rgt-in97.5%
associate-*l/97.6%
*-lft-identity97.6%
neg-mul-197.6%
unsub-neg97.6%
Simplified97.6%
Final simplification85.2%
(FPCore (x y z) :precision binary64 (if (<= y -5.8) (/ (* x y) z) (if (<= y 8.6e+71) (- (/ x z) x) (* y (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -5.8) {
tmp = (x * y) / z;
} else if (y <= 8.6e+71) {
tmp = (x / z) - x;
} else {
tmp = y * (x / z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-5.8d0)) then
tmp = (x * y) / z
else if (y <= 8.6d+71) then
tmp = (x / z) - x
else
tmp = y * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -5.8) {
tmp = (x * y) / z;
} else if (y <= 8.6e+71) {
tmp = (x / z) - x;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5.8: tmp = (x * y) / z elif y <= 8.6e+71: tmp = (x / z) - x else: tmp = y * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5.8) tmp = Float64(Float64(x * y) / z); elseif (y <= 8.6e+71) tmp = Float64(Float64(x / z) - x); else tmp = Float64(y * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -5.8) tmp = (x * y) / z; elseif (y <= 8.6e+71) tmp = (x / z) - x; else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5.8], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 8.6e+71], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{+71}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if y < -5.79999999999999982Initial program 94.3%
associate-/l*87.5%
+-commutative87.5%
associate-+r-87.5%
div-sub87.5%
*-inverses87.5%
sub-neg87.5%
metadata-eval87.5%
+-commutative87.5%
Simplified87.5%
Taylor expanded in y around inf 71.9%
if -5.79999999999999982 < y < 8.59999999999999967e71Initial program 86.4%
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 0 97.5%
sub-neg97.5%
metadata-eval97.5%
distribute-rgt-in97.5%
associate-*l/97.6%
*-lft-identity97.6%
neg-mul-197.6%
unsub-neg97.6%
Simplified97.6%
if 8.59999999999999967e71 < y Initial program 76.2%
associate-/l*92.1%
+-commutative92.1%
associate-+r-92.1%
div-sub92.2%
*-inverses92.2%
sub-neg92.2%
metadata-eval92.2%
+-commutative92.2%
Simplified92.2%
Taylor expanded in y around inf 67.1%
*-commutative67.1%
associate-/l*73.0%
Applied egg-rr73.0%
(FPCore (x y z) :precision binary64 (if (<= x 2e-173) (/ (* 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-173) {
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-173) 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-173) {
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-173: 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-173) 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-173) 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-173], 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^{-173}:\\
\;\;\;\;\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 < 2.0000000000000001e-173Initial program 89.3%
if 2.0000000000000001e-173 < x Initial program 82.2%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
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 (if (<= x 5e-175) (/ (* 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 <= 5e-175) {
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 <= 5d-175) 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 <= 5e-175) {
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 <= 5e-175: 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 <= 5e-175) 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 <= 5e-175) 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, 5e-175], 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 5 \cdot 10^{-175}:\\
\;\;\;\;\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 < 5e-175Initial program 89.3%
if 5e-175 < x Initial program 82.2%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.3e+17) (not (<= z 1.0))) (- x) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.3e+17) || !(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.3d+17)) .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.3e+17) || !(z <= 1.0)) {
tmp = -x;
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.3e+17) or not (z <= 1.0): tmp = -x else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.3e+17) || !(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.3e+17) || ~((z <= 1.0))) tmp = -x; else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.3e+17], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], (-x), N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+17} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if z < -2.3e17 or 1 < z Initial program 72.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 75.5%
neg-mul-175.5%
Simplified75.5%
if -2.3e17 < z < 1Initial program 99.8%
associate-/l*90.5%
+-commutative90.5%
associate-+r-90.5%
div-sub90.5%
*-inverses90.5%
sub-neg90.5%
metadata-eval90.5%
+-commutative90.5%
Simplified90.5%
Taylor expanded in z around 0 98.7%
associate-/l*89.4%
Simplified89.4%
clear-num89.4%
+-commutative89.4%
div-inv89.5%
Applied egg-rr89.5%
Taylor expanded in y around 0 56.4%
Final simplification65.6%
(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 86.6%
associate-/l*95.0%
+-commutative95.0%
associate-+r-95.0%
div-sub95.1%
*-inverses95.1%
sub-neg95.1%
metadata-eval95.1%
+-commutative95.1%
Simplified95.1%
Taylor expanded in z around inf 38.4%
neg-mul-138.4%
Simplified38.4%
(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 2024103
(FPCore (x y z)
:name "Diagrams.TwoD.Segment.Bernstein:evaluateBernstein from diagrams-lib-1.3.0.3"
:precision binary64
:alt
(if (< x -2.71483106713436e-162) (- (* (+ 1.0 y) (/ x z)) x) (if (< x 3.874108816439546e-197) (* (* x (+ (- y z) 1.0)) (/ 1.0 z)) (- (* (+ 1.0 y) (/ x z)) x)))
(/ (* x (+ (- y z) 1.0)) z))