
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y - z) / (((t - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
(FPCore (x y z t a) :precision binary64 (- x (/ a (/ (- -1.0 (- t z)) (- z y)))))
double code(double x, double y, double z, double t, double a) {
return x - (a / ((-1.0 - (t - z)) / (z - y)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - (a / (((-1.0d0) - (t - z)) / (z - y)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (a / ((-1.0 - (t - z)) / (z - y)));
}
def code(x, y, z, t, a): return x - (a / ((-1.0 - (t - z)) / (z - y)))
function code(x, y, z, t, a) return Float64(x - Float64(a / Float64(Float64(-1.0 - Float64(t - z)) / Float64(z - y)))) end
function tmp = code(x, y, z, t, a) tmp = x - (a / ((-1.0 - (t - z)) / (z - y))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(a / N[(N[(-1.0 - N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{a}{\frac{-1 - \left(t - z\right)}{z - y}}
\end{array}
Initial program 97.2%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.5
Applied rewrites99.5%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ (* y a) t))))
(if (<= t -6.5e+216)
(fma (/ z t) a x)
(if (<= t -3.8e+41) t_1 (if (<= t 58.0) (fma a (/ y (- z 1.0)) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - ((y * a) / t);
double tmp;
if (t <= -6.5e+216) {
tmp = fma((z / t), a, x);
} else if (t <= -3.8e+41) {
tmp = t_1;
} else if (t <= 58.0) {
tmp = fma(a, (y / (z - 1.0)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x - Float64(Float64(y * a) / t)) tmp = 0.0 if (t <= -6.5e+216) tmp = fma(Float64(z / t), a, x); elseif (t <= -3.8e+41) tmp = t_1; elseif (t <= 58.0) tmp = fma(a, Float64(y / Float64(z - 1.0)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.5e+216], N[(N[(z / t), $MachinePrecision] * a + x), $MachinePrecision], If[LessEqual[t, -3.8e+41], t$95$1, If[LessEqual[t, 58.0], N[(a * N[(y / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{y \cdot a}{t}\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{+216}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, a, x\right)\\
\mathbf{elif}\;t \leq -3.8 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 58:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{z - 1}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.50000000000000029e216Initial program 96.1%
Taylor expanded in y around 0
metadata-evalN/A
cancel-sign-sub-invN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f6490.3
Applied rewrites90.3%
Taylor expanded in t around inf
Applied rewrites82.9%
if -6.50000000000000029e216 < t < -3.8000000000000001e41 or 58 < t Initial program 98.3%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6480.8
Applied rewrites80.8%
Taylor expanded in y around inf
Applied rewrites80.8%
if -3.8000000000000001e41 < t < 58Initial program 96.5%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
distribute-neg-frac2N/A
div-invN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
clear-num-revN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6496.6
Applied rewrites96.6%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f64100.0
Applied rewrites100.0%
Taylor expanded in y around inf
Applied rewrites75.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -5e+44)
(fma (- a) (/ (- y z) t) x)
(if (<= t 8.2e+76)
(fma a (/ (- z y) (- 1.0 z)) x)
(fma (- y z) (/ a (- t)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5e+44) {
tmp = fma(-a, ((y - z) / t), x);
} else if (t <= 8.2e+76) {
tmp = fma(a, ((z - y) / (1.0 - z)), x);
} else {
tmp = fma((y - z), (a / -t), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5e+44) tmp = fma(Float64(-a), Float64(Float64(y - z) / t), x); elseif (t <= 8.2e+76) tmp = fma(a, Float64(Float64(z - y) / Float64(1.0 - z)), x); else tmp = fma(Float64(y - z), Float64(a / Float64(-t)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5e+44], N[((-a) * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 8.2e+76], N[(a * N[(N[(z - y), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(a / (-t)), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+44}:\\
\;\;\;\;\mathsf{fma}\left(-a, \frac{y - z}{t}, x\right)\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{+76}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z - y}{1 - z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{a}{-t}, x\right)\\
\end{array}
\end{array}
if t < -4.9999999999999996e44Initial program 96.6%
Taylor expanded in t around inf
associate-*r/N/A
+-commutativeN/A
mul-1-negN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f6488.4
Applied rewrites88.4%
if -4.9999999999999996e44 < t < 8.1999999999999997e76Initial program 96.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
distribute-neg-frac2N/A
div-invN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
clear-num-revN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6496.9
Applied rewrites96.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.3
Applied rewrites97.3%
if 8.1999999999999997e76 < t Initial program 98.7%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
distribute-neg-frac2N/A
div-invN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
clear-num-revN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6498.7
Applied rewrites98.7%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6490.8
Applied rewrites90.8%
Final simplification93.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ a z) x)))
(if (<= z -3.2e+85)
t_1
(if (<= z 128000.0) (fma a (/ y (- -1.0 t)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), (a / z), x);
double tmp;
if (z <= -3.2e+85) {
tmp = t_1;
} else if (z <= 128000.0) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(a / z), x) tmp = 0.0 if (z <= -3.2e+85) tmp = t_1; elseif (z <= 128000.0) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(a / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -3.2e+85], t$95$1, If[LessEqual[z, 128000.0], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{a}{z}, x\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 128000:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.20000000000000018e85 or 128000 < z Initial program 94.6%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
distribute-neg-frac2N/A
div-invN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
clear-num-revN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6494.7
Applied rewrites94.7%
Taylor expanded in z around inf
lower-/.f6485.2
Applied rewrites85.2%
if -3.20000000000000018e85 < z < 128000Initial program 99.2%
Taylor expanded in z around inf
lower--.f6445.3
Applied rewrites45.3%
Taylor expanded in x around 0
Applied rewrites4.7%
Taylor expanded in z around 0
sub-negN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6488.0
Applied rewrites88.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.4e+216) (- x a) (if (<= z 1950000000.0) (fma a (/ y (- -1.0 t)) x) (- (- x a) (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.4e+216) {
tmp = x - a;
} else if (z <= 1950000000.0) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = (x - a) - (a / z);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.4e+216) tmp = Float64(x - a); elseif (z <= 1950000000.0) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = Float64(Float64(x - a) - Float64(a / z)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.4e+216], N[(x - a), $MachinePrecision], If[LessEqual[z, 1950000000.0], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(x - a), $MachinePrecision] - N[(a / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+216}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1950000000:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - a\right) - \frac{a}{z}\\
\end{array}
\end{array}
if z < -1.39999999999999991e216Initial program 87.3%
Taylor expanded in z around inf
lower--.f6482.3
Applied rewrites82.3%
if -1.39999999999999991e216 < z < 1.95e9Initial program 98.9%
Taylor expanded in z around inf
lower--.f6447.9
Applied rewrites47.9%
Taylor expanded in x around 0
Applied rewrites5.5%
Taylor expanded in z around 0
sub-negN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6486.0
Applied rewrites86.0%
if 1.95e9 < z Initial program 95.8%
Taylor expanded in t around 0
associate-/l*N/A
cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in y around 0
Applied rewrites81.9%
Taylor expanded in z around inf
Applied rewrites81.9%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.2e+98) (fma a (/ y (- z 1.0)) x) (if (<= y 2.9e+163) (fma a (/ z (- 1.0 z)) x) (- x (/ (* y a) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.2e+98) {
tmp = fma(a, (y / (z - 1.0)), x);
} else if (y <= 2.9e+163) {
tmp = fma(a, (z / (1.0 - z)), x);
} else {
tmp = x - ((y * a) / t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.2e+98) tmp = fma(a, Float64(y / Float64(z - 1.0)), x); elseif (y <= 2.9e+163) tmp = fma(a, Float64(z / Float64(1.0 - z)), x); else tmp = Float64(x - Float64(Float64(y * a) / t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.2e+98], N[(a * N[(y / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 2.9e+163], N[(a * N[(z / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{z - 1}, x\right)\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+163}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{1 - z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot a}{t}\\
\end{array}
\end{array}
if y < -1.1999999999999999e98Initial program 94.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
distribute-neg-frac2N/A
div-invN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
clear-num-revN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6494.9
Applied rewrites94.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6468.6
Applied rewrites68.6%
Taylor expanded in y around inf
Applied rewrites65.1%
if -1.1999999999999999e98 < y < 2.89999999999999998e163Initial program 97.9%
Taylor expanded in t around 0
associate-/l*N/A
cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6485.6
Applied rewrites85.6%
Taylor expanded in y around 0
Applied rewrites82.4%
if 2.89999999999999998e163 < y Initial program 97.0%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6468.0
Applied rewrites68.0%
Taylor expanded in y around inf
Applied rewrites65.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.8e+14) (- x a) (if (<= z 15000.0) (fma (- a) (fma (- y 1.0) z y) x) (- (- x a) (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.8e+14) {
tmp = x - a;
} else if (z <= 15000.0) {
tmp = fma(-a, fma((y - 1.0), z, y), x);
} else {
tmp = (x - a) - (a / z);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.8e+14) tmp = Float64(x - a); elseif (z <= 15000.0) tmp = fma(Float64(-a), fma(Float64(y - 1.0), z, y), x); else tmp = Float64(Float64(x - a) - Float64(a / z)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.8e+14], N[(x - a), $MachinePrecision], If[LessEqual[z, 15000.0], N[((-a) * N[(N[(y - 1.0), $MachinePrecision] * z + y), $MachinePrecision] + x), $MachinePrecision], N[(N[(x - a), $MachinePrecision] - N[(a / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+14}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 15000:\\
\;\;\;\;\mathsf{fma}\left(-a, \mathsf{fma}\left(y - 1, z, y\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - a\right) - \frac{a}{z}\\
\end{array}
\end{array}
if z < -3.8e14Initial program 94.8%
Taylor expanded in z around inf
lower--.f6468.0
Applied rewrites68.0%
if -3.8e14 < z < 15000Initial program 99.1%
Taylor expanded in t around 0
associate-/l*N/A
cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6471.8
Applied rewrites71.8%
Taylor expanded in z around 0
Applied rewrites71.6%
if 15000 < z Initial program 95.8%
Taylor expanded in t around 0
associate-/l*N/A
cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in y around 0
Applied rewrites81.9%
Taylor expanded in z around inf
Applied rewrites81.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.5e+31) (- x a) (if (<= z 480000.0) (fma (- a) y x) (- (- x a) (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e+31) {
tmp = x - a;
} else if (z <= 480000.0) {
tmp = fma(-a, y, x);
} else {
tmp = (x - a) - (a / z);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e+31) tmp = Float64(x - a); elseif (z <= 480000.0) tmp = fma(Float64(-a), y, x); else tmp = Float64(Float64(x - a) - Float64(a / z)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e+31], N[(x - a), $MachinePrecision], If[LessEqual[z, 480000.0], N[((-a) * y + x), $MachinePrecision], N[(N[(x - a), $MachinePrecision] - N[(a / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+31}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 480000:\\
\;\;\;\;\mathsf{fma}\left(-a, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - a\right) - \frac{a}{z}\\
\end{array}
\end{array}
if z < -5.50000000000000002e31Initial program 94.3%
Taylor expanded in z around inf
lower--.f6466.8
Applied rewrites66.8%
if -5.50000000000000002e31 < z < 4.8e5Initial program 99.1%
Taylor expanded in t around 0
associate-/l*N/A
cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6473.0
Applied rewrites73.0%
Taylor expanded in z around 0
Applied rewrites67.2%
if 4.8e5 < z Initial program 95.8%
Taylor expanded in t around 0
associate-/l*N/A
cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6493.3
Applied rewrites93.3%
Taylor expanded in y around 0
Applied rewrites81.9%
Taylor expanded in z around inf
Applied rewrites81.9%
(FPCore (x y z t a) :precision binary64 (fma (- y z) (/ a (- -1.0 (- t z))) x))
double code(double x, double y, double z, double t, double a) {
return fma((y - z), (a / (-1.0 - (t - z))), x);
}
function code(x, y, z, t, a) return fma(Float64(y - z), Float64(a / Float64(-1.0 - Float64(t - z))), x) end
code[x_, y_, z_, t_, a_] := N[(N[(y - z), $MachinePrecision] * N[(a / N[(-1.0 - N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - z, \frac{a}{-1 - \left(t - z\right)}, x\right)
\end{array}
Initial program 97.2%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
distribute-neg-frac2N/A
div-invN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
clear-num-revN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6497.3
Applied rewrites97.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.5e+31) (- x a) (if (<= z 480000.0) (fma (- a) y x) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e+31) {
tmp = x - a;
} else if (z <= 480000.0) {
tmp = fma(-a, y, x);
} else {
tmp = x - a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e+31) tmp = Float64(x - a); elseif (z <= 480000.0) tmp = fma(Float64(-a), y, x); else tmp = Float64(x - a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e+31], N[(x - a), $MachinePrecision], If[LessEqual[z, 480000.0], N[((-a) * y + x), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+31}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 480000:\\
\;\;\;\;\mathsf{fma}\left(-a, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -5.50000000000000002e31 or 4.8e5 < z Initial program 95.1%
Taylor expanded in z around inf
lower--.f6474.9
Applied rewrites74.9%
if -5.50000000000000002e31 < z < 4.8e5Initial program 99.1%
Taylor expanded in t around 0
associate-/l*N/A
cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6473.0
Applied rewrites73.0%
Taylor expanded in z around 0
Applied rewrites67.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -7e-15) (- x a) (if (<= z 2000000000.0) (fma a z x) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7e-15) {
tmp = x - a;
} else if (z <= 2000000000.0) {
tmp = fma(a, z, x);
} else {
tmp = x - a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7e-15) tmp = Float64(x - a); elseif (z <= 2000000000.0) tmp = fma(a, z, x); else tmp = Float64(x - a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7e-15], N[(x - a), $MachinePrecision], If[LessEqual[z, 2000000000.0], N[(a * z + x), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-15}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 2000000000:\\
\;\;\;\;\mathsf{fma}\left(a, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -7.0000000000000001e-15 or 2e9 < z Initial program 95.5%
Taylor expanded in z around inf
lower--.f6475.2
Applied rewrites75.2%
if -7.0000000000000001e-15 < z < 2e9Initial program 99.1%
Taylor expanded in t around 0
associate-/l*N/A
cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6471.6
Applied rewrites71.6%
Taylor expanded in y around 0
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites61.5%
(FPCore (x y z t a) :precision binary64 (- x a))
double code(double x, double y, double z, double t, double a) {
return x - a;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - a
end function
public static double code(double x, double y, double z, double t, double a) {
return x - a;
}
def code(x, y, z, t, a): return x - a
function code(x, y, z, t, a) return Float64(x - a) end
function tmp = code(x, y, z, t, a) tmp = x - a; end
code[x_, y_, z_, t_, a_] := N[(x - a), $MachinePrecision]
\begin{array}{l}
\\
x - a
\end{array}
Initial program 97.2%
Taylor expanded in z around inf
lower--.f6459.4
Applied rewrites59.4%
(FPCore (x y z t a) :precision binary64 (- a))
double code(double x, double y, double z, double t, double a) {
return -a;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = -a
end function
public static double code(double x, double y, double z, double t, double a) {
return -a;
}
def code(x, y, z, t, a): return -a
function code(x, y, z, t, a) return Float64(-a) end
function tmp = code(x, y, z, t, a) tmp = -a; end
code[x_, y_, z_, t_, a_] := (-a)
\begin{array}{l}
\\
-a
\end{array}
Initial program 97.2%
Taylor expanded in z around inf
lower--.f6459.4
Applied rewrites59.4%
Taylor expanded in x around 0
Applied rewrites14.7%
(FPCore (x y z t a) :precision binary64 (- x (* (/ (- y z) (+ (- t z) 1.0)) a)))
double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - (((y - z) / ((t - z) + 1.0d0)) * a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
def code(x, y, z, t, a): return x - (((y - z) / ((t - z) + 1.0)) * a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(Float64(y - z) / Float64(Float64(t - z) + 1.0)) * a)) end
function tmp = code(x, y, z, t, a) tmp = x - (((y - z) / ((t - z) + 1.0)) * a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(N[(y - z), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\left(t - z\right) + 1} \cdot a
\end{array}
herbie shell --seed 2024298
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (- x (* (/ (- y z) (+ (- t z) 1)) a)))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))