
(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 14 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.7%
sub-negN/A
+-commutativeN/A
associate-/r/N/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f64N/A
--lowering--.f6499.9
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- y z) (/ (+ (- t z) 1.0) a)))) (if (<= t_1 -5e+91) (- a) (if (<= t_1 5e+194) x (- a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_1 <= -5e+91) {
tmp = -a;
} else if (t_1 <= 5e+194) {
tmp = x;
} else {
tmp = -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) :: t_1
real(8) :: tmp
t_1 = (y - z) / (((t - z) + 1.0d0) / a)
if (t_1 <= (-5d+91)) then
tmp = -a
else if (t_1 <= 5d+194) then
tmp = x
else
tmp = -a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) / (((t - z) + 1.0) / a);
double tmp;
if (t_1 <= -5e+91) {
tmp = -a;
} else if (t_1 <= 5e+194) {
tmp = x;
} else {
tmp = -a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - z) / (((t - z) + 1.0) / a) tmp = 0 if t_1 <= -5e+91: tmp = -a elif t_1 <= 5e+194: tmp = x else: tmp = -a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a)) tmp = 0.0 if (t_1 <= -5e+91) tmp = Float64(-a); elseif (t_1 <= 5e+194) tmp = x; else tmp = Float64(-a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - z) / (((t - z) + 1.0) / a); tmp = 0.0; if (t_1 <= -5e+91) tmp = -a; elseif (t_1 <= 5e+194) tmp = x; else tmp = -a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+91], (-a), If[LessEqual[t$95$1, 5e+194], x, (-a)]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+91}:\\
\;\;\;\;-a\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+194}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-a\\
\end{array}
\end{array}
if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -5.0000000000000002e91 or 4.99999999999999989e194 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) Initial program 99.6%
Taylor expanded in z around inf
Simplified39.5%
Taylor expanded in x around 0
mul-1-negN/A
neg-lowering-neg.f6431.9
Simplified31.9%
if -5.0000000000000002e91 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 4.99999999999999989e194Initial program 95.5%
Taylor expanded in x around inf
Simplified67.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.3e+36)
(fma (/ (- y z) z) a x)
(if (<= z 1.2)
(fma (/ a (- -1.0 t)) (- y z) x)
(fma a (/ z (+ t (- 1.0 z))) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e+36) {
tmp = fma(((y - z) / z), a, x);
} else if (z <= 1.2) {
tmp = fma((a / (-1.0 - t)), (y - z), x);
} else {
tmp = fma(a, (z / (t + (1.0 - z))), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.3e+36) tmp = fma(Float64(Float64(y - z) / z), a, x); elseif (z <= 1.2) tmp = fma(Float64(a / Float64(-1.0 - t)), Float64(y - z), x); else tmp = fma(a, Float64(z / Float64(t + Float64(1.0 - z))), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.3e+36], N[(N[(N[(y - z), $MachinePrecision] / z), $MachinePrecision] * a + x), $MachinePrecision], If[LessEqual[z, 1.2], N[(N[(a / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision], N[(a * N[(z / N[(t + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+36}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{z}, a, x\right)\\
\mathbf{elif}\;z \leq 1.2:\\
\;\;\;\;\mathsf{fma}\left(\frac{a}{-1 - t}, y - z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{t + \left(1 - z\right)}, x\right)\\
\end{array}
\end{array}
if z < -1.3000000000000001e36Initial program 96.1%
sub-negN/A
+-commutativeN/A
associate-/r/N/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f64N/A
--lowering--.f6499.9
Applied egg-rr99.9%
Taylor expanded in z around inf
Simplified87.4%
if -1.3000000000000001e36 < z < 1.19999999999999996Initial program 99.1%
sub-negN/A
+-commutativeN/A
clear-numN/A
associate-/r/N/A
clear-numN/A
distribute-lft-neg-inN/A
clear-numN/A
distribute-frac-neg2N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr99.3%
Taylor expanded in z around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6497.9
Simplified97.9%
if 1.19999999999999996 < z Initial program 92.4%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6487.4
Simplified87.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.1e+32)
(fma a (/ y (- -1.0 t)) x)
(if (<= t 3.6e+144)
(fma (- y z) (/ a (+ z -1.0)) x)
(fma (/ (- z y) t) a x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.1e+32) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else if (t <= 3.6e+144) {
tmp = fma((y - z), (a / (z + -1.0)), x);
} else {
tmp = fma(((z - y) / t), a, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.1e+32) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); elseif (t <= 3.6e+144) tmp = fma(Float64(y - z), Float64(a / Float64(z + -1.0)), x); else tmp = fma(Float64(Float64(z - y) / t), a, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.1e+32], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 3.6e+144], N[(N[(y - z), $MachinePrecision] * N[(a / N[(z + -1.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision] * a + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{+32}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{+144}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{a}{z + -1}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - y}{t}, a, x\right)\\
\end{array}
\end{array}
if t < -3.09999999999999993e32Initial program 93.3%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6485.6
Simplified85.6%
if -3.09999999999999993e32 < t < 3.5999999999999997e144Initial program 97.5%
sub-negN/A
+-commutativeN/A
associate-/r/N/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f64N/A
--lowering--.f6499.9
Applied egg-rr99.9%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
remove-double-negN/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
mul-1-negN/A
metadata-evalN/A
+-commutativeN/A
sub-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified94.9%
if 3.5999999999999997e144 < t Initial program 99.8%
sub-negN/A
+-commutativeN/A
associate-/r/N/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f64N/A
--lowering--.f6499.7
Applied egg-rr99.7%
Taylor expanded in t around inf
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6489.7
Simplified89.7%
Final simplification91.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.85e+38)
(fma (/ (- y z) z) a x)
(if (<= z 7.2e-75)
(fma a (/ y (- -1.0 t)) x)
(fma a (/ z (+ t (- 1.0 z))) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e+38) {
tmp = fma(((y - z) / z), a, x);
} else if (z <= 7.2e-75) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = fma(a, (z / (t + (1.0 - z))), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.85e+38) tmp = fma(Float64(Float64(y - z) / z), a, x); elseif (z <= 7.2e-75) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = fma(a, Float64(z / Float64(t + Float64(1.0 - z))), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.85e+38], N[(N[(N[(y - z), $MachinePrecision] / z), $MachinePrecision] * a + x), $MachinePrecision], If[LessEqual[z, 7.2e-75], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(a * N[(z / N[(t + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{z}, a, x\right)\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-75}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{t + \left(1 - z\right)}, x\right)\\
\end{array}
\end{array}
if z < -1.8500000000000001e38Initial program 96.1%
sub-negN/A
+-commutativeN/A
associate-/r/N/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f64N/A
--lowering--.f6499.9
Applied egg-rr99.9%
Taylor expanded in z around inf
Simplified87.4%
if -1.8500000000000001e38 < z < 7.2000000000000001e-75Initial program 99.1%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6493.8
Simplified93.8%
if 7.2000000000000001e-75 < 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
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6487.9
Simplified87.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.4e+35) (fma (/ (- y z) z) a x) (if (<= z 1.0) (fma a (/ y (- -1.0 t)) x) (fma a (/ z (- t z)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.4e+35) {
tmp = fma(((y - z) / z), a, x);
} else if (z <= 1.0) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = fma(a, (z / (t - z)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.4e+35) tmp = fma(Float64(Float64(y - z) / z), a, x); elseif (z <= 1.0) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = fma(a, Float64(z / Float64(t - z)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.4e+35], N[(N[(N[(y - z), $MachinePrecision] / z), $MachinePrecision] * a + x), $MachinePrecision], If[LessEqual[z, 1.0], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(a * N[(z / N[(t - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{z}, a, x\right)\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{t - z}, x\right)\\
\end{array}
\end{array}
if z < -5.40000000000000005e35Initial program 96.1%
sub-negN/A
+-commutativeN/A
associate-/r/N/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f64N/A
--lowering--.f6499.9
Applied egg-rr99.9%
Taylor expanded in z around inf
Simplified87.4%
if -5.40000000000000005e35 < z < 1Initial program 99.1%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6493.6
Simplified93.6%
if 1 < z Initial program 92.4%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f6487.4
Simplified87.4%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6486.8
Simplified86.8%
Final simplification90.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- y z) z) a x)))
(if (<= z -1.6e+37)
t_1
(if (<= z 98000.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) / z), a, x);
double tmp;
if (z <= -1.6e+37) {
tmp = t_1;
} else if (z <= 98000.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(Float64(y - z) / z), a, x) tmp = 0.0 if (z <= -1.6e+37) tmp = t_1; elseif (z <= 98000.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[(N[(y - z), $MachinePrecision] / z), $MachinePrecision] * a + x), $MachinePrecision]}, If[LessEqual[z, -1.6e+37], t$95$1, If[LessEqual[z, 98000.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(\frac{y - z}{z}, a, x\right)\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 98000:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.60000000000000007e37 or 98000 < z Initial program 94.0%
sub-negN/A
+-commutativeN/A
associate-/r/N/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f64N/A
--lowering--.f6499.9
Applied egg-rr99.9%
Taylor expanded in z around inf
Simplified86.0%
if -1.60000000000000007e37 < z < 98000Initial program 99.1%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6493.6
Simplified93.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.8e+39) (- x a) (if (<= z 1e+94) (fma a (/ y (- -1.0 t)) x) (fma a (/ z (- 1.0 z)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e+39) {
tmp = x - a;
} else if (z <= 1e+94) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = fma(a, (z / (1.0 - z)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.8e+39) tmp = Float64(x - a); elseif (z <= 1e+94) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = fma(a, Float64(z / Float64(1.0 - z)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.8e+39], N[(x - a), $MachinePrecision], If[LessEqual[z, 1e+94], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(a * N[(z / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+39}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{1 - z}, x\right)\\
\end{array}
\end{array}
if z < -2.80000000000000001e39Initial program 96.1%
Taylor expanded in z around inf
Simplified73.8%
if -2.80000000000000001e39 < z < 1e94Initial program 99.2%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6489.2
Simplified89.2%
if 1e94 < z Initial program 89.5%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6463.6
Simplified63.6%
Taylor expanded in y around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6484.5
Simplified84.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.1e+36) (- x a) (if (<= z 1.35e+94) (fma a (/ y (- -1.0 t)) x) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.1e+36) {
tmp = x - a;
} else if (z <= 1.35e+94) {
tmp = fma(a, (y / (-1.0 - t)), x);
} else {
tmp = x - a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.1e+36) tmp = Float64(x - a); elseif (z <= 1.35e+94) tmp = fma(a, Float64(y / Float64(-1.0 - t)), x); else tmp = Float64(x - a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.1e+36], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.35e+94], N[(a * N[(y / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+36}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -2.10000000000000004e36 or 1.3500000000000001e94 < z Initial program 93.0%
Taylor expanded in z around inf
Simplified78.9%
if -2.10000000000000004e36 < z < 1.3500000000000001e94Initial program 99.2%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6489.2
Simplified89.2%
(FPCore (x y z t a) :precision binary64 (if (<= z 6.6e+153) (fma (/ a (+ -1.0 (- z t))) (- y z) x) (fma (/ (- y z) z) a x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 6.6e+153) {
tmp = fma((a / (-1.0 + (z - t))), (y - z), x);
} else {
tmp = fma(((y - z) / z), a, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= 6.6e+153) tmp = fma(Float64(a / Float64(-1.0 + Float64(z - t))), Float64(y - z), x); else tmp = fma(Float64(Float64(y - z) / z), a, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 6.6e+153], N[(N[(a / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] / z), $MachinePrecision] * a + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 6.6 \cdot 10^{+153}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a}{-1 + \left(z - t\right)}, y - z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{z}, a, x\right)\\
\end{array}
\end{array}
if z < 6.59999999999999989e153Initial program 98.5%
sub-negN/A
+-commutativeN/A
clear-numN/A
associate-/r/N/A
clear-numN/A
distribute-lft-neg-inN/A
clear-numN/A
distribute-frac-neg2N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr98.6%
if 6.59999999999999989e153 < z Initial program 86.0%
sub-negN/A
+-commutativeN/A
associate-/r/N/A
distribute-lft-neg-inN/A
distribute-frac-neg2N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f64N/A
--lowering--.f64100.0
Applied egg-rr100.0%
Taylor expanded in z around inf
Simplified100.0%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- (- x (/ a z)) a))) (if (<= z -6e-17) t_1 (if (<= z 0.9) (- x (* y a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (a / z)) - a;
double tmp;
if (z <= -6e-17) {
tmp = t_1;
} else if (z <= 0.9) {
tmp = x - (y * 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) :: tmp
t_1 = (x - (a / z)) - a
if (z <= (-6d-17)) then
tmp = t_1
else if (z <= 0.9d0) then
tmp = x - (y * 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 = (x - (a / z)) - a;
double tmp;
if (z <= -6e-17) {
tmp = t_1;
} else if (z <= 0.9) {
tmp = x - (y * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (a / z)) - a tmp = 0 if z <= -6e-17: tmp = t_1 elif z <= 0.9: tmp = x - (y * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(a / z)) - a) tmp = 0.0 if (z <= -6e-17) tmp = t_1; elseif (z <= 0.9) tmp = Float64(x - Float64(y * a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - (a / z)) - a; tmp = 0.0; if (z <= -6e-17) tmp = t_1; elseif (z <= 0.9) tmp = x - (y * a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - N[(a / z), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]}, If[LessEqual[z, -6e-17], t$95$1, If[LessEqual[z, 0.9], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - \frac{a}{z}\right) - a\\
\mathbf{if}\;z \leq -6 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.9:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.00000000000000012e-17 or 0.900000000000000022 < z Initial program 94.5%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6463.6
Simplified63.6%
Taylor expanded in z around inf
associate--l+N/A
+-commutativeN/A
associate--r+N/A
associate-*r/N/A
associate-*r/N/A
div-subN/A
distribute-lft-out--N/A
associate-*r/N/A
associate--l+N/A
--lowering--.f64N/A
Simplified77.1%
Taylor expanded in y around 0
--lowering--.f64N/A
/-lowering-/.f6474.3
Simplified74.3%
if -6.00000000000000012e-17 < z < 0.900000000000000022Initial program 99.1%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6477.7
Simplified77.7%
Taylor expanded in z around 0
--lowering--.f64N/A
*-lowering-*.f6473.3
Simplified73.3%
Final simplification73.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -6e-17) (- x a) (if (<= z 1.02) (- x (* y a)) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e-17) {
tmp = x - a;
} else if (z <= 1.02) {
tmp = x - (y * a);
} 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 <= (-6d-17)) then
tmp = x - a
else if (z <= 1.02d0) then
tmp = x - (y * a)
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 <= -6e-17) {
tmp = x - a;
} else if (z <= 1.02) {
tmp = x - (y * a);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6e-17: tmp = x - a elif z <= 1.02: tmp = x - (y * a) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e-17) tmp = Float64(x - a); elseif (z <= 1.02) tmp = Float64(x - Float64(y * a)); else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6e-17) tmp = x - a; elseif (z <= 1.02) tmp = x - (y * a); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e-17], N[(x - a), $MachinePrecision], If[LessEqual[z, 1.02], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-17}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 1.02:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -6.00000000000000012e-17 or 1.02 < z Initial program 94.5%
Taylor expanded in z around inf
Simplified73.8%
if -6.00000000000000012e-17 < z < 1.02Initial program 99.1%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6477.7
Simplified77.7%
Taylor expanded in z around 0
--lowering--.f64N/A
*-lowering-*.f6473.3
Simplified73.3%
Final simplification73.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -8.5e-95) (- x a) (if (<= z 9.5e+93) x (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e-95) {
tmp = x - a;
} else if (z <= 9.5e+93) {
tmp = x;
} 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 <= (-8.5d-95)) then
tmp = x - a
else if (z <= 9.5d+93) then
tmp = x
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 <= -8.5e-95) {
tmp = x - a;
} else if (z <= 9.5e+93) {
tmp = x;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.5e-95: tmp = x - a elif z <= 9.5e+93: tmp = x else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e-95) tmp = Float64(x - a); elseif (z <= 9.5e+93) tmp = x; else tmp = Float64(x - a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.5e-95) tmp = x - a; elseif (z <= 9.5e+93) tmp = x; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e-95], N[(x - a), $MachinePrecision], If[LessEqual[z, 9.5e+93], x, N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-95}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+93}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -8.4999999999999995e-95 or 9.4999999999999991e93 < z Initial program 94.3%
Taylor expanded in z around inf
Simplified72.2%
if -8.4999999999999995e-95 < z < 9.4999999999999991e93Initial program 99.1%
Taylor expanded in x around inf
Simplified57.7%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 96.7%
Taylor expanded in x around inf
Simplified50.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 2024198
(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))))