
(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 11 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 (fma (/ (- y z) (+ -1.0 (- z t))) a x))
double code(double x, double y, double z, double t, double a) {
return fma(((y - z) / (-1.0 + (z - t))), a, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(y - z) / Float64(-1.0 + Float64(z - t))), a, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(y - z), $MachinePrecision] / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y - z}{-1 + \left(z - t\right)}, a, x\right)
\end{array}
Initial program 96.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6499.9
Applied rewrites99.9%
Final simplification99.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* a (/ y z))) (t_2 (/ (- y z) (/ (+ (- t z) 1.0) a)))) (if (<= t_2 -2e+294) t_1 (if (<= t_2 5e+276) (- x a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * (y / z);
double t_2 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_2 <= -2e+294) {
tmp = t_1;
} else if (t_2 <= 5e+276) {
tmp = x - a;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a * (y / z)
t_2 = (y - z) / (((t - z) + 1.0d0) / a)
if (t_2 <= (-2d+294)) then
tmp = t_1
else if (t_2 <= 5d+276) then
tmp = x - a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * (y / z);
double t_2 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_2 <= -2e+294) {
tmp = t_1;
} else if (t_2 <= 5e+276) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * (y / z) t_2 = (y - z) / (((t - z) + 1.0) / a) tmp = 0 if t_2 <= -2e+294: tmp = t_1 elif t_2 <= 5e+276: tmp = x - a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * Float64(y / z)) t_2 = Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a)) tmp = 0.0 if (t_2 <= -2e+294) tmp = t_1; elseif (t_2 <= 5e+276) tmp = Float64(x - a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * (y / z); t_2 = (y - z) / (((t - z) + 1.0) / a); tmp = 0.0; if (t_2 <= -2e+294) tmp = t_1; elseif (t_2 <= 5e+276) tmp = x - a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+294], t$95$1, If[LessEqual[t$95$2, 5e+276], N[(x - a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \frac{y}{z}\\
t_2 := \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+294}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -2.00000000000000013e294 or 5.00000000000000001e276 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) Initial program 99.9%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f64100.0
Applied rewrites100.0%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
sub-negN/A
lower-+.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f64100.0
Applied rewrites100.0%
Taylor expanded in z around inf
Applied rewrites70.6%
if -2.00000000000000013e294 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 5.00000000000000001e276Initial program 96.5%
Taylor expanded in z around inf
lower--.f6463.1
Applied rewrites63.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ a (- t)) x)))
(if (<= t -8e+17)
t_1
(if (<= t 5.5e+26) (fma (/ (- y z) (+ z -1.0)) a x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), (a / -t), x);
double tmp;
if (t <= -8e+17) {
tmp = t_1;
} else if (t <= 5.5e+26) {
tmp = fma(((y - z) / (z + -1.0)), a, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(a / Float64(-t)), x) tmp = 0.0 if (t <= -8e+17) tmp = t_1; elseif (t <= 5.5e+26) tmp = fma(Float64(Float64(y - z) / Float64(z + -1.0)), a, 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 / (-t)), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -8e+17], t$95$1, If[LessEqual[t, 5.5e+26], N[(N[(N[(y - z), $MachinePrecision] / N[(z + -1.0), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{a}{-t}, x\right)\\
\mathbf{if}\;t \leq -8 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+26}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{z + -1}, a, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -8e17 or 5.4999999999999997e26 < t Initial program 96.9%
Taylor expanded in t around inf
mul-1-negN/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower--.f64N/A
lower-neg.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
if -8e17 < t < 5.4999999999999997e26Initial program 96.6%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f64100.0
Applied rewrites100.0%
Taylor expanded in t around 0
sub-negN/A
metadata-evalN/A
lower-+.f6499.3
Applied rewrites99.3%
Final simplification93.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a (/ z (+ t (- 1.0 z))) x)))
(if (<= z -3.6e+14)
t_1
(if (<= z 7.5e-37) (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(a, (z / (t + (1.0 - z))), x);
double tmp;
if (z <= -3.6e+14) {
tmp = t_1;
} else if (z <= 7.5e-37) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, Float64(z / Float64(t + Float64(1.0 - z))), x) tmp = 0.0 if (z <= -3.6e+14) tmp = t_1; elseif (z <= 7.5e-37) 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[(a * N[(z / N[(t + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -3.6e+14], t$95$1, If[LessEqual[z, 7.5e-37], 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(a, \frac{z}{t + \left(1 - z\right)}, x\right)\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-37}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.6e14 or 7.5000000000000004e-37 < z Initial program 94.8%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
lower--.f6488.1
Applied rewrites88.1%
if -3.6e14 < z < 7.5000000000000004e-37Initial program 99.0%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-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.9
Applied rewrites96.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.1e+18) (fma (/ a z) (- y z) x) (if (<= z 1.8e+94) (fma a (/ y (- -1.0 t)) x) (fma x (/ a (- x)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e+18) {
tmp = fma((a / z), (y - z), x);
} else if (z <= 1.8e+94) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = fma(x, (a / -x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.1e+18) tmp = fma(Float64(a / z), Float64(y - z), x); elseif (z <= 1.8e+94) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = fma(x, Float64(a / Float64(-x)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e+18], N[(N[(a / z), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1.8e+94], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x * N[(a / (-x)), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a}{z}, y - z, x\right)\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{a}{-x}, x\right)\\
\end{array}
\end{array}
if z < -3.1e18Initial program 96.8%
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 rewrites96.9%
Taylor expanded in z around inf
lower-/.f6487.2
Applied rewrites87.2%
if -3.1e18 < z < 1.79999999999999996e94Initial program 99.2%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-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--.f6490.7
Applied rewrites90.7%
if 1.79999999999999996e94 < z Initial program 89.0%
Taylor expanded in z around inf
lower--.f6481.1
Applied rewrites81.1%
Taylor expanded in x around inf
Applied rewrites83.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.9e+18) (- x a) (if (<= z 1.8e+94) (fma a (/ y (- -1.0 t)) x) (fma x (/ a (- x)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.9e+18) {
tmp = x - a;
} else if (z <= 1.8e+94) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = fma(x, (a / -x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.9e+18) tmp = Float64(x - a); elseif (z <= 1.8e+94) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = fma(x, Float64(a / Float64(-x)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.9e+18], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.8e+94], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x * N[(a / (-x)), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+18}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{a}{-x}, x\right)\\
\end{array}
\end{array}
if z < -3.9e18Initial program 96.8%
Taylor expanded in z around inf
lower--.f6481.0
Applied rewrites81.0%
if -3.9e18 < z < 1.79999999999999996e94Initial program 99.2%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-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--.f6490.7
Applied rewrites90.7%
if 1.79999999999999996e94 < z Initial program 89.0%
Taylor expanded in z around inf
lower--.f6481.1
Applied rewrites81.1%
Taylor expanded in x around inf
Applied rewrites83.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.6e-11) (- x a) (if (<= z 1.5e+94) (- x (/ (* y a) t)) (fma x (/ a (- x)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.6e-11) {
tmp = x - a;
} else if (z <= 1.5e+94) {
tmp = x - ((y * a) / t);
} else {
tmp = fma(x, (a / -x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.6e-11) tmp = Float64(x - a); elseif (z <= 1.5e+94) tmp = Float64(x - Float64(Float64(y * a) / t)); else tmp = fma(x, Float64(a / Float64(-x)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.6e-11], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.5e+94], N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x * N[(a / (-x)), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{-11}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+94}:\\
\;\;\;\;x - \frac{y \cdot a}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{a}{-x}, x\right)\\
\end{array}
\end{array}
if z < -5.6e-11Initial program 97.1%
Taylor expanded in z around inf
lower--.f6477.3
Applied rewrites77.3%
if -5.6e-11 < z < 1.5e94Initial program 99.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f6464.2
Applied rewrites64.2%
Taylor expanded in y around inf
Applied rewrites64.3%
if 1.5e94 < z Initial program 89.0%
Taylor expanded in z around inf
lower--.f6481.1
Applied rewrites81.1%
Taylor expanded in x around inf
Applied rewrites83.1%
Final simplification71.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma a (/ z t) x))) (if (<= t -2.65e+180) t_1 (if (<= t 5.5e+26) (- x a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, (z / t), x);
double tmp;
if (t <= -2.65e+180) {
tmp = t_1;
} else if (t <= 5.5e+26) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, Float64(z / t), x) tmp = 0.0 if (t <= -2.65e+180) tmp = t_1; elseif (t <= 5.5e+26) tmp = Float64(x - a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[(z / t), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -2.65e+180], t$95$1, If[LessEqual[t, 5.5e+26], N[(x - a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, \frac{z}{t}, x\right)\\
\mathbf{if}\;t \leq -2.65 \cdot 10^{+180}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+26}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.6500000000000002e180 or 5.4999999999999997e26 < t Initial program 97.0%
Taylor expanded in t around inf
mul-1-negN/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower--.f64N/A
lower-neg.f64N/A
lower-/.f6490.3
Applied rewrites90.3%
Taylor expanded in y around 0
Applied rewrites77.0%
if -2.6500000000000002e180 < t < 5.4999999999999997e26Initial program 96.6%
Taylor expanded in z around inf
lower--.f6464.8
Applied rewrites64.8%
(FPCore (x y z t a) :precision binary64 (fma (/ a (+ -1.0 (- z t))) (- y z) x))
double code(double x, double y, double z, double t, double a) {
return fma((a / (-1.0 + (z - t))), (y - z), x);
}
function code(x, y, z, t, a) return fma(Float64(a / Float64(-1.0 + Float64(z - t))), Float64(y - z), x) end
code[x_, y_, z_, t_, a_] := N[(N[(a / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{a}{-1 + \left(z - t\right)}, y - z, x\right)
\end{array}
Initial program 96.8%
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 rewrites97.0%
Final simplification97.0%
(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 96.8%
Taylor expanded in z around inf
lower--.f6459.2
Applied rewrites59.2%
(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 96.8%
Taylor expanded in z around inf
lower--.f6459.2
Applied rewrites59.2%
Taylor expanded in x around 0
Applied rewrites15.6%
(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 2024220
(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))))