
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - 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 - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - 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 - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- t z) (- a z))) (t_2 (fma (/ y (- z a)) (- z t) x))) (if (<= t_1 4e-17) t_2 (if (<= t_1 5e+39) (fma y (- 1.0 (/ t z)) x) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double t_2 = fma((y / (z - a)), (z - t), x);
double tmp;
if (t_1 <= 4e-17) {
tmp = t_2;
} else if (t_1 <= 5e+39) {
tmp = fma(y, (1.0 - (t / z)), x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(a - z)) t_2 = fma(Float64(y / Float64(z - a)), Float64(z - t), x) tmp = 0.0 if (t_1 <= 4e-17) tmp = t_2; elseif (t_1 <= 5e+39) tmp = fma(y, Float64(1.0 - Float64(t / z)), x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$1, 4e-17], t$95$2, If[LessEqual[t$95$1, 5e+39], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{a - z}\\
t_2 := \mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)\\
\mathbf{if}\;t\_1 \leq 4 \cdot 10^{-17}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+39}:\\
\;\;\;\;\mathsf{fma}\left(y, 1 - \frac{t}{z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 4.00000000000000029e-17 or 5.00000000000000015e39 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 96.1%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6498.2
Applied egg-rr98.2%
if 4.00000000000000029e-17 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5.00000000000000015e39Initial program 100.0%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
div-subN/A
sub-negN/A
*-inversesN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6499.6
Simplified99.6%
Final simplification98.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- a z))))
(if (<= t_1 -2e+65)
(fma (/ y z) (- t) x)
(if (<= t_1 -4e-172)
(fma y (/ t a) x)
(if (<= t_1 5e-22)
(fma (/ y (- a)) z x)
(if (<= t_1 1.00000001) (+ y x) (- x (/ (* t y) z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double tmp;
if (t_1 <= -2e+65) {
tmp = fma((y / z), -t, x);
} else if (t_1 <= -4e-172) {
tmp = fma(y, (t / a), x);
} else if (t_1 <= 5e-22) {
tmp = fma((y / -a), z, x);
} else if (t_1 <= 1.00000001) {
tmp = y + x;
} else {
tmp = x - ((t * y) / z);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(a - z)) tmp = 0.0 if (t_1 <= -2e+65) tmp = fma(Float64(y / z), Float64(-t), x); elseif (t_1 <= -4e-172) tmp = fma(y, Float64(t / a), x); elseif (t_1 <= 5e-22) tmp = fma(Float64(y / Float64(-a)), z, x); elseif (t_1 <= 1.00000001) tmp = Float64(y + x); else tmp = Float64(x - Float64(Float64(t * y) / z)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+65], N[(N[(y / z), $MachinePrecision] * (-t) + x), $MachinePrecision], If[LessEqual[t$95$1, -4e-172], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 5e-22], N[(N[(y / (-a)), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[t$95$1, 1.00000001], N[(y + x), $MachinePrecision], N[(x - N[(N[(t * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{a - z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+65}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z}, -t, x\right)\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-172}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-22}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{-a}, z, x\right)\\
\mathbf{elif}\;t\_1 \leq 1.00000001:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t \cdot y}{z}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -2e65Initial program 91.5%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0
Applied egg-rr100.0%
Taylor expanded in z around inf
Simplified72.8%
Taylor expanded in z around 0
mul-1-negN/A
neg-lowering-neg.f6472.8
Simplified72.8%
if -2e65 < (/.f64 (-.f64 z t) (-.f64 z a)) < -4.0000000000000002e-172Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6487.3
Simplified87.3%
if -4.0000000000000002e-172 < (/.f64 (-.f64 z t) (-.f64 z a)) < 4.99999999999999954e-22Initial program 99.1%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0
Applied egg-rr100.0%
Taylor expanded in z around inf
Simplified98.3%
Taylor expanded in z around 0
mul-1-negN/A
neg-lowering-neg.f6498.3
Simplified98.3%
if 4.99999999999999954e-22 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000000099999999Initial program 100.0%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6499.0
Simplified99.0%
if 1.0000000099999999 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 93.0%
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6493.0
Applied egg-rr93.0%
Taylor expanded in z around 0
mul-1-negN/A
neg-lowering-neg.f6491.5
Simplified91.5%
Taylor expanded in z around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6463.6
Simplified63.6%
Final simplification87.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- a z))))
(if (<= t_1 -2e+65)
(fma (/ y z) (- t) x)
(if (<= t_1 -4e-172)
(fma y (/ t a) x)
(if (<= t_1 5e-22)
(- x (/ (* z y) a))
(if (<= t_1 1.00000001) (+ y x) (- x (/ (* t y) z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double tmp;
if (t_1 <= -2e+65) {
tmp = fma((y / z), -t, x);
} else if (t_1 <= -4e-172) {
tmp = fma(y, (t / a), x);
} else if (t_1 <= 5e-22) {
tmp = x - ((z * y) / a);
} else if (t_1 <= 1.00000001) {
tmp = y + x;
} else {
tmp = x - ((t * y) / z);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(a - z)) tmp = 0.0 if (t_1 <= -2e+65) tmp = fma(Float64(y / z), Float64(-t), x); elseif (t_1 <= -4e-172) tmp = fma(y, Float64(t / a), x); elseif (t_1 <= 5e-22) tmp = Float64(x - Float64(Float64(z * y) / a)); elseif (t_1 <= 1.00000001) tmp = Float64(y + x); else tmp = Float64(x - Float64(Float64(t * y) / z)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+65], N[(N[(y / z), $MachinePrecision] * (-t) + x), $MachinePrecision], If[LessEqual[t$95$1, -4e-172], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 5e-22], N[(x - N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.00000001], N[(y + x), $MachinePrecision], N[(x - N[(N[(t * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{a - z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+65}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z}, -t, x\right)\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-172}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-22}:\\
\;\;\;\;x - \frac{z \cdot y}{a}\\
\mathbf{elif}\;t\_1 \leq 1.00000001:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t \cdot y}{z}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -2e65Initial program 91.5%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0
Applied egg-rr100.0%
Taylor expanded in z around inf
Simplified72.8%
Taylor expanded in z around 0
mul-1-negN/A
neg-lowering-neg.f6472.8
Simplified72.8%
if -2e65 < (/.f64 (-.f64 z t) (-.f64 z a)) < -4.0000000000000002e-172Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6487.3
Simplified87.3%
if -4.0000000000000002e-172 < (/.f64 (-.f64 z t) (-.f64 z a)) < 4.99999999999999954e-22Initial program 99.1%
Taylor expanded in a around inf
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
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--.f6499.1
Simplified99.1%
Taylor expanded in t around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6498.3
Simplified98.3%
if 4.99999999999999954e-22 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000000099999999Initial program 100.0%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6499.0
Simplified99.0%
if 1.0000000099999999 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 93.0%
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6493.0
Applied egg-rr93.0%
Taylor expanded in z around 0
mul-1-negN/A
neg-lowering-neg.f6491.5
Simplified91.5%
Taylor expanded in z around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6463.6
Simplified63.6%
Final simplification87.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- a z))) (t_2 (- x (/ (* t y) z))))
(if (<= t_1 -1e+221)
t_2
(if (<= t_1 -4e-172)
(fma y (/ t a) x)
(if (<= t_1 5e-22)
(- x (/ (* z y) a))
(if (<= t_1 1.00000001) (+ y x) t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double t_2 = x - ((t * y) / z);
double tmp;
if (t_1 <= -1e+221) {
tmp = t_2;
} else if (t_1 <= -4e-172) {
tmp = fma(y, (t / a), x);
} else if (t_1 <= 5e-22) {
tmp = x - ((z * y) / a);
} else if (t_1 <= 1.00000001) {
tmp = y + x;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(a - z)) t_2 = Float64(x - Float64(Float64(t * y) / z)) tmp = 0.0 if (t_1 <= -1e+221) tmp = t_2; elseif (t_1 <= -4e-172) tmp = fma(y, Float64(t / a), x); elseif (t_1 <= 5e-22) tmp = Float64(x - Float64(Float64(z * y) / a)); elseif (t_1 <= 1.00000001) tmp = Float64(y + x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(t * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+221], t$95$2, If[LessEqual[t$95$1, -4e-172], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 5e-22], N[(x - N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.00000001], N[(y + x), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{a - z}\\
t_2 := x - \frac{t \cdot y}{z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+221}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-172}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-22}:\\
\;\;\;\;x - \frac{z \cdot y}{a}\\
\mathbf{elif}\;t\_1 \leq 1.00000001:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -1e221 or 1.0000000099999999 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 89.2%
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6489.2
Applied egg-rr89.2%
Taylor expanded in z around 0
mul-1-negN/A
neg-lowering-neg.f6488.1
Simplified88.1%
Taylor expanded in z around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6468.8
Simplified68.8%
if -1e221 < (/.f64 (-.f64 z t) (-.f64 z a)) < -4.0000000000000002e-172Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6477.6
Simplified77.6%
if -4.0000000000000002e-172 < (/.f64 (-.f64 z t) (-.f64 z a)) < 4.99999999999999954e-22Initial program 99.1%
Taylor expanded in a around inf
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
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--.f6499.1
Simplified99.1%
Taylor expanded in t around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6498.3
Simplified98.3%
if 4.99999999999999954e-22 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000000099999999Initial program 100.0%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6499.0
Simplified99.0%
Final simplification87.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- a z))) (t_2 (fma (/ t (- a z)) y x)))
(if (<= t_1 -2e+65)
t_2
(if (<= t_1 4e-17)
(fma y (/ (- t z) a) x)
(if (<= t_1 10000000000000.0) (fma y (- 1.0 (/ t z)) x) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double t_2 = fma((t / (a - z)), y, x);
double tmp;
if (t_1 <= -2e+65) {
tmp = t_2;
} else if (t_1 <= 4e-17) {
tmp = fma(y, ((t - z) / a), x);
} else if (t_1 <= 10000000000000.0) {
tmp = fma(y, (1.0 - (t / z)), x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(a - z)) t_2 = fma(Float64(t / Float64(a - z)), y, x) tmp = 0.0 if (t_1 <= -2e+65) tmp = t_2; elseif (t_1 <= 4e-17) tmp = fma(y, Float64(Float64(t - z) / a), x); elseif (t_1 <= 10000000000000.0) tmp = fma(y, Float64(1.0 - Float64(t / z)), x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+65], t$95$2, If[LessEqual[t$95$1, 4e-17], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 10000000000000.0], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{a - z}\\
t_2 := \mathsf{fma}\left(\frac{t}{a - z}, y, x\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+65}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - z}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 10000000000000:\\
\;\;\;\;\mathsf{fma}\left(y, 1 - \frac{t}{z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -2e65 or 1e13 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 92.0%
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6492.0
Applied egg-rr92.0%
Taylor expanded in z around 0
mul-1-negN/A
neg-lowering-neg.f6492.0
Simplified92.0%
if -2e65 < (/.f64 (-.f64 z t) (-.f64 z a)) < 4.00000000000000029e-17Initial program 99.4%
Taylor expanded in a around inf
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
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--.f6499.0
Simplified99.0%
if 4.00000000000000029e-17 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e13Initial program 100.0%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
div-subN/A
sub-negN/A
*-inversesN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6499.6
Simplified99.6%
Final simplification97.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- a z))))
(if (<= t_1 -2e+65)
(fma (/ y z) (- t) x)
(if (<= t_1 4e-17)
(fma y (/ (- t z) a) x)
(if (<= t_1 4e+55) (fma y (- 1.0 (/ t z)) x) (/ (* t y) (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double tmp;
if (t_1 <= -2e+65) {
tmp = fma((y / z), -t, x);
} else if (t_1 <= 4e-17) {
tmp = fma(y, ((t - z) / a), x);
} else if (t_1 <= 4e+55) {
tmp = fma(y, (1.0 - (t / z)), x);
} else {
tmp = (t * y) / (a - z);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(a - z)) tmp = 0.0 if (t_1 <= -2e+65) tmp = fma(Float64(y / z), Float64(-t), x); elseif (t_1 <= 4e-17) tmp = fma(y, Float64(Float64(t - z) / a), x); elseif (t_1 <= 4e+55) tmp = fma(y, Float64(1.0 - Float64(t / z)), x); else tmp = Float64(Float64(t * y) / Float64(a - z)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+65], N[(N[(y / z), $MachinePrecision] * (-t) + x), $MachinePrecision], If[LessEqual[t$95$1, 4e-17], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 4e+55], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{a - z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+65}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z}, -t, x\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - z}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+55}:\\
\;\;\;\;\mathsf{fma}\left(y, 1 - \frac{t}{z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot y}{a - z}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -2e65Initial program 91.5%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0
Applied egg-rr100.0%
Taylor expanded in z around inf
Simplified72.8%
Taylor expanded in z around 0
mul-1-negN/A
neg-lowering-neg.f6472.8
Simplified72.8%
if -2e65 < (/.f64 (-.f64 z t) (-.f64 z a)) < 4.00000000000000029e-17Initial program 99.4%
Taylor expanded in a around inf
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
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--.f6499.0
Simplified99.0%
if 4.00000000000000029e-17 < (/.f64 (-.f64 z t) (-.f64 z a)) < 4.00000000000000004e55Initial program 100.0%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
div-subN/A
sub-negN/A
*-inversesN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6497.6
Simplified97.6%
if 4.00000000000000004e55 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 90.1%
Taylor expanded in t around inf
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
neg-mul-1N/A
+-lowering-+.f64N/A
neg-mul-1N/A
neg-lowering-neg.f6473.8
Simplified73.8%
Final simplification92.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- a z))))
(if (<= t_1 -2e+65)
(fma (/ y z) (- t) x)
(if (<= t_1 -4e-172)
(fma y (/ t a) x)
(if (<= t_1 4e-17) (fma (/ y (- a)) z x) (fma y (- 1.0 (/ t z)) x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double tmp;
if (t_1 <= -2e+65) {
tmp = fma((y / z), -t, x);
} else if (t_1 <= -4e-172) {
tmp = fma(y, (t / a), x);
} else if (t_1 <= 4e-17) {
tmp = fma((y / -a), z, x);
} else {
tmp = fma(y, (1.0 - (t / z)), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(a - z)) tmp = 0.0 if (t_1 <= -2e+65) tmp = fma(Float64(y / z), Float64(-t), x); elseif (t_1 <= -4e-172) tmp = fma(y, Float64(t / a), x); elseif (t_1 <= 4e-17) tmp = fma(Float64(y / Float64(-a)), z, x); else tmp = fma(y, Float64(1.0 - Float64(t / z)), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+65], N[(N[(y / z), $MachinePrecision] * (-t) + x), $MachinePrecision], If[LessEqual[t$95$1, -4e-172], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 4e-17], N[(N[(y / (-a)), $MachinePrecision] * z + x), $MachinePrecision], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{a - z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+65}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z}, -t, x\right)\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-172}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{-a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, 1 - \frac{t}{z}, x\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -2e65Initial program 91.5%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0
Applied egg-rr100.0%
Taylor expanded in z around inf
Simplified72.8%
Taylor expanded in z around 0
mul-1-negN/A
neg-lowering-neg.f6472.8
Simplified72.8%
if -2e65 < (/.f64 (-.f64 z t) (-.f64 z a)) < -4.0000000000000002e-172Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6487.3
Simplified87.3%
if -4.0000000000000002e-172 < (/.f64 (-.f64 z t) (-.f64 z a)) < 4.00000000000000029e-17Initial program 99.1%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0
Applied egg-rr100.0%
Taylor expanded in z around inf
Simplified98.4%
Taylor expanded in z around 0
mul-1-negN/A
neg-lowering-neg.f6498.4
Simplified98.4%
if 4.00000000000000029e-17 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.6%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
div-subN/A
sub-negN/A
*-inversesN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6486.9
Simplified86.9%
Final simplification87.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- a z))) (t_2 (- x (/ (* t y) z))))
(if (<= t_1 -1e+221)
t_2
(if (<= t_1 5e-22)
(fma y (/ t a) x)
(if (<= t_1 1.00000001) (+ y x) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double t_2 = x - ((t * y) / z);
double tmp;
if (t_1 <= -1e+221) {
tmp = t_2;
} else if (t_1 <= 5e-22) {
tmp = fma(y, (t / a), x);
} else if (t_1 <= 1.00000001) {
tmp = y + x;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(a - z)) t_2 = Float64(x - Float64(Float64(t * y) / z)) tmp = 0.0 if (t_1 <= -1e+221) tmp = t_2; elseif (t_1 <= 5e-22) tmp = fma(y, Float64(t / a), x); elseif (t_1 <= 1.00000001) tmp = Float64(y + x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(t * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+221], t$95$2, If[LessEqual[t$95$1, 5e-22], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 1.00000001], N[(y + x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{a - z}\\
t_2 := x - \frac{t \cdot y}{z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+221}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-22}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 1.00000001:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -1e221 or 1.0000000099999999 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 89.2%
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6489.2
Applied egg-rr89.2%
Taylor expanded in z around 0
mul-1-negN/A
neg-lowering-neg.f6488.1
Simplified88.1%
Taylor expanded in z around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6468.8
Simplified68.8%
if -1e221 < (/.f64 (-.f64 z t) (-.f64 z a)) < 4.99999999999999954e-22Initial program 99.5%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6484.0
Simplified84.0%
if 4.99999999999999954e-22 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000000099999999Initial program 100.0%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6499.0
Simplified99.0%
Final simplification85.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- a z))))
(if (<= t_1 -1e+221)
(- (/ (* t y) z))
(if (<= t_1 5e-22)
(fma y (/ t a) x)
(if (<= t_1 5e+39) (+ y x) (fma t (/ y a) x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double tmp;
if (t_1 <= -1e+221) {
tmp = -((t * y) / z);
} else if (t_1 <= 5e-22) {
tmp = fma(y, (t / a), x);
} else if (t_1 <= 5e+39) {
tmp = y + x;
} else {
tmp = fma(t, (y / a), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(a - z)) tmp = 0.0 if (t_1 <= -1e+221) tmp = Float64(-Float64(Float64(t * y) / z)); elseif (t_1 <= 5e-22) tmp = fma(y, Float64(t / a), x); elseif (t_1 <= 5e+39) tmp = Float64(y + x); else tmp = fma(t, Float64(y / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+221], (-N[(N[(t * y), $MachinePrecision] / z), $MachinePrecision]), If[LessEqual[t$95$1, 5e-22], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 5e+39], N[(y + x), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{a - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+221}:\\
\;\;\;\;-\frac{t \cdot y}{z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-22}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+39}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -1e221Initial program 75.9%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0
Applied egg-rr100.0%
Taylor expanded in z around inf
Simplified87.1%
Taylor expanded in z around 0
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6479.2
Simplified79.2%
if -1e221 < (/.f64 (-.f64 z t) (-.f64 z a)) < 4.99999999999999954e-22Initial program 99.5%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6484.0
Simplified84.0%
if 4.99999999999999954e-22 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5.00000000000000015e39Initial program 100.0%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6495.0
Simplified95.0%
if 5.00000000000000015e39 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 91.6%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6460.4
Simplified60.4%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6466.0
Applied egg-rr66.0%
Final simplification85.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- a z))) (t_2 (* t (/ y a))))
(if (<= t_1 -1e+275)
t_2
(if (<= t_1 5e-22) x (if (<= t_1 1e+63) (+ y x) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double t_2 = t * (y / a);
double tmp;
if (t_1 <= -1e+275) {
tmp = t_2;
} else if (t_1 <= 5e-22) {
tmp = x;
} else if (t_1 <= 1e+63) {
tmp = y + x;
} else {
tmp = t_2;
}
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 = (t - z) / (a - z)
t_2 = t * (y / a)
if (t_1 <= (-1d+275)) then
tmp = t_2
else if (t_1 <= 5d-22) then
tmp = x
else if (t_1 <= 1d+63) then
tmp = y + x
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double t_2 = t * (y / a);
double tmp;
if (t_1 <= -1e+275) {
tmp = t_2;
} else if (t_1 <= 5e-22) {
tmp = x;
} else if (t_1 <= 1e+63) {
tmp = y + x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t - z) / (a - z) t_2 = t * (y / a) tmp = 0 if t_1 <= -1e+275: tmp = t_2 elif t_1 <= 5e-22: tmp = x elif t_1 <= 1e+63: tmp = y + x else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(a - z)) t_2 = Float64(t * Float64(y / a)) tmp = 0.0 if (t_1 <= -1e+275) tmp = t_2; elseif (t_1 <= 5e-22) tmp = x; elseif (t_1 <= 1e+63) tmp = Float64(y + x); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t - z) / (a - z); t_2 = t * (y / a); tmp = 0.0; if (t_1 <= -1e+275) tmp = t_2; elseif (t_1 <= 5e-22) tmp = x; elseif (t_1 <= 1e+63) tmp = y + x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+275], t$95$2, If[LessEqual[t$95$1, 5e-22], x, If[LessEqual[t$95$1, 1e+63], N[(y + x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{a - z}\\
t_2 := t \cdot \frac{y}{a}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+275}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-22}:\\
\;\;\;\;x\\
\mathbf{elif}\;t\_1 \leq 10^{+63}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.9999999999999996e274 or 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 84.6%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6453.7
Simplified53.7%
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6450.7
Applied egg-rr50.7%
Taylor expanded in t around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6443.1
Simplified43.1%
if -9.9999999999999996e274 < (/.f64 (-.f64 z t) (-.f64 z a)) < 4.99999999999999954e-22Initial program 99.5%
Taylor expanded in x around inf
Simplified71.0%
if 4.99999999999999954e-22 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63Initial program 100.0%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6492.5
Simplified92.5%
Final simplification75.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- a z))))
(if (<= t_1 -2e+65)
(fma (/ y z) (- t) x)
(if (<= t_1 4e-17) (fma y (/ (- t z) a) x) (fma y (- 1.0 (/ t z)) x)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double tmp;
if (t_1 <= -2e+65) {
tmp = fma((y / z), -t, x);
} else if (t_1 <= 4e-17) {
tmp = fma(y, ((t - z) / a), x);
} else {
tmp = fma(y, (1.0 - (t / z)), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(a - z)) tmp = 0.0 if (t_1 <= -2e+65) tmp = fma(Float64(y / z), Float64(-t), x); elseif (t_1 <= 4e-17) tmp = fma(y, Float64(Float64(t - z) / a), x); else tmp = fma(y, Float64(1.0 - Float64(t / z)), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+65], N[(N[(y / z), $MachinePrecision] * (-t) + x), $MachinePrecision], If[LessEqual[t$95$1, 4e-17], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{a - z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+65}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z}, -t, x\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, 1 - \frac{t}{z}, x\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -2e65Initial program 91.5%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64100.0
Applied egg-rr100.0%
Taylor expanded in z around inf
Simplified72.8%
Taylor expanded in z around 0
mul-1-negN/A
neg-lowering-neg.f6472.8
Simplified72.8%
if -2e65 < (/.f64 (-.f64 z t) (-.f64 z a)) < 4.00000000000000029e-17Initial program 99.4%
Taylor expanded in a around inf
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
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--.f6499.0
Simplified99.0%
if 4.00000000000000029e-17 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.6%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
div-subN/A
sub-negN/A
*-inversesN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6486.9
Simplified86.9%
Final simplification89.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- a z))))
(if (<= t_1 5e-22)
(fma y (/ t a) x)
(if (<= t_1 5e+39) (+ y x) (fma t (/ y a) x)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double tmp;
if (t_1 <= 5e-22) {
tmp = fma(y, (t / a), x);
} else if (t_1 <= 5e+39) {
tmp = y + x;
} else {
tmp = fma(t, (y / a), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(a - z)) tmp = 0.0 if (t_1 <= 5e-22) tmp = fma(y, Float64(t / a), x); elseif (t_1 <= 5e+39) tmp = Float64(y + x); else tmp = fma(t, Float64(y / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-22], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 5e+39], N[(y + x), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{a - z}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-22}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+39}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 4.99999999999999954e-22Initial program 97.3%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6479.6
Simplified79.6%
if 4.99999999999999954e-22 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5.00000000000000015e39Initial program 100.0%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6495.0
Simplified95.0%
if 5.00000000000000015e39 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 91.6%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6460.4
Simplified60.4%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6466.0
Applied egg-rr66.0%
Final simplification83.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- t z) (- a z))) (t_2 (fma t (/ y a) x))) (if (<= t_1 5e-22) t_2 (if (<= t_1 5e+39) (+ y x) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (a - z);
double t_2 = fma(t, (y / a), x);
double tmp;
if (t_1 <= 5e-22) {
tmp = t_2;
} else if (t_1 <= 5e+39) {
tmp = y + x;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(a - z)) t_2 = fma(t, Float64(y / a), x) tmp = 0.0 if (t_1 <= 5e-22) tmp = t_2; elseif (t_1 <= 5e+39) tmp = Float64(y + x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-22], t$95$2, If[LessEqual[t$95$1, 5e+39], N[(y + x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{a - z}\\
t_2 := \mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-22}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+39}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 4.99999999999999954e-22 or 5.00000000000000015e39 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 96.1%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6470.6
Simplified70.6%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6476.3
Applied egg-rr76.3%
if 4.99999999999999954e-22 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5.00000000000000015e39Initial program 100.0%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6495.0
Simplified95.0%
Final simplification82.9%
(FPCore (x y z t a) :precision binary64 (if (<= (/ (- t z) (- a z)) 2.4e-20) x (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((t - z) / (a - z)) <= 2.4e-20) {
tmp = x;
} else {
tmp = y + x;
}
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 (((t - z) / (a - z)) <= 2.4d-20) then
tmp = x
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((t - z) / (a - z)) <= 2.4e-20) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((t - z) / (a - z)) <= 2.4e-20: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(t - z) / Float64(a - z)) <= 2.4e-20) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((t - z) / (a - z)) <= 2.4e-20) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], 2.4e-20], x, N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t - z}{a - z} \leq 2.4 \cdot 10^{-20}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 2.39999999999999993e-20Initial program 97.3%
Taylor expanded in x around inf
Simplified65.8%
if 2.39999999999999993e-20 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.6%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6476.9
Simplified76.9%
Final simplification71.2%
(FPCore (x y z t a) :precision binary64 (fma (/ (- t z) (- a z)) y x))
double code(double x, double y, double z, double t, double a) {
return fma(((t - z) / (a - z)), y, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(t - z) / Float64(a - z)), y, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{t - z}{a - z}, y, x\right)
\end{array}
Initial program 97.5%
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.5
Applied egg-rr97.5%
Final simplification97.5%
(FPCore (x y z t a) :precision binary64 (if (<= y 3.4e+105) x y))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 3.4e+105) {
tmp = x;
} else {
tmp = y;
}
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 (y <= 3.4d+105) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 3.4e+105) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 3.4e+105: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 3.4e+105) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 3.4e+105) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 3.4e+105], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.4 \cdot 10^{+105}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 3.3999999999999999e105Initial program 97.1%
Taylor expanded in x around inf
Simplified62.2%
if 3.3999999999999999e105 < y Initial program 99.8%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6442.7
Simplified42.7%
Taylor expanded in y around inf
Simplified39.5%
(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.5%
Taylor expanded in x around inf
Simplified56.2%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
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 - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024198
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (* y (/ (- z t) (- z a)))))