
(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)
use fmin_fmax_functions
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]
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
Herbie found 10 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)
use fmin_fmax_functions
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]
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
(FPCore (x y z) :precision binary64 (if (<= (fabs y) 5e+58) (fabs (/ (fma z x (- -4.0 x)) (fabs y))) (fabs (- (/ (+ x 4.0) (fabs y)) (* x (* (/ 1.0 (fabs y)) z))))))
double code(double x, double y, double z) {
double tmp;
if (fabs(y) <= 5e+58) {
tmp = fabs((fma(z, x, (-4.0 - x)) / fabs(y)));
} else {
tmp = fabs((((x + 4.0) / fabs(y)) - (x * ((1.0 / fabs(y)) * z))));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (abs(y) <= 5e+58) tmp = abs(Float64(fma(z, x, Float64(-4.0 - x)) / abs(y))); else tmp = abs(Float64(Float64(Float64(x + 4.0) / abs(y)) - Float64(x * Float64(Float64(1.0 / abs(y)) * z)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[Abs[y], $MachinePrecision], 5e+58], N[Abs[N[(N[(z * x + N[(-4.0 - x), $MachinePrecision]), $MachinePrecision] / N[Abs[y], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / N[Abs[y], $MachinePrecision]), $MachinePrecision] - N[(x * N[(N[(1.0 / N[Abs[y], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|y\right| \leq 5 \cdot 10^{+58}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(z, x, -4 - x\right)}{\left|y\right|}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{\left|y\right|} - x \cdot \left(\frac{1}{\left|y\right|} \cdot z\right)\right|\\
\end{array}
if y < 4.9999999999999999e58Initial program 92.4%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6492.0%
Applied rewrites92.0%
Applied rewrites95.9%
if 4.9999999999999999e58 < y Initial program 92.4%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6492.0%
Applied rewrites92.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (* (/ (- 1.0 z) y) x))))
(if (<= x -1.3e+189)
t_0
(if (<= x 5e+46) (fabs (/ (fma z x (- -4.0 x)) y)) t_0))))double code(double x, double y, double z) {
double t_0 = fabs((((1.0 - z) / y) * x));
double tmp;
if (x <= -1.3e+189) {
tmp = t_0;
} else if (x <= 5e+46) {
tmp = fabs((fma(z, x, (-4.0 - x)) / y));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = abs(Float64(Float64(Float64(1.0 - z) / y) * x)) tmp = 0.0 if (x <= -1.3e+189) tmp = t_0; elseif (x <= 5e+46) tmp = abs(Float64(fma(z, x, Float64(-4.0 - x)) / y)); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(N[(N[(1.0 - z), $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.3e+189], t$95$0, If[LessEqual[x, 5e+46], N[Abs[N[(N[(z * x + N[(-4.0 - x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \left|\frac{1 - z}{y} \cdot x\right|\\
\mathbf{if}\;x \leq -1.3 \cdot 10^{+189}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+46}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(z, x, -4 - x\right)}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -1.2999999999999999e189 or 5.0000000000000002e46 < x Initial program 92.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f6461.1%
Applied rewrites61.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6461.1%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6461.1%
Applied rewrites61.1%
if -1.2999999999999999e189 < x < 5.0000000000000002e46Initial program 92.4%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6492.0%
Applied rewrites92.0%
Applied rewrites95.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (* (/ (- 1.0 z) y) x))))
(if (<= x -100000.0)
t_0
(if (<= x 86000000.0) (fabs (/ (fma z x -4.0) y)) t_0))))double code(double x, double y, double z) {
double t_0 = fabs((((1.0 - z) / y) * x));
double tmp;
if (x <= -100000.0) {
tmp = t_0;
} else if (x <= 86000000.0) {
tmp = fabs((fma(z, x, -4.0) / y));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = abs(Float64(Float64(Float64(1.0 - z) / y) * x)) tmp = 0.0 if (x <= -100000.0) tmp = t_0; elseif (x <= 86000000.0) tmp = abs(Float64(fma(z, x, -4.0) / y)); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(N[(N[(1.0 - z), $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -100000.0], t$95$0, If[LessEqual[x, 86000000.0], N[Abs[N[(N[(z * x + -4.0), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \left|\frac{1 - z}{y} \cdot x\right|\\
\mathbf{if}\;x \leq -100000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 86000000:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(z, x, -4\right)}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -1e5 or 8.6e7 < x Initial program 92.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f6461.1%
Applied rewrites61.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6461.1%
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6461.1%
Applied rewrites61.1%
if -1e5 < x < 8.6e7Initial program 92.4%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
distribute-neg-frac2N/A
lift-/.f64N/A
frac-2negN/A
div-add-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
lower--.f64N/A
metadata-evalN/A
lower-neg.f6495.9%
Applied rewrites95.9%
Taylor expanded in x around 0
Applied rewrites73.7%
lift-fabs.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
fabs-negN/A
lower-fabs.f64N/A
lower-/.f6473.7%
Applied rewrites73.7%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- (/ (+ x 4.0) y) (* (/ x y) z)))) (if (<= t_0 -2e-88) (fabs t_0) (fabs (/ (fma z x (- -4.0 x)) y)))))
double code(double x, double y, double z) {
double t_0 = ((x + 4.0) / y) - ((x / y) * z);
double tmp;
if (t_0 <= -2e-88) {
tmp = fabs(t_0);
} else {
tmp = fabs((fma(z, x, (-4.0 - x)) / y));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z)) tmp = 0.0 if (t_0 <= -2e-88) tmp = abs(t_0); else tmp = abs(Float64(fma(z, x, Float64(-4.0 - x)) / y)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-88], N[Abs[t$95$0], $MachinePrecision], N[Abs[N[(N[(z * x + N[(-4.0 - x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_0 := \frac{x + 4}{y} - \frac{x}{y} \cdot z\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-88}:\\
\;\;\;\;\left|t\_0\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(z, x, -4 - x\right)}{y}\right|\\
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < -1.9999999999999999e-88Initial program 92.4%
if -1.9999999999999999e-88 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 92.4%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6492.0%
Applied rewrites92.0%
Applied rewrites95.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (/ (fma z x -4.0) y))))
(if (<= z -600000000.0)
t_0
(if (<= z 5.2) (fabs (/ (- -4.0 x) y)) t_0))))double code(double x, double y, double z) {
double t_0 = fabs((fma(z, x, -4.0) / y));
double tmp;
if (z <= -600000000.0) {
tmp = t_0;
} else if (z <= 5.2) {
tmp = fabs(((-4.0 - x) / y));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = abs(Float64(fma(z, x, -4.0) / y)) tmp = 0.0 if (z <= -600000000.0) tmp = t_0; elseif (z <= 5.2) tmp = abs(Float64(Float64(-4.0 - x) / y)); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(N[(z * x + -4.0), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -600000000.0], t$95$0, If[LessEqual[z, 5.2], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \left|\frac{\mathsf{fma}\left(z, x, -4\right)}{y}\right|\\
\mathbf{if}\;z \leq -600000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 5.2:\\
\;\;\;\;\left|\frac{-4 - x}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -6e8 or 5.2000000000000002 < z Initial program 92.4%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
distribute-neg-frac2N/A
lift-/.f64N/A
frac-2negN/A
div-add-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
add-flipN/A
sub-negateN/A
lower--.f64N/A
metadata-evalN/A
lower-neg.f6495.9%
Applied rewrites95.9%
Taylor expanded in x around 0
Applied rewrites73.7%
lift-fabs.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
distribute-frac-neg2N/A
fabs-negN/A
lower-fabs.f64N/A
lower-/.f6473.7%
Applied rewrites73.7%
if -6e8 < z < 5.2000000000000002Initial program 92.4%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6492.0%
Applied rewrites92.0%
Applied rewrites95.9%
Taylor expanded in z around 0
lower-*.f64N/A
lower-+.f6470.0%
Applied rewrites70.0%
lift-*.f64N/A
lift-+.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
sub-flipN/A
lower--.f6470.0%
Applied rewrites70.0%
(FPCore (x y z)
:precision binary64
(if (<= z -3.4e+52)
(fabs (* (/ (- x) y) z))
(if (<= z 4.4e+49)
(fabs (/ (- -4.0 x) y))
(fabs (* (/ (- z) y) x)))))double code(double x, double y, double z) {
double tmp;
if (z <= -3.4e+52) {
tmp = fabs(((-x / y) * z));
} else if (z <= 4.4e+49) {
tmp = fabs(((-4.0 - x) / y));
} else {
tmp = fabs(((-z / y) * x));
}
return tmp;
}
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-3.4d+52)) then
tmp = abs(((-x / y) * z))
else if (z <= 4.4d+49) then
tmp = abs((((-4.0d0) - x) / y))
else
tmp = abs(((-z / y) * x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.4e+52) {
tmp = Math.abs(((-x / y) * z));
} else if (z <= 4.4e+49) {
tmp = Math.abs(((-4.0 - x) / y));
} else {
tmp = Math.abs(((-z / y) * x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.4e+52: tmp = math.fabs(((-x / y) * z)) elif z <= 4.4e+49: tmp = math.fabs(((-4.0 - x) / y)) else: tmp = math.fabs(((-z / y) * x)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.4e+52) tmp = abs(Float64(Float64(Float64(-x) / y) * z)); elseif (z <= 4.4e+49) tmp = abs(Float64(Float64(-4.0 - x) / y)); else tmp = abs(Float64(Float64(Float64(-z) / y) * x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.4e+52) tmp = abs(((-x / y) * z)); elseif (z <= 4.4e+49) tmp = abs(((-4.0 - x) / y)); else tmp = abs(((-z / y) * x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.4e+52], N[Abs[N[(N[((-x) / y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 4.4e+49], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[((-z) / y), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+52}:\\
\;\;\;\;\left|\frac{-x}{y} \cdot z\right|\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+49}:\\
\;\;\;\;\left|\frac{-4 - x}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-z}{y} \cdot x\right|\\
\end{array}
if z < -3.4e52Initial program 92.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.4%
Applied rewrites37.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6443.1%
Applied rewrites43.1%
if -3.4e52 < z < 4.4000000000000001e49Initial program 92.4%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6492.0%
Applied rewrites92.0%
Applied rewrites95.9%
Taylor expanded in z around 0
lower-*.f64N/A
lower-+.f6470.0%
Applied rewrites70.0%
lift-*.f64N/A
lift-+.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
sub-flipN/A
lower--.f6470.0%
Applied rewrites70.0%
if 4.4000000000000001e49 < z Initial program 92.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.4%
Applied rewrites37.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
mul-1-negN/A
distribute-lft-neg-outN/A
mult-flipN/A
lift-/.f64N/A
distribute-lft-neg-inN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6439.3%
Applied rewrites39.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (* (/ (- x) y) z))))
(if (<= z -3.4e+52)
t_0
(if (<= z 4.4e+49) (fabs (/ (- -4.0 x) y)) t_0))))double code(double x, double y, double z) {
double t_0 = fabs(((-x / y) * z));
double tmp;
if (z <= -3.4e+52) {
tmp = t_0;
} else if (z <= 4.4e+49) {
tmp = fabs(((-4.0 - x) / y));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = abs(((-x / y) * z))
if (z <= (-3.4d+52)) then
tmp = t_0
else if (z <= 4.4d+49) then
tmp = abs((((-4.0d0) - x) / y))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.abs(((-x / y) * z));
double tmp;
if (z <= -3.4e+52) {
tmp = t_0;
} else if (z <= 4.4e+49) {
tmp = Math.abs(((-4.0 - x) / y));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(((-x / y) * z)) tmp = 0 if z <= -3.4e+52: tmp = t_0 elif z <= 4.4e+49: tmp = math.fabs(((-4.0 - x) / y)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = abs(Float64(Float64(Float64(-x) / y) * z)) tmp = 0.0 if (z <= -3.4e+52) tmp = t_0; elseif (z <= 4.4e+49) tmp = abs(Float64(Float64(-4.0 - x) / y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs(((-x / y) * z)); tmp = 0.0; if (z <= -3.4e+52) tmp = t_0; elseif (z <= 4.4e+49) tmp = abs(((-4.0 - x) / y)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(N[((-x) / y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -3.4e+52], t$95$0, If[LessEqual[z, 4.4e+49], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \left|\frac{-x}{y} \cdot z\right|\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{+52}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+49}:\\
\;\;\;\;\left|\frac{-4 - x}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -3.4e52 or 4.4000000000000001e49 < z Initial program 92.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6437.4%
Applied rewrites37.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6443.1%
Applied rewrites43.1%
if -3.4e52 < z < 4.4000000000000001e49Initial program 92.4%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6492.0%
Applied rewrites92.0%
Applied rewrites95.9%
Taylor expanded in z around 0
lower-*.f64N/A
lower-+.f6470.0%
Applied rewrites70.0%
lift-*.f64N/A
lift-+.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
sub-flipN/A
lower--.f6470.0%
Applied rewrites70.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (/ (* x z) y))))
(if (<= z -3.4e+52)
t_0
(if (<= z 1.65e+133) (fabs (/ (- -4.0 x) y)) t_0))))double code(double x, double y, double z) {
double t_0 = fabs(((x * z) / y));
double tmp;
if (z <= -3.4e+52) {
tmp = t_0;
} else if (z <= 1.65e+133) {
tmp = fabs(((-4.0 - x) / y));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = abs(((x * z) / y))
if (z <= (-3.4d+52)) then
tmp = t_0
else if (z <= 1.65d+133) then
tmp = abs((((-4.0d0) - x) / y))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.abs(((x * z) / y));
double tmp;
if (z <= -3.4e+52) {
tmp = t_0;
} else if (z <= 1.65e+133) {
tmp = Math.abs(((-4.0 - x) / y));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs(((x * z) / y)) tmp = 0 if z <= -3.4e+52: tmp = t_0 elif z <= 1.65e+133: tmp = math.fabs(((-4.0 - x) / y)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = abs(Float64(Float64(x * z) / y)) tmp = 0.0 if (z <= -3.4e+52) tmp = t_0; elseif (z <= 1.65e+133) tmp = abs(Float64(Float64(-4.0 - x) / y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs(((x * z) / y)); tmp = 0.0; if (z <= -3.4e+52) tmp = t_0; elseif (z <= 1.65e+133) tmp = abs(((-4.0 - x) / y)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -3.4e+52], t$95$0, If[LessEqual[z, 1.65e+133], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \left|\frac{x \cdot z}{y}\right|\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{+52}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+133}:\\
\;\;\;\;\left|\frac{-4 - x}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -3.4e52 or 1.65e133 < z Initial program 92.4%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6492.0%
Applied rewrites92.0%
Applied rewrites95.9%
Taylor expanded in z around 0
lower-*.f64N/A
lower-+.f6470.0%
Applied rewrites70.0%
Taylor expanded in z around inf
lower-*.f6437.4%
Applied rewrites37.4%
if -3.4e52 < z < 1.65e133Initial program 92.4%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6492.0%
Applied rewrites92.0%
Applied rewrites95.9%
Taylor expanded in z around 0
lower-*.f64N/A
lower-+.f6470.0%
Applied rewrites70.0%
lift-*.f64N/A
lift-+.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
sub-flipN/A
lower--.f6470.0%
Applied rewrites70.0%
(FPCore (x y z) :precision binary64 (fabs (/ (- -4.0 x) y)))
double code(double x, double y, double z) {
return fabs(((-4.0 - x) / y));
}
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((-4.0d0) - x) / y))
end function
public static double code(double x, double y, double z) {
return Math.abs(((-4.0 - x) / y));
}
def code(x, y, z): return math.fabs(((-4.0 - x) / y))
function code(x, y, z) return abs(Float64(Float64(-4.0 - x) / y)) end
function tmp = code(x, y, z) tmp = abs(((-4.0 - x) / y)); end
code[x_, y_, z_] := N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]
\left|\frac{-4 - x}{y}\right|
Initial program 92.4%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6492.0%
Applied rewrites92.0%
Applied rewrites95.9%
Taylor expanded in z around 0
lower-*.f64N/A
lower-+.f6470.0%
Applied rewrites70.0%
lift-*.f64N/A
lift-+.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
sub-flipN/A
lower--.f6470.0%
Applied rewrites70.0%
(FPCore (x y z) :precision binary64 (fabs (/ -4.0 y)))
double code(double x, double y, double z) {
return fabs((-4.0 / y));
}
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs(((-4.0d0) / y))
end function
public static double code(double x, double y, double z) {
return Math.abs((-4.0 / y));
}
def code(x, y, z): return math.fabs((-4.0 / y))
function code(x, y, z) return abs(Float64(-4.0 / y)) end
function tmp = code(x, y, z) tmp = abs((-4.0 / y)); end
code[x_, y_, z_] := N[Abs[N[(-4.0 / y), $MachinePrecision]], $MachinePrecision]
\left|\frac{-4}{y}\right|
Initial program 92.4%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6492.0%
Applied rewrites92.0%
Applied rewrites95.9%
Taylor expanded in x around 0
lower-/.f6440.6%
Applied rewrites40.6%
herbie shell --seed 2025326
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))