
(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 16 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 (/ (+ (- t z) 1.0) (- z y)))))
double code(double x, double y, double z, double t, double a) {
return x + (a / (((t - z) + 1.0) / (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 / (((t - z) + 1.0d0) / (z - y)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a / (((t - z) + 1.0) / (z - y)));
}
def code(x, y, z, t, a): return x + (a / (((t - z) + 1.0) / (z - y)))
function code(x, y, z, t, a) return Float64(x + Float64(a / Float64(Float64(Float64(t - z) + 1.0) / Float64(z - y)))) end
function tmp = code(x, y, z, t, a) tmp = x + (a / (((t - z) + 1.0) / (z - y))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{a}{\frac{\left(t - z\right) + 1}{z - y}}
\end{array}
Initial program 97.7%
associate-/r/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
--lowering--.f6499.5
Applied egg-rr99.5%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- y z) (/ (+ (- t z) 1.0) a)))) (if (<= t_1 -4e+113) (- 0.0 a) (if (<= t_1 1e+172) x (- 0.0 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 <= -4e+113) {
tmp = 0.0 - a;
} else if (t_1 <= 1e+172) {
tmp = x;
} else {
tmp = 0.0 - 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 <= (-4d+113)) then
tmp = 0.0d0 - a
else if (t_1 <= 1d+172) then
tmp = x
else
tmp = 0.0d0 - 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 <= -4e+113) {
tmp = 0.0 - a;
} else if (t_1 <= 1e+172) {
tmp = x;
} else {
tmp = 0.0 - a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - z) / (((t - z) + 1.0) / a) tmp = 0 if t_1 <= -4e+113: tmp = 0.0 - a elif t_1 <= 1e+172: tmp = x else: tmp = 0.0 - 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 <= -4e+113) tmp = Float64(0.0 - a); elseif (t_1 <= 1e+172) tmp = x; else tmp = Float64(0.0 - 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 <= -4e+113) tmp = 0.0 - a; elseif (t_1 <= 1e+172) tmp = x; else tmp = 0.0 - 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, -4e+113], N[(0.0 - a), $MachinePrecision], If[LessEqual[t$95$1, 1e+172], x, N[(0.0 - a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+113}:\\
\;\;\;\;0 - a\\
\mathbf{elif}\;t\_1 \leq 10^{+172}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;0 - a\\
\end{array}
\end{array}
if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -4e113 or 1.0000000000000001e172 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) Initial program 99.7%
Taylor expanded in z around inf
Simplified43.0%
Taylor expanded in x around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f6434.0
Simplified34.0%
sub0-negN/A
neg-lowering-neg.f6434.0
Applied egg-rr34.0%
if -4e113 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 1.0000000000000001e172Initial program 97.0%
Taylor expanded in x around inf
Simplified69.8%
Final simplification60.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.15e+64)
(fma (/ (- y z) z) a x)
(if (<= z 5.5e-13)
(fma (/ (- y z) (- -1.0 t)) a 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 <= -5.15e+64) {
tmp = fma(((y - z) / z), a, x);
} else if (z <= 5.5e-13) {
tmp = fma(((y - z) / (-1.0 - t)), a, 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 <= -5.15e+64) tmp = fma(Float64(Float64(y - z) / z), a, x); elseif (z <= 5.5e-13) tmp = fma(Float64(Float64(y - z) / Float64(-1.0 - t)), a, 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, -5.15e+64], N[(N[(N[(y - z), $MachinePrecision] / z), $MachinePrecision] * a + x), $MachinePrecision], If[LessEqual[z, 5.5e-13], N[(N[(N[(y - z), $MachinePrecision] / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision] * a + 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 -5.15 \cdot 10^{+64}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{z}, a, x\right)\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{-1 - t}, a, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{t + \left(1 - z\right)}, x\right)\\
\end{array}
\end{array}
if z < -5.15000000000000009e64Initial program 97.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%
Taylor expanded in z around inf
Simplified97.8%
if -5.15000000000000009e64 < z < 5.49999999999999979e-13Initial program 99.9%
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.2
Applied egg-rr99.2%
Taylor expanded in z around 0
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6496.7
Simplified96.7%
if 5.49999999999999979e-13 < z Initial program 92.8%
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--.f6483.6
Simplified83.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ y (+ -1.0 (- z t))) a x)))
(if (<= y -2.15e+38)
t_1
(if (<= y 1.2e+37) (fma a (/ z (+ t (- 1.0 z))) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y / (-1.0 + (z - t))), a, x);
double tmp;
if (y <= -2.15e+38) {
tmp = t_1;
} else if (y <= 1.2e+37) {
tmp = fma(a, (z / (t + (1.0 - z))), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y / Float64(-1.0 + Float64(z - t))), a, x) tmp = 0.0 if (y <= -2.15e+38) tmp = t_1; elseif (y <= 1.2e+37) tmp = fma(a, Float64(z / Float64(t + Float64(1.0 - z))), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]}, If[LessEqual[y, -2.15e+38], t$95$1, If[LessEqual[y, 1.2e+37], N[(a * N[(z / N[(t + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{-1 + \left(z - t\right)}, a, x\right)\\
\mathbf{if}\;y \leq -2.15 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{t + \left(1 - z\right)}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.1499999999999998e38 or 1.2e37 < y Initial program 94.3%
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.8
Applied egg-rr99.8%
Taylor expanded in y around inf
Simplified92.4%
if -2.1499999999999998e38 < y < 1.2e37Initial program 99.8%
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--.f6492.9
Simplified92.9%
Final simplification92.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.45e+38)
(fma (/ (- y z) z) a x)
(if (<= z 1.4e-13)
(+ x (* y (/ a (- -1.0 t))))
(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.45e+38) {
tmp = fma(((y - z) / z), a, x);
} else if (z <= 1.4e-13) {
tmp = x + (y * (a / (-1.0 - t)));
} 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.45e+38) tmp = fma(Float64(Float64(y - z) / z), a, x); elseif (z <= 1.4e-13) tmp = Float64(x + Float64(y * Float64(a / Float64(-1.0 - t)))); 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.45e+38], N[(N[(N[(y - z), $MachinePrecision] / z), $MachinePrecision] * a + x), $MachinePrecision], If[LessEqual[z, 1.4e-13], N[(x + N[(y * N[(a / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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.45 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{z}, a, x\right)\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-13}:\\
\;\;\;\;x + y \cdot \frac{a}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{z}{t + \left(1 - z\right)}, x\right)\\
\end{array}
\end{array}
if z < -1.45000000000000003e38Initial program 98.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
Simplified93.0%
if -1.45000000000000003e38 < z < 1.4000000000000001e-13Initial program 99.9%
Taylor expanded in z around 0
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6493.2
Simplified93.2%
if 1.4000000000000001e-13 < z Initial program 92.8%
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--.f6483.6
Simplified83.6%
Final simplification90.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- y z) z) a x)))
(if (<= z -1.66e+38)
t_1
(if (<= z 2.8e+30) (+ x (* y (/ a (- -1.0 t)))) 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.66e+38) {
tmp = t_1;
} else if (z <= 2.8e+30) {
tmp = x + (y * (a / (-1.0 - t)));
} 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.66e+38) tmp = t_1; elseif (z <= 2.8e+30) tmp = Float64(x + Float64(y * Float64(a / Float64(-1.0 - t)))); 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.66e+38], t$95$1, If[LessEqual[z, 2.8e+30], N[(x + N[(y * N[(a / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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.66 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+30}:\\
\;\;\;\;x + y \cdot \frac{a}{-1 - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.66e38 or 2.79999999999999983e30 < z Initial program 95.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%
Taylor expanded in z around inf
Simplified88.8%
if -1.66e38 < z < 2.79999999999999983e30Initial program 99.2%
Taylor expanded in z around 0
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6490.3
Simplified90.3%
Final simplification89.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- y z) z) a x)))
(if (<= z -1.45e+38)
t_1
(if (<= z 2.9e+30) (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.45e+38) {
tmp = t_1;
} else if (z <= 2.9e+30) {
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.45e+38) tmp = t_1; elseif (z <= 2.9e+30) 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.45e+38], t$95$1, If[LessEqual[z, 2.9e+30], 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.45 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.45000000000000003e38 or 2.8999999999999998e30 < z Initial program 95.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%
Taylor expanded in z around inf
Simplified88.8%
if -1.45000000000000003e38 < z < 2.8999999999999998e30Initial 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--.f6490.3
Simplified90.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ a z) (- y z) x)))
(if (<= z -2.8e+38)
t_1
(if (<= z 2.25e+30) (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), (y - z), x);
double tmp;
if (z <= -2.8e+38) {
tmp = t_1;
} else if (z <= 2.25e+30) {
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(a / z), Float64(y - z), x) tmp = 0.0 if (z <= -2.8e+38) tmp = t_1; elseif (z <= 2.25e+30) 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[(a / z), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -2.8e+38], t$95$1, If[LessEqual[z, 2.25e+30], 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{a}{z}, y - z, x\right)\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.8e38 or 2.24999999999999997e30 < z Initial program 95.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%
Taylor expanded in z around inf
Simplified88.8%
*-commutativeN/A
clear-numN/A
metadata-evalN/A
associate-*r/N/A
div-invN/A
times-fracN/A
metadata-evalN/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6485.5
Applied egg-rr85.5%
if -2.8e38 < z < 2.24999999999999997e30Initial 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--.f6490.3
Simplified90.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.8e+70) (- x a) (if (<= z 6e-6) (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 <= -4.8e+70) {
tmp = x - a;
} else if (z <= 6e-6) {
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 <= -4.8e+70) tmp = Float64(x - a); elseif (z <= 6e-6) 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, -4.8e+70], N[(x - a), $MachinePrecision], If[LessEqual[z, 6e-6], 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 -4.8 \cdot 10^{+70}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-6}:\\
\;\;\;\;\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 < -4.79999999999999974e70Initial program 97.6%
Taylor expanded in z around inf
Simplified83.7%
if -4.79999999999999974e70 < z < 6.0000000000000002e-6Initial program 99.9%
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--.f6490.4
Simplified90.4%
if 6.0000000000000002e-6 < z Initial program 92.7%
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--.f6483.3
Simplified83.3%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6470.2
Simplified70.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -7e+65) (- x a) (if (<= z 2.6e+30) (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 <= -7e+65) {
tmp = x - a;
} else if (z <= 2.6e+30) {
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 <= -7e+65) tmp = Float64(x - a); elseif (z <= 2.6e+30) 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, -7e+65], N[(x - a), $MachinePrecision], If[LessEqual[z, 2.6e+30], 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 -7 \cdot 10^{+65}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y}{-1 - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -7.0000000000000002e65 or 2.59999999999999988e30 < z Initial program 95.3%
Taylor expanded in z around inf
Simplified77.7%
if -7.0000000000000002e65 < z < 2.59999999999999988e30Initial 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--.f6488.4
Simplified88.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- x (* y (/ a t))))) (if (<= t -1.2e+32) t_1 (if (<= t 2.95e+66) (- x a) 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 <= -1.2e+32) {
tmp = t_1;
} else if (t <= 2.95e+66) {
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) :: tmp
t_1 = x - (y * (a / t))
if (t <= (-1.2d+32)) then
tmp = t_1
else if (t <= 2.95d+66) 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 = x - (y * (a / t));
double tmp;
if (t <= -1.2e+32) {
tmp = t_1;
} else if (t <= 2.95e+66) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * (a / t)) tmp = 0 if t <= -1.2e+32: tmp = t_1 elif t <= 2.95e+66: tmp = x - a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(a / t))) tmp = 0.0 if (t <= -1.2e+32) tmp = t_1; elseif (t <= 2.95e+66) tmp = Float64(x - a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * (a / t)); tmp = 0.0; if (t <= -1.2e+32) tmp = t_1; elseif (t <= 2.95e+66) tmp = x - a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.2e+32], t$95$1, If[LessEqual[t, 2.95e+66], N[(x - a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{a}{t}\\
\mathbf{if}\;t \leq -1.2 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.95 \cdot 10^{+66}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.19999999999999996e32 or 2.94999999999999994e66 < t Initial program 98.0%
Taylor expanded in z around 0
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6484.0
Simplified84.0%
Taylor expanded in t around inf
/-lowering-/.f6484.0
Simplified84.0%
if -1.19999999999999996e32 < t < 2.94999999999999994e66Initial program 97.5%
Taylor expanded in z around inf
Simplified66.1%
(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 97.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.5
Applied egg-rr99.5%
Final simplification99.5%
(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 97.7%
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-rr97.8%
Final simplification97.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -1e+69) (- x a) (if (<= z 58.0) (- x (* a y)) (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e+69) {
tmp = x - a;
} else if (z <= 58.0) {
tmp = x - (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 <= (-1d+69)) then
tmp = x - a
else if (z <= 58.0d0) then
tmp = x - (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 <= -1e+69) {
tmp = x - a;
} else if (z <= 58.0) {
tmp = x - (a * y);
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1e+69: tmp = x - a elif z <= 58.0: tmp = x - (a * y) else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1e+69) tmp = Float64(x - a); elseif (z <= 58.0) tmp = Float64(x - 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 <= -1e+69) tmp = x - a; elseif (z <= 58.0) tmp = x - (a * y); else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e+69], N[(x - a), $MachinePrecision], If[LessEqual[z, 58.0], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+69}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 58:\\
\;\;\;\;x - a \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -1.0000000000000001e69 or 58 < z Initial program 94.6%
Taylor expanded in z around inf
Simplified75.2%
if -1.0000000000000001e69 < z < 58Initial program 99.9%
Taylor expanded in z around 0
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6489.9
Simplified89.9%
Taylor expanded in t around 0
Simplified69.7%
Final simplification72.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -2e+44) (- x a) (if (<= z 4.3e+39) x (- x a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+44) {
tmp = x - a;
} else if (z <= 4.3e+39) {
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 <= (-2d+44)) then
tmp = x - a
else if (z <= 4.3d+39) 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 <= -2e+44) {
tmp = x - a;
} else if (z <= 4.3e+39) {
tmp = x;
} else {
tmp = x - a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2e+44: tmp = x - a elif z <= 4.3e+39: tmp = x else: tmp = x - a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e+44) tmp = Float64(x - a); elseif (z <= 4.3e+39) 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 <= -2e+44) tmp = x - a; elseif (z <= 4.3e+39) tmp = x; else tmp = x - a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e+44], N[(x - a), $MachinePrecision], If[LessEqual[z, 4.3e+39], x, N[(x - a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+44}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+39}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - a\\
\end{array}
\end{array}
if z < -2.0000000000000002e44 or 4.3e39 < z Initial program 95.5%
Taylor expanded in z around inf
Simplified76.9%
if -2.0000000000000002e44 < z < 4.3e39Initial program 99.2%
Taylor expanded in x around inf
Simplified62.2%
(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 97.7%
Taylor expanded in x around inf
Simplified55.1%
(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 2024196
(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))))