
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (- (/ (+ x 4.0) y) (* z (/ x y))))))
(if (or (<= t_0 4e-76) (not (<= t_0 5e+283)))
(fabs (* (/ -1.0 y) (fma x z (- -4.0 x))))
t_0)))
double code(double x, double y, double z) {
double t_0 = fabs((((x + 4.0) / y) - (z * (x / y))));
double tmp;
if ((t_0 <= 4e-76) || !(t_0 <= 5e+283)) {
tmp = fabs(((-1.0 / y) * fma(x, z, (-4.0 - x))));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(z * Float64(x / y)))) tmp = 0.0 if ((t_0 <= 4e-76) || !(t_0 <= 5e+283)) tmp = abs(Float64(Float64(-1.0 / y) * fma(x, z, Float64(-4.0 - x)))); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[t$95$0, 4e-76], N[Not[LessEqual[t$95$0, 5e+283]], $MachinePrecision]], N[Abs[N[(N[(-1.0 / y), $MachinePrecision] * N[(x * z + N[(-4.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\frac{x + 4}{y} - z \cdot \frac{x}{y}\right|\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-76} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+283}\right):\\
\;\;\;\;\left|\frac{-1}{y} \cdot \mathsf{fma}\left(x, z, -4 - x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < 3.99999999999999971e-76 or 5.0000000000000004e283 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) Initial program 76.7%
Simplified99.9%
if 3.99999999999999971e-76 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < 5.0000000000000004e283Initial program 99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (fabs (- (/ (+ x 4.0) y) (* z (/ x y)))))) (if (<= t_0 INFINITY) t_0 (fabs (* (/ -1.0 y) (* x z))))))
double code(double x, double y, double z) {
double t_0 = fabs((((x + 4.0) / y) - (z * (x / y))));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0;
} else {
tmp = fabs(((-1.0 / y) * (x * z)));
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = Math.abs((((x + 4.0) / y) - (z * (x / y))));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0;
} else {
tmp = Math.abs(((-1.0 / y) * (x * z)));
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs((((x + 4.0) / y) - (z * (x / y)))) tmp = 0 if t_0 <= math.inf: tmp = t_0 else: tmp = math.fabs(((-1.0 / y) * (x * z))) return tmp
function code(x, y, z) t_0 = abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(z * Float64(x / y)))) tmp = 0.0 if (t_0 <= Inf) tmp = t_0; else tmp = abs(Float64(Float64(-1.0 / y) * Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs((((x + 4.0) / y) - (z * (x / y)))); tmp = 0.0; if (t_0 <= Inf) tmp = t_0; else tmp = abs(((-1.0 / y) * (x * z))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], t$95$0, N[Abs[N[(N[(-1.0 / y), $MachinePrecision] * N[(x * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\frac{x + 4}{y} - z \cdot \frac{x}{y}\right|\\
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-1}{y} \cdot \left(x \cdot z\right)\right|\\
\end{array}
\end{array}
if (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < +inf.0Initial program 97.8%
if +inf.0 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) Initial program 0.0%
Simplified100.0%
Taylor expanded in z around inf 56.9%
Final simplification93.4%
(FPCore (x y z) :precision binary64 (if (<= y 8e-89) (fabs (* (/ -1.0 y) (fma x z (- -4.0 x)))) (fabs (fma x (/ z y) (/ (- -4.0 x) y)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 8e-89) {
tmp = fabs(((-1.0 / y) * fma(x, z, (-4.0 - x))));
} else {
tmp = fabs(fma(x, (z / y), ((-4.0 - x) / y)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= 8e-89) tmp = abs(Float64(Float64(-1.0 / y) * fma(x, z, Float64(-4.0 - x)))); else tmp = abs(fma(x, Float64(z / y), Float64(Float64(-4.0 - x) / y))); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, 8e-89], N[Abs[N[(N[(-1.0 / y), $MachinePrecision] * N[(x * z + N[(-4.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y), $MachinePrecision] + N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8 \cdot 10^{-89}:\\
\;\;\;\;\left|\frac{-1}{y} \cdot \mathsf{fma}\left(x, z, -4 - x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(x, \frac{z}{y}, \frac{-4 - x}{y}\right)\right|\\
\end{array}
\end{array}
if y < 8.00000000000000031e-89Initial program 82.7%
Simplified96.6%
if 8.00000000000000031e-89 < y Initial program 96.5%
fabs-sub96.5%
associate-*l/95.2%
associate-*r/98.7%
fmm-def99.9%
distribute-neg-frac99.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
metadata-eval99.9%
Simplified99.9%
(FPCore (x y z)
:precision binary64
(if (<= x -1.55e+130)
(/ (- x) y)
(if (<= x -0.52)
(- (* x (/ z y)) (/ (+ x 4.0) y))
(/ (- (+ x 4.0) (* x z)) y))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.55e+130) {
tmp = -x / y;
} else if (x <= -0.52) {
tmp = (x * (z / y)) - ((x + 4.0) / y);
} else {
tmp = ((x + 4.0) - (x * z)) / y;
}
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.55d+130)) then
tmp = -x / y
else if (x <= (-0.52d0)) then
tmp = (x * (z / y)) - ((x + 4.0d0) / y)
else
tmp = ((x + 4.0d0) - (x * z)) / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.55e+130) {
tmp = -x / y;
} else if (x <= -0.52) {
tmp = (x * (z / y)) - ((x + 4.0) / y);
} else {
tmp = ((x + 4.0) - (x * z)) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.55e+130: tmp = -x / y elif x <= -0.52: tmp = (x * (z / y)) - ((x + 4.0) / y) else: tmp = ((x + 4.0) - (x * z)) / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.55e+130) tmp = Float64(Float64(-x) / y); elseif (x <= -0.52) tmp = Float64(Float64(x * Float64(z / y)) - Float64(Float64(x + 4.0) / y)); else tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.55e+130) tmp = -x / y; elseif (x <= -0.52) tmp = (x * (z / y)) - ((x + 4.0) / y); else tmp = ((x + 4.0) - (x * z)) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.55e+130], N[((-x) / y), $MachinePrecision], If[LessEqual[x, -0.52], N[(N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+130}:\\
\;\;\;\;\frac{-x}{y}\\
\mathbf{elif}\;x \leq -0.52:\\
\;\;\;\;x \cdot \frac{z}{y} - \frac{x + 4}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y}\\
\end{array}
\end{array}
if x < -1.55e130Initial program 67.5%
fabs-sub67.5%
associate-*l/70.6%
associate-*r/75.5%
fmm-def89.0%
distribute-neg-frac89.0%
+-commutative89.0%
distribute-neg-in89.0%
unsub-neg89.0%
metadata-eval89.0%
Simplified89.0%
add-sqr-sqrt56.4%
fabs-sqr56.4%
add-sqr-sqrt56.8%
fma-undefine43.3%
associate-*r/40.8%
associate-*l/37.9%
div-inv37.9%
sub-neg37.9%
metadata-eval37.9%
distribute-neg-in37.9%
+-commutative37.9%
cancel-sign-sub-inv37.9%
div-inv37.9%
associate-*l/40.8%
sub-div54.3%
Applied egg-rr54.3%
Taylor expanded in z around 0 41.4%
associate-*r/41.4%
distribute-lft-in41.4%
metadata-eval41.4%
neg-mul-141.4%
sub-neg41.4%
Simplified41.4%
Taylor expanded in x around inf 41.4%
neg-mul-141.4%
Simplified41.4%
if -1.55e130 < x < -0.52000000000000002Initial program 92.2%
fabs-sub92.2%
associate-*l/96.2%
associate-*r/99.9%
fmm-def99.9%
distribute-neg-frac99.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
metadata-eval99.9%
Simplified99.9%
add-sqr-sqrt45.9%
fabs-sqr45.9%
add-sqr-sqrt47.0%
fma-undefine47.0%
associate-*r/43.3%
associate-*l/39.3%
div-inv39.3%
sub-neg39.3%
metadata-eval39.3%
distribute-neg-in39.3%
+-commutative39.3%
cancel-sign-sub-inv39.3%
associate-*l/43.3%
associate-*r/47.0%
div-inv47.0%
Applied egg-rr47.0%
if -0.52000000000000002 < x Initial program 90.2%
fabs-sub90.2%
associate-*l/93.9%
associate-*r/92.9%
fmm-def93.4%
distribute-neg-frac93.4%
+-commutative93.4%
distribute-neg-in93.4%
unsub-neg93.4%
metadata-eval93.4%
Simplified93.4%
fma-undefine92.9%
associate-*r/93.9%
associate-*l/90.2%
div-inv90.1%
sub-neg90.1%
metadata-eval90.1%
distribute-neg-in90.1%
+-commutative90.1%
cancel-sign-sub-inv90.1%
div-inv90.2%
fabs-sub90.2%
add-sqr-sqrt46.7%
fabs-sqr46.7%
add-sqr-sqrt47.7%
associate-*l/50.5%
sub-div52.0%
Applied egg-rr52.0%
(FPCore (x y z) :precision binary64 (if (<= x -0.39) (* x (/ (+ -1.0 z) y)) (if (<= x 2.5e-8) (/ (- 4.0 (* x z)) y) (* (/ x y) (- 1.0 z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -0.39) {
tmp = x * ((-1.0 + z) / y);
} else if (x <= 2.5e-8) {
tmp = (4.0 - (x * z)) / y;
} 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 (x <= (-0.39d0)) then
tmp = x * (((-1.0d0) + z) / y)
else if (x <= 2.5d-8) then
tmp = (4.0d0 - (x * z)) / y
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 (x <= -0.39) {
tmp = x * ((-1.0 + z) / y);
} else if (x <= 2.5e-8) {
tmp = (4.0 - (x * z)) / y;
} else {
tmp = (x / y) * (1.0 - z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -0.39: tmp = x * ((-1.0 + z) / y) elif x <= 2.5e-8: tmp = (4.0 - (x * z)) / y else: tmp = (x / y) * (1.0 - z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -0.39) tmp = Float64(x * Float64(Float64(-1.0 + z) / y)); elseif (x <= 2.5e-8) tmp = Float64(Float64(4.0 - Float64(x * z)) / y); else tmp = Float64(Float64(x / y) * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -0.39) tmp = x * ((-1.0 + z) / y); elseif (x <= 2.5e-8) tmp = (4.0 - (x * z)) / y; else tmp = (x / y) * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -0.39], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.5e-8], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.39:\\
\;\;\;\;x \cdot \frac{-1 + z}{y}\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-8}:\\
\;\;\;\;\frac{4 - x \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if x < -0.39000000000000001Initial program 77.7%
fabs-sub77.7%
associate-*l/81.1%
associate-*r/85.6%
fmm-def93.5%
distribute-neg-frac93.5%
+-commutative93.5%
distribute-neg-in93.5%
unsub-neg93.5%
metadata-eval93.5%
Simplified93.5%
add-sqr-sqrt52.1%
fabs-sqr52.1%
add-sqr-sqrt52.8%
fma-undefine44.8%
associate-*r/41.9%
associate-*l/38.5%
div-inv38.5%
sub-neg38.5%
metadata-eval38.5%
distribute-neg-in38.5%
+-commutative38.5%
cancel-sign-sub-inv38.5%
div-inv38.5%
associate-*l/41.9%
sub-div49.8%
Applied egg-rr49.8%
Taylor expanded in x around inf 49.8%
associate-/l*52.7%
sub-neg52.7%
metadata-eval52.7%
Simplified52.7%
if -0.39000000000000001 < x < 2.4999999999999999e-8Initial program 95.9%
fabs-sub95.9%
associate-*l/99.9%
associate-*r/93.6%
fmm-def93.6%
distribute-neg-frac93.6%
+-commutative93.6%
distribute-neg-in93.6%
unsub-neg93.6%
metadata-eval93.6%
Simplified93.6%
fma-undefine93.6%
associate-*r/99.9%
associate-*l/95.9%
div-inv95.9%
sub-neg95.9%
metadata-eval95.9%
distribute-neg-in95.9%
+-commutative95.9%
cancel-sign-sub-inv95.9%
div-inv95.9%
fabs-sub95.9%
add-sqr-sqrt51.4%
fabs-sqr51.4%
add-sqr-sqrt52.8%
associate-*l/55.6%
sub-div55.6%
Applied egg-rr55.6%
Taylor expanded in x around 0 55.5%
if 2.4999999999999999e-8 < x Initial program 81.1%
fabs-sub81.1%
associate-*l/84.2%
associate-*r/91.8%
fmm-def93.1%
distribute-neg-frac93.1%
+-commutative93.1%
distribute-neg-in93.1%
unsub-neg93.1%
metadata-eval93.1%
Simplified93.1%
fma-undefine91.8%
associate-*r/84.2%
associate-*l/81.1%
div-inv80.9%
sub-neg80.9%
metadata-eval80.9%
distribute-neg-in80.9%
+-commutative80.9%
cancel-sign-sub-inv80.9%
div-inv81.1%
fabs-sub81.1%
add-sqr-sqrt39.2%
fabs-sqr39.2%
add-sqr-sqrt39.5%
associate-*l/42.2%
sub-div46.2%
Applied egg-rr46.2%
Taylor expanded in x around inf 46.2%
*-commutative46.2%
associate-*r/47.6%
Simplified47.6%
Final simplification52.5%
(FPCore (x y z) :precision binary64 (if (<= x -0.47) (* x (/ (+ -1.0 z) y)) (if (<= x 2.5e-8) (/ (+ x 4.0) y) (* (/ x y) (- 1.0 z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -0.47) {
tmp = x * ((-1.0 + z) / y);
} else if (x <= 2.5e-8) {
tmp = (x + 4.0) / y;
} 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 (x <= (-0.47d0)) then
tmp = x * (((-1.0d0) + z) / y)
else if (x <= 2.5d-8) then
tmp = (x + 4.0d0) / y
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 (x <= -0.47) {
tmp = x * ((-1.0 + z) / y);
} else if (x <= 2.5e-8) {
tmp = (x + 4.0) / y;
} else {
tmp = (x / y) * (1.0 - z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -0.47: tmp = x * ((-1.0 + z) / y) elif x <= 2.5e-8: tmp = (x + 4.0) / y else: tmp = (x / y) * (1.0 - z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -0.47) tmp = Float64(x * Float64(Float64(-1.0 + z) / y)); elseif (x <= 2.5e-8) tmp = Float64(Float64(x + 4.0) / y); else tmp = Float64(Float64(x / y) * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -0.47) tmp = x * ((-1.0 + z) / y); elseif (x <= 2.5e-8) tmp = (x + 4.0) / y; else tmp = (x / y) * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -0.47], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.5e-8], N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.47:\\
\;\;\;\;x \cdot \frac{-1 + z}{y}\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-8}:\\
\;\;\;\;\frac{x + 4}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if x < -0.46999999999999997Initial program 77.7%
fabs-sub77.7%
associate-*l/81.1%
associate-*r/85.6%
fmm-def93.5%
distribute-neg-frac93.5%
+-commutative93.5%
distribute-neg-in93.5%
unsub-neg93.5%
metadata-eval93.5%
Simplified93.5%
add-sqr-sqrt52.1%
fabs-sqr52.1%
add-sqr-sqrt52.8%
fma-undefine44.8%
associate-*r/41.9%
associate-*l/38.5%
div-inv38.5%
sub-neg38.5%
metadata-eval38.5%
distribute-neg-in38.5%
+-commutative38.5%
cancel-sign-sub-inv38.5%
div-inv38.5%
associate-*l/41.9%
sub-div49.8%
Applied egg-rr49.8%
Taylor expanded in x around inf 49.8%
associate-/l*52.7%
sub-neg52.7%
metadata-eval52.7%
Simplified52.7%
if -0.46999999999999997 < x < 2.4999999999999999e-8Initial program 95.9%
Simplified99.9%
add-sqr-sqrt54.2%
fabs-sqr54.2%
add-sqr-sqrt55.6%
associate-*l/55.6%
clear-num55.6%
mul-1-neg55.6%
Applied egg-rr55.6%
Taylor expanded in z around 0 41.6%
+-commutative41.6%
Simplified41.6%
if 2.4999999999999999e-8 < x Initial program 81.1%
fabs-sub81.1%
associate-*l/84.2%
associate-*r/91.8%
fmm-def93.1%
distribute-neg-frac93.1%
+-commutative93.1%
distribute-neg-in93.1%
unsub-neg93.1%
metadata-eval93.1%
Simplified93.1%
fma-undefine91.8%
associate-*r/84.2%
associate-*l/81.1%
div-inv80.9%
sub-neg80.9%
metadata-eval80.9%
distribute-neg-in80.9%
+-commutative80.9%
cancel-sign-sub-inv80.9%
div-inv81.1%
fabs-sub81.1%
add-sqr-sqrt39.2%
fabs-sqr39.2%
add-sqr-sqrt39.5%
associate-*l/42.2%
sub-div46.2%
Applied egg-rr46.2%
Taylor expanded in x around inf 46.2%
*-commutative46.2%
associate-*r/47.6%
Simplified47.6%
Final simplification46.0%
(FPCore (x y z) :precision binary64 (if (<= x -0.5) (* x (/ (+ -1.0 z) y)) (if (<= x 2.5e-8) (/ (+ x 4.0) y) (* x (/ (- 1.0 z) y)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -0.5) {
tmp = x * ((-1.0 + z) / y);
} else if (x <= 2.5e-8) {
tmp = (x + 4.0) / y;
} else {
tmp = x * ((1.0 - z) / y);
}
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.5d0)) then
tmp = x * (((-1.0d0) + z) / y)
else if (x <= 2.5d-8) then
tmp = (x + 4.0d0) / y
else
tmp = x * ((1.0d0 - z) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -0.5) {
tmp = x * ((-1.0 + z) / y);
} else if (x <= 2.5e-8) {
tmp = (x + 4.0) / y;
} else {
tmp = x * ((1.0 - z) / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -0.5: tmp = x * ((-1.0 + z) / y) elif x <= 2.5e-8: tmp = (x + 4.0) / y else: tmp = x * ((1.0 - z) / y) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -0.5) tmp = Float64(x * Float64(Float64(-1.0 + z) / y)); elseif (x <= 2.5e-8) tmp = Float64(Float64(x + 4.0) / y); else tmp = Float64(x * Float64(Float64(1.0 - z) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -0.5) tmp = x * ((-1.0 + z) / y); elseif (x <= 2.5e-8) tmp = (x + 4.0) / y; else tmp = x * ((1.0 - z) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -0.5], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.5e-8], N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision], N[(x * N[(N[(1.0 - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.5:\\
\;\;\;\;x \cdot \frac{-1 + z}{y}\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-8}:\\
\;\;\;\;\frac{x + 4}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1 - z}{y}\\
\end{array}
\end{array}
if x < -0.5Initial program 77.7%
fabs-sub77.7%
associate-*l/81.1%
associate-*r/85.6%
fmm-def93.5%
distribute-neg-frac93.5%
+-commutative93.5%
distribute-neg-in93.5%
unsub-neg93.5%
metadata-eval93.5%
Simplified93.5%
add-sqr-sqrt52.1%
fabs-sqr52.1%
add-sqr-sqrt52.8%
fma-undefine44.8%
associate-*r/41.9%
associate-*l/38.5%
div-inv38.5%
sub-neg38.5%
metadata-eval38.5%
distribute-neg-in38.5%
+-commutative38.5%
cancel-sign-sub-inv38.5%
div-inv38.5%
associate-*l/41.9%
sub-div49.8%
Applied egg-rr49.8%
Taylor expanded in x around inf 49.8%
associate-/l*52.7%
sub-neg52.7%
metadata-eval52.7%
Simplified52.7%
if -0.5 < x < 2.4999999999999999e-8Initial program 95.9%
Simplified99.9%
add-sqr-sqrt54.2%
fabs-sqr54.2%
add-sqr-sqrt55.6%
associate-*l/55.6%
clear-num55.6%
mul-1-neg55.6%
Applied egg-rr55.6%
Taylor expanded in z around 0 41.6%
+-commutative41.6%
Simplified41.6%
if 2.4999999999999999e-8 < x Initial program 81.1%
Simplified92.1%
add-sqr-sqrt45.9%
fabs-sqr45.9%
add-sqr-sqrt46.1%
associate-*l/46.2%
clear-num46.2%
mul-1-neg46.2%
Applied egg-rr46.2%
Taylor expanded in x around inf 46.2%
associate-/l*47.4%
Simplified47.4%
Final simplification46.0%
(FPCore (x y z) :precision binary64 (if (<= x -0.52) (* x (/ (+ -1.0 z) y)) (/ (- (+ x 4.0) (* x z)) y)))
double code(double x, double y, double z) {
double tmp;
if (x <= -0.52) {
tmp = x * ((-1.0 + z) / y);
} else {
tmp = ((x + 4.0) - (x * z)) / y;
}
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.52d0)) then
tmp = x * (((-1.0d0) + z) / y)
else
tmp = ((x + 4.0d0) - (x * z)) / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -0.52) {
tmp = x * ((-1.0 + z) / y);
} else {
tmp = ((x + 4.0) - (x * z)) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -0.52: tmp = x * ((-1.0 + z) / y) else: tmp = ((x + 4.0) - (x * z)) / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -0.52) tmp = Float64(x * Float64(Float64(-1.0 + z) / y)); else tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -0.52) tmp = x * ((-1.0 + z) / y); else tmp = ((x + 4.0) - (x * z)) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -0.52], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.52:\\
\;\;\;\;x \cdot \frac{-1 + z}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y}\\
\end{array}
\end{array}
if x < -0.52000000000000002Initial program 77.7%
fabs-sub77.7%
associate-*l/81.1%
associate-*r/85.6%
fmm-def93.5%
distribute-neg-frac93.5%
+-commutative93.5%
distribute-neg-in93.5%
unsub-neg93.5%
metadata-eval93.5%
Simplified93.5%
add-sqr-sqrt52.1%
fabs-sqr52.1%
add-sqr-sqrt52.8%
fma-undefine44.8%
associate-*r/41.9%
associate-*l/38.5%
div-inv38.5%
sub-neg38.5%
metadata-eval38.5%
distribute-neg-in38.5%
+-commutative38.5%
cancel-sign-sub-inv38.5%
div-inv38.5%
associate-*l/41.9%
sub-div49.8%
Applied egg-rr49.8%
Taylor expanded in x around inf 49.8%
associate-/l*52.7%
sub-neg52.7%
metadata-eval52.7%
Simplified52.7%
if -0.52000000000000002 < x Initial program 90.2%
fabs-sub90.2%
associate-*l/93.9%
associate-*r/92.9%
fmm-def93.4%
distribute-neg-frac93.4%
+-commutative93.4%
distribute-neg-in93.4%
unsub-neg93.4%
metadata-eval93.4%
Simplified93.4%
fma-undefine92.9%
associate-*r/93.9%
associate-*l/90.2%
div-inv90.1%
sub-neg90.1%
metadata-eval90.1%
distribute-neg-in90.1%
+-commutative90.1%
cancel-sign-sub-inv90.1%
div-inv90.2%
fabs-sub90.2%
add-sqr-sqrt46.7%
fabs-sqr46.7%
add-sqr-sqrt47.7%
associate-*l/50.5%
sub-div52.0%
Applied egg-rr52.0%
Final simplification52.2%
(FPCore (x y z) :precision binary64 (if (<= x -10.2) (/ (- x) y) (if (<= x 4.0) (/ 4.0 y) (/ x y))))
double code(double x, double y, double z) {
double tmp;
if (x <= -10.2) {
tmp = -x / y;
} else if (x <= 4.0) {
tmp = 4.0 / y;
} else {
tmp = x / y;
}
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 <= (-10.2d0)) then
tmp = -x / y
else if (x <= 4.0d0) then
tmp = 4.0d0 / y
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -10.2) {
tmp = -x / y;
} else if (x <= 4.0) {
tmp = 4.0 / y;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -10.2: tmp = -x / y elif x <= 4.0: tmp = 4.0 / y else: tmp = x / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -10.2) tmp = Float64(Float64(-x) / y); elseif (x <= 4.0) tmp = Float64(4.0 / y); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -10.2) tmp = -x / y; elseif (x <= 4.0) tmp = 4.0 / y; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -10.2], N[((-x) / y), $MachinePrecision], If[LessEqual[x, 4.0], N[(4.0 / y), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -10.2:\\
\;\;\;\;\frac{-x}{y}\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\frac{4}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -10.199999999999999Initial program 77.4%
fabs-sub77.4%
associate-*l/80.8%
associate-*r/85.4%
fmm-def93.4%
distribute-neg-frac93.4%
+-commutative93.4%
distribute-neg-in93.4%
unsub-neg93.4%
metadata-eval93.4%
Simplified93.4%
add-sqr-sqrt51.3%
fabs-sqr51.3%
add-sqr-sqrt52.0%
fma-undefine43.9%
associate-*r/40.9%
associate-*l/37.5%
div-inv37.5%
sub-neg37.5%
metadata-eval37.5%
distribute-neg-in37.5%
+-commutative37.5%
cancel-sign-sub-inv37.5%
div-inv37.5%
associate-*l/40.9%
sub-div49.0%
Applied egg-rr49.0%
Taylor expanded in z around 0 38.3%
associate-*r/38.3%
distribute-lft-in38.3%
metadata-eval38.3%
neg-mul-138.3%
sub-neg38.3%
Simplified38.3%
Taylor expanded in x around inf 38.3%
neg-mul-138.3%
Simplified38.3%
if -10.199999999999999 < x < 4Initial program 96.0%
Simplified99.9%
add-sqr-sqrt54.2%
fabs-sqr54.2%
add-sqr-sqrt55.5%
associate-*l/55.5%
clear-num55.5%
mul-1-neg55.5%
Applied egg-rr55.5%
Taylor expanded in x around 0 40.8%
if 4 < x Initial program 80.8%
Simplified92.1%
add-sqr-sqrt45.2%
fabs-sqr45.2%
add-sqr-sqrt45.4%
associate-*l/45.5%
clear-num45.5%
mul-1-neg45.5%
Applied egg-rr45.5%
Taylor expanded in z around 0 28.2%
+-commutative28.2%
Simplified28.2%
Taylor expanded in x around inf 28.3%
(FPCore (x y z) :precision binary64 (if (<= x -0.52) (* x (/ (+ -1.0 z) y)) (/ (+ x 4.0) y)))
double code(double x, double y, double z) {
double tmp;
if (x <= -0.52) {
tmp = x * ((-1.0 + z) / y);
} else {
tmp = (x + 4.0) / y;
}
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.52d0)) then
tmp = x * (((-1.0d0) + z) / y)
else
tmp = (x + 4.0d0) / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -0.52) {
tmp = x * ((-1.0 + z) / y);
} else {
tmp = (x + 4.0) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -0.52: tmp = x * ((-1.0 + z) / y) else: tmp = (x + 4.0) / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -0.52) tmp = Float64(x * Float64(Float64(-1.0 + z) / y)); else tmp = Float64(Float64(x + 4.0) / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -0.52) tmp = x * ((-1.0 + z) / y); else tmp = (x + 4.0) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -0.52], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.52:\\
\;\;\;\;x \cdot \frac{-1 + z}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y}\\
\end{array}
\end{array}
if x < -0.52000000000000002Initial program 77.7%
fabs-sub77.7%
associate-*l/81.1%
associate-*r/85.6%
fmm-def93.5%
distribute-neg-frac93.5%
+-commutative93.5%
distribute-neg-in93.5%
unsub-neg93.5%
metadata-eval93.5%
Simplified93.5%
add-sqr-sqrt52.1%
fabs-sqr52.1%
add-sqr-sqrt52.8%
fma-undefine44.8%
associate-*r/41.9%
associate-*l/38.5%
div-inv38.5%
sub-neg38.5%
metadata-eval38.5%
distribute-neg-in38.5%
+-commutative38.5%
cancel-sign-sub-inv38.5%
div-inv38.5%
associate-*l/41.9%
sub-div49.8%
Applied egg-rr49.8%
Taylor expanded in x around inf 49.8%
associate-/l*52.7%
sub-neg52.7%
metadata-eval52.7%
Simplified52.7%
if -0.52000000000000002 < x Initial program 90.2%
Simplified96.9%
add-sqr-sqrt51.0%
fabs-sqr51.0%
add-sqr-sqrt52.0%
associate-*l/52.0%
clear-num52.0%
mul-1-neg52.0%
Applied egg-rr52.0%
Taylor expanded in z around 0 36.3%
+-commutative36.3%
Simplified36.3%
Final simplification40.4%
(FPCore (x y z) :precision binary64 (if (<= x -4.0) (/ (- -4.0 x) y) (/ (+ x 4.0) y)))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.0) {
tmp = (-4.0 - x) / y;
} else {
tmp = (x + 4.0) / y;
}
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 <= (-4.0d0)) then
tmp = ((-4.0d0) - x) / y
else
tmp = (x + 4.0d0) / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4.0) {
tmp = (-4.0 - x) / y;
} else {
tmp = (x + 4.0) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.0: tmp = (-4.0 - x) / y else: tmp = (x + 4.0) / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.0) tmp = Float64(Float64(-4.0 - x) / y); else tmp = Float64(Float64(x + 4.0) / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.0) tmp = (-4.0 - x) / y; else tmp = (x + 4.0) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.0], N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4:\\
\;\;\;\;\frac{-4 - x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y}\\
\end{array}
\end{array}
if x < -4Initial program 77.4%
fabs-sub77.4%
associate-*l/80.8%
associate-*r/85.4%
fmm-def93.4%
distribute-neg-frac93.4%
+-commutative93.4%
distribute-neg-in93.4%
unsub-neg93.4%
metadata-eval93.4%
Simplified93.4%
add-sqr-sqrt51.3%
fabs-sqr51.3%
add-sqr-sqrt52.0%
fma-undefine43.9%
associate-*r/40.9%
associate-*l/37.5%
div-inv37.5%
sub-neg37.5%
metadata-eval37.5%
distribute-neg-in37.5%
+-commutative37.5%
cancel-sign-sub-inv37.5%
div-inv37.5%
associate-*l/40.9%
sub-div49.0%
Applied egg-rr49.0%
Taylor expanded in z around 0 38.3%
associate-*r/38.3%
distribute-lft-in38.3%
metadata-eval38.3%
neg-mul-138.3%
sub-neg38.3%
Simplified38.3%
if -4 < x Initial program 90.3%
Simplified96.9%
add-sqr-sqrt50.8%
fabs-sqr50.8%
add-sqr-sqrt51.7%
associate-*l/51.7%
clear-num51.7%
mul-1-neg51.7%
Applied egg-rr51.7%
Taylor expanded in z around 0 36.2%
+-commutative36.2%
Simplified36.2%
(FPCore (x y z) :precision binary64 (if (<= x -4.0) (/ (- x) y) (/ (+ x 4.0) y)))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.0) {
tmp = -x / y;
} else {
tmp = (x + 4.0) / y;
}
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 <= (-4.0d0)) then
tmp = -x / y
else
tmp = (x + 4.0d0) / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4.0) {
tmp = -x / y;
} else {
tmp = (x + 4.0) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.0: tmp = -x / y else: tmp = (x + 4.0) / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.0) tmp = Float64(Float64(-x) / y); else tmp = Float64(Float64(x + 4.0) / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.0) tmp = -x / y; else tmp = (x + 4.0) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.0], N[((-x) / y), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4:\\
\;\;\;\;\frac{-x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y}\\
\end{array}
\end{array}
if x < -4Initial program 77.4%
fabs-sub77.4%
associate-*l/80.8%
associate-*r/85.4%
fmm-def93.4%
distribute-neg-frac93.4%
+-commutative93.4%
distribute-neg-in93.4%
unsub-neg93.4%
metadata-eval93.4%
Simplified93.4%
add-sqr-sqrt51.3%
fabs-sqr51.3%
add-sqr-sqrt52.0%
fma-undefine43.9%
associate-*r/40.9%
associate-*l/37.5%
div-inv37.5%
sub-neg37.5%
metadata-eval37.5%
distribute-neg-in37.5%
+-commutative37.5%
cancel-sign-sub-inv37.5%
div-inv37.5%
associate-*l/40.9%
sub-div49.0%
Applied egg-rr49.0%
Taylor expanded in z around 0 38.3%
associate-*r/38.3%
distribute-lft-in38.3%
metadata-eval38.3%
neg-mul-138.3%
sub-neg38.3%
Simplified38.3%
Taylor expanded in x around inf 38.3%
neg-mul-138.3%
Simplified38.3%
if -4 < x Initial program 90.3%
Simplified96.9%
add-sqr-sqrt50.8%
fabs-sqr50.8%
add-sqr-sqrt51.7%
associate-*l/51.7%
clear-num51.7%
mul-1-neg51.7%
Applied egg-rr51.7%
Taylor expanded in z around 0 36.2%
+-commutative36.2%
Simplified36.2%
(FPCore (x y z) :precision binary64 (if (<= x 4.0) (/ 4.0 y) (/ x y)))
double code(double x, double y, double z) {
double tmp;
if (x <= 4.0) {
tmp = 4.0 / y;
} else {
tmp = x / y;
}
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 <= 4.0d0) then
tmp = 4.0d0 / y
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 4.0) {
tmp = 4.0 / y;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 4.0: tmp = 4.0 / y else: tmp = x / y return tmp
function code(x, y, z) tmp = 0.0 if (x <= 4.0) tmp = Float64(4.0 / y); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 4.0) tmp = 4.0 / y; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 4.0], N[(4.0 / y), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4:\\
\;\;\;\;\frac{4}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < 4Initial program 89.7%
Simplified98.3%
add-sqr-sqrt51.6%
fabs-sqr51.6%
add-sqr-sqrt52.6%
associate-*l/52.7%
clear-num52.6%
mul-1-neg52.6%
Applied egg-rr52.6%
Taylor expanded in x around 0 28.6%
if 4 < x Initial program 80.8%
Simplified92.1%
add-sqr-sqrt45.2%
fabs-sqr45.2%
add-sqr-sqrt45.4%
associate-*l/45.5%
clear-num45.5%
mul-1-neg45.5%
Applied egg-rr45.5%
Taylor expanded in z around 0 28.2%
+-commutative28.2%
Simplified28.2%
Taylor expanded in x around inf 28.3%
(FPCore (x y z) :precision binary64 (/ 4.0 y))
double code(double x, double y, double z) {
return 4.0 / y;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 4.0d0 / y
end function
public static double code(double x, double y, double z) {
return 4.0 / y;
}
def code(x, y, z): return 4.0 / y
function code(x, y, z) return Float64(4.0 / y) end
function tmp = code(x, y, z) tmp = 4.0 / y; end
code[x_, y_, z_] := N[(4.0 / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{4}{y}
\end{array}
Initial program 87.1%
Simplified96.5%
add-sqr-sqrt49.7%
fabs-sqr49.7%
add-sqr-sqrt50.5%
associate-*l/50.6%
clear-num50.6%
mul-1-neg50.6%
Applied egg-rr50.6%
Taylor expanded in x around 0 21.3%
herbie shell --seed 2024166
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))