
(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 12 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 (/ (/ (- z y) (- 1.0 (- z t))) (/ -1.0 a))))
double code(double x, double y, double z, double t, double a) {
return x - (((z - y) / (1.0 - (z - t))) / (-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 - (((z - y) / (1.0d0 - (z - t))) / ((-1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (((z - y) / (1.0 - (z - t))) / (-1.0 / a));
}
def code(x, y, z, t, a): return x - (((z - y) / (1.0 - (z - t))) / (-1.0 / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(Float64(z - y) / Float64(1.0 - Float64(z - t))) / Float64(-1.0 / a))) end
function tmp = code(x, y, z, t, a) tmp = x - (((z - y) / (1.0 - (z - t))) / (-1.0 / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(N[(z - y), $MachinePrecision] / N[(1.0 - N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{\frac{z - y}{1 - \left(z - t\right)}}{\frac{-1}{a}}
\end{array}
Initial program 98.4%
lift-/.f64N/A
lift-/.f64N/A
div-invN/A
associate-/r*N/A
frac-2negN/A
distribute-frac-neg2N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6499.9
Applied rewrites99.9%
Final simplification99.9%
(FPCore (x y z t a) :precision binary64 (if (<= (/ (- z y) (/ (- -1.0 (- t z)) a)) -5e+255) (* (- a) y) (- x a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((z - y) / ((-1.0 - (t - z)) / a)) <= -5e+255) {
tmp = -a * y;
} else {
tmp = x - a;
}
return tmp;
}
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
real(8) :: tmp
if (((z - y) / (((-1.0d0) - (t - z)) / a)) <= (-5d+255)) then
tmp = -a * y
else
tmp = x - a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((z - y) / ((-1.0 - (t - z)) / a)) <= -5e+255) {
tmp = -a * y;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((z - y) / ((-1.0 - (t - z)) / a)) <= -5e+255: tmp = -a * y else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(z - y) / Float64(Float64(-1.0 - Float64(t - z)) / a)) <= -5e+255) tmp = Float64(Float64(-a) * y); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((z - y) / ((-1.0 - (t - z)) / a)) <= -5e+255) tmp = -a * y; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(z - y), $MachinePrecision] / N[(N[(-1.0 - N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], -5e+255], N[((-a) * y), $MachinePrecision], N[(x - a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z - y}{\frac{-1 - \left(t - z\right)}{a}} \leq -5 \cdot 10^{+255}:\\
\;\;\;\;\left(-a\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -5.0000000000000002e255Initial program 99.8%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6472.2
Applied rewrites72.2%
Taylor expanded in x around 0
Applied rewrites72.0%
Taylor expanded in t around 0
Applied rewrites55.0%
if -5.0000000000000002e255 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) Initial program 98.3%
Taylor expanded in z around inf
lower--.f6466.7
Applied rewrites66.7%
Final simplification65.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.36e+82)
(fma (- y z) (/ (- a) t) x)
(if (<= t 5.4e+53)
(- x (* (/ a (- 1.0 z)) (- y z)))
(fma (/ y (- -1.0 t)) a x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.36e+82) {
tmp = fma((y - z), (-a / t), x);
} else if (t <= 5.4e+53) {
tmp = x - ((a / (1.0 - z)) * (y - z));
} else {
tmp = fma((y / (-1.0 - t)), a, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.36e+82) tmp = fma(Float64(y - z), Float64(Float64(-a) / t), x); elseif (t <= 5.4e+53) tmp = Float64(x - Float64(Float64(a / Float64(1.0 - z)) * Float64(y - z))); else tmp = fma(Float64(y / Float64(-1.0 - t)), a, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.36e+82], N[(N[(y - z), $MachinePrecision] * N[((-a) / t), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 5.4e+53], N[(x - N[(N[(a / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.36 \cdot 10^{+82}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{-a}{t}, x\right)\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{+53}:\\
\;\;\;\;x - \frac{a}{1 - z} \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{-1 - t}, a, x\right)\\
\end{array}
\end{array}
if t < -1.36000000000000001e82Initial program 99.8%
Taylor expanded in t around inf
mul-1-negN/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-neg.f6493.9
Applied rewrites93.9%
Applied rewrites93.9%
if -1.36000000000000001e82 < t < 5.40000000000000039e53Initial program 98.1%
Taylor expanded in t around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6495.7
Applied rewrites95.7%
if 5.40000000000000039e53 < t Initial program 98.2%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6493.1
Applied rewrites93.1%
Final simplification94.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.1e+49)
(- x (* (/ (- a) z) (- y z)))
(if (<= z 4.5e+43)
(fma (/ y (- -1.0 t)) a x)
(fma (/ z (- (- t -1.0) z)) a x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e+49) {
tmp = x - ((-a / z) * (y - z));
} else if (z <= 4.5e+43) {
tmp = fma((y / (-1.0 - t)), a, x);
} else {
tmp = fma((z / ((t - -1.0) - z)), a, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.1e+49) tmp = Float64(x - Float64(Float64(Float64(-a) / z) * Float64(y - z))); elseif (z <= 4.5e+43) tmp = fma(Float64(y / Float64(-1.0 - t)), a, x); else tmp = fma(Float64(z / Float64(Float64(t - -1.0) - z)), a, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e+49], N[(x - N[(N[((-a) / z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e+43], N[(N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision], N[(N[(z / N[(N[(t - -1.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+49}:\\
\;\;\;\;x - \frac{-a}{z} \cdot \left(y - z\right)\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+43}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{-1 - t}, a, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{\left(t - -1\right) - z}, a, x\right)\\
\end{array}
\end{array}
if z < -3.09999999999999992e49Initial program 99.9%
Taylor expanded in t around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6496.3
Applied rewrites96.3%
Taylor expanded in z around inf
Applied rewrites96.3%
if -3.09999999999999992e49 < z < 4.5e43Initial program 99.2%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6495.2
Applied rewrites95.2%
if 4.5e43 < z Initial program 94.9%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f6491.1
Applied rewrites91.1%
Final simplification94.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ z (- (- t -1.0) z)) a x)))
(if (<= z -1.55e+18)
t_1
(if (<= z 4.5e+43) (fma (/ y (- -1.0 t)) a x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((z / ((t - -1.0) - z)), a, x);
double tmp;
if (z <= -1.55e+18) {
tmp = t_1;
} else if (z <= 4.5e+43) {
tmp = fma((y / (-1.0 - t)), a, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(z / Float64(Float64(t - -1.0) - z)), a, x) tmp = 0.0 if (z <= -1.55e+18) tmp = t_1; elseif (z <= 4.5e+43) tmp = fma(Float64(y / Float64(-1.0 - t)), a, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z / N[(N[(t - -1.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]}, If[LessEqual[z, -1.55e+18], t$95$1, If[LessEqual[z, 4.5e+43], N[(N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{z}{\left(t - -1\right) - z}, a, x\right)\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+43}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{-1 - t}, a, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.55e18 or 4.5e43 < z Initial program 97.6%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f6491.0
Applied rewrites91.0%
if -1.55e18 < z < 4.5e43Initial program 99.1%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6496.4
Applied rewrites96.4%
Final simplification93.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.3e+18) (- x a) (if (<= z 1.65e+83) (fma (/ y (- -1.0 t)) a x) (fma (/ z (- 1.0 z)) a x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.3e+18) {
tmp = x - a;
} else if (z <= 1.65e+83) {
tmp = fma((y / (-1.0 - t)), a, x);
} else {
tmp = fma((z / (1.0 - z)), a, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.3e+18) tmp = Float64(x - a); elseif (z <= 1.65e+83) tmp = fma(Float64(y / Float64(-1.0 - t)), a, x); else tmp = fma(Float64(z / Float64(1.0 - z)), a, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.3e+18], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.65e+83], N[(N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision], N[(N[(z / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+18}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+83}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{-1 - t}, a, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{1 - z}, a, x\right)\\
\end{array}
\end{array}
if z < -3.3e18Initial program 99.9%
Taylor expanded in z around inf
lower--.f6484.7
Applied rewrites84.7%
if -3.3e18 < z < 1.64999999999999992e83Initial program 99.2%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6494.7
Applied rewrites94.7%
if 1.64999999999999992e83 < z Initial program 93.4%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f6493.3
Applied rewrites93.3%
Taylor expanded in t around 0
Applied rewrites86.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.3e+18) (- x a) (if (<= z 1.65e+83) (fma (/ y (- -1.0 t)) a x) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.3e+18) {
tmp = x - a;
} else if (z <= 1.65e+83) {
tmp = fma((y / (-1.0 - t)), a, x);
} else {
tmp = x - a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.3e+18) tmp = Float64(x - a); elseif (z <= 1.65e+83) tmp = fma(Float64(y / Float64(-1.0 - t)), a, x); else tmp = Float64(x - a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.3e+18], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.65e+83], N[(N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+18}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+83}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{-1 - t}, a, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -3.3e18 or 1.64999999999999992e83 < z Initial program 97.3%
Taylor expanded in z around inf
lower--.f6485.6
Applied rewrites85.6%
if -3.3e18 < z < 1.64999999999999992e83Initial program 99.2%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6494.7
Applied rewrites94.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ y t) (- a) x))) (if (<= t -1.0) t_1 (if (<= t 4.5e+16) (fma y (fma a t (- a)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y / t), -a, x);
double tmp;
if (t <= -1.0) {
tmp = t_1;
} else if (t <= 4.5e+16) {
tmp = fma(y, fma(a, t, -a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y / t), Float64(-a), x) tmp = 0.0 if (t <= -1.0) tmp = t_1; elseif (t <= 4.5e+16) tmp = fma(y, fma(a, t, Float64(-a)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / t), $MachinePrecision] * (-a) + x), $MachinePrecision]}, If[LessEqual[t, -1.0], t$95$1, If[LessEqual[t, 4.5e+16], N[(y * N[(a * t + (-a)), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{t}, -a, x\right)\\
\mathbf{if}\;t \leq -1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+16}:\\
\;\;\;\;\mathsf{fma}\left(y, \mathsf{fma}\left(a, t, -a\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1 or 4.5e16 < t Initial program 99.1%
Taylor expanded in t around inf
mul-1-negN/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-neg.f6486.6
Applied rewrites86.6%
Taylor expanded in y around inf
Applied rewrites85.6%
if -1 < t < 4.5e16Initial program 97.7%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6475.8
Applied rewrites75.8%
Taylor expanded in t around 0
Applied rewrites75.9%
(FPCore (x y z t a) :precision binary64 (fma (/ a (- -1.0 (- t z))) (- y z) x))
double code(double x, double y, double z, double t, double a) {
return fma((a / (-1.0 - (t - z))), (y - z), x);
}
function code(x, y, z, t, a) return fma(Float64(a / Float64(-1.0 - Float64(t - z))), Float64(y - z), x) end
code[x_, y_, z_, t_, a_] := N[(N[(a / N[(-1.0 - N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{a}{-1 - \left(t - z\right)}, y - z, x\right)
\end{array}
Initial program 98.4%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
distribute-lft-neg-inN/A
clear-numN/A
lift-/.f64N/A
distribute-frac-neg2N/A
lower-fma.f64N/A
Applied rewrites98.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.06e+18) (- x a) (if (<= z 9e+29) (fma (- y) a x) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.06e+18) {
tmp = x - a;
} else if (z <= 9e+29) {
tmp = fma(-y, a, x);
} else {
tmp = x - a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.06e+18) tmp = Float64(x - a); elseif (z <= 9e+29) tmp = fma(Float64(-y), a, x); else tmp = Float64(x - a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.06e+18], N[(x - a), $MachinePrecision], If[LessEqual[z, 9e+29], N[((-y) * a + x), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.06 \cdot 10^{+18}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+29}:\\
\;\;\;\;\mathsf{fma}\left(-y, a, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.06e18 or 9.0000000000000005e29 < z Initial program 97.6%
Taylor expanded in z around inf
lower--.f6483.3
Applied rewrites83.3%
if -1.06e18 < z < 9.0000000000000005e29Initial program 99.1%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6496.3
Applied rewrites96.3%
Taylor expanded in t around 0
Applied rewrites71.8%
(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 98.4%
Taylor expanded in z around inf
lower--.f6463.3
Applied rewrites63.3%
(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 98.4%
Taylor expanded in z around inf
lower--.f6463.3
Applied rewrites63.3%
Taylor expanded in x around 0
Applied rewrites14.3%
(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 2024296
(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))))