
(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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ y (- z a)) (- z t) x)) (t_2 (/ (* y (- z t)) (- z a)))) (if (<= t_2 (- INFINITY)) t_1 (if (<= t_2 1e+307) (+ t_2 x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y / (z - a)), (z - t), x);
double t_2 = (y * (z - t)) / (z - a);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 1e+307) {
tmp = t_2 + x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y / Float64(z - a)), Float64(z - t), x) t_2 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= 1e+307) tmp = Float64(t_2 + x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 1e+307], N[(t$95$2 + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)\\
t_2 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+307}:\\
\;\;\;\;t\_2 + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 9.99999999999999986e306 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 41.7%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9
Applied egg-rr99.9%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 9.99999999999999986e306Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* y (- z t)) (- z a)))) (if (<= t_1 -4e+177) y (if (<= t_1 1e-5) x y))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if (t_1 <= -4e+177) {
tmp = y;
} else if (t_1 <= 1e-5) {
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) :: t_1
real(8) :: tmp
t_1 = (y * (z - t)) / (z - a)
if (t_1 <= (-4d+177)) then
tmp = y
else if (t_1 <= 1d-5) 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 t_1 = (y * (z - t)) / (z - a);
double tmp;
if (t_1 <= -4e+177) {
tmp = y;
} else if (t_1 <= 1e-5) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if t_1 <= -4e+177: tmp = y elif t_1 <= 1e-5: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if (t_1 <= -4e+177) tmp = y; elseif (t_1 <= 1e-5) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (z - a); tmp = 0.0; if (t_1 <= -4e+177) tmp = y; elseif (t_1 <= 1e-5) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+177], y, If[LessEqual[t$95$1, 1e-5], x, y]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+177}:\\
\;\;\;\;y\\
\mathbf{elif}\;t\_1 \leq 10^{-5}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -4e177 or 1.00000000000000008e-5 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 69.1%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6444.0
Simplified44.0%
Taylor expanded in y around inf
Simplified35.0%
if -4e177 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 1.00000000000000008e-5Initial program 99.9%
Taylor expanded in x around inf
Simplified69.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.9e+28)
(+ y x)
(if (<= z -1.35e-151)
(fma (/ y z) (- t) x)
(if (<= z 1.35e-15) (fma t (/ y a) x) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.9e+28) {
tmp = y + x;
} else if (z <= -1.35e-151) {
tmp = fma((y / z), -t, x);
} else if (z <= 1.35e-15) {
tmp = fma(t, (y / a), x);
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.9e+28) tmp = Float64(y + x); elseif (z <= -1.35e-151) tmp = fma(Float64(y / z), Float64(-t), x); elseif (z <= 1.35e-15) tmp = fma(t, Float64(y / a), x); else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.9e+28], N[(y + x), $MachinePrecision], If[LessEqual[z, -1.35e-151], N[(N[(y / z), $MachinePrecision] * (-t) + x), $MachinePrecision], If[LessEqual[z, 1.35e-15], N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.9 \cdot 10^{+28}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-151}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z}, -t, x\right)\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -6.9e28 or 1.35000000000000005e-15 < z Initial program 78.9%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6481.8
Simplified81.8%
if -6.9e28 < z < -1.35000000000000004e-151Initial program 99.8%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6491.1
Applied egg-rr91.1%
Taylor expanded in z around 0
mul-1-negN/A
neg-lowering-neg.f6475.9
Simplified75.9%
Taylor expanded in z around inf
/-lowering-/.f6464.3
Simplified64.3%
if -1.35000000000000004e-151 < z < 1.35000000000000005e-15Initial program 94.9%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f6494.8
Applied egg-rr94.8%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6482.5
Simplified82.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.45e+30)
(+ y x)
(if (<= z -1.42e-83)
(fma y (/ t (- z)) x)
(if (<= z 1.4e-15) (fma t (/ y a) x) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.45e+30) {
tmp = y + x;
} else if (z <= -1.42e-83) {
tmp = fma(y, (t / -z), x);
} else if (z <= 1.4e-15) {
tmp = fma(t, (y / a), x);
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.45e+30) tmp = Float64(y + x); elseif (z <= -1.42e-83) tmp = fma(y, Float64(t / Float64(-z)), x); elseif (z <= 1.4e-15) tmp = fma(t, Float64(y / a), x); else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.45e+30], N[(y + x), $MachinePrecision], If[LessEqual[z, -1.42e-83], N[(y * N[(t / (-z)), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1.4e-15], N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.45 \cdot 10^{+30}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -1.42 \cdot 10^{-83}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{-z}, x\right)\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -4.45000000000000024e30 or 1.40000000000000007e-15 < z Initial program 78.9%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6481.8
Simplified81.8%
if -4.45000000000000024e30 < z < -1.4199999999999999e-83Initial program 99.8%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
div-subN/A
*-inversesN/A
--lowering--.f64N/A
/-lowering-/.f6476.7
Simplified76.7%
Taylor expanded in t around inf
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-lowering-neg.f6463.8
Simplified63.8%
if -1.4199999999999999e-83 < z < 1.40000000000000007e-15Initial program 95.4%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f6495.3
Applied egg-rr95.3%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6480.6
Simplified80.6%
Final simplification79.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ y (- z a)) (- t) x))) (if (<= t -1.75e+91) t_1 (if (<= t 1.25e+32) (fma y (/ z (- z a)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y / (z - a)), -t, x);
double tmp;
if (t <= -1.75e+91) {
tmp = t_1;
} else if (t <= 1.25e+32) {
tmp = fma(y, (z / (z - a)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y / Float64(z - a)), Float64(-t), x) tmp = 0.0 if (t <= -1.75e+91) tmp = t_1; elseif (t <= 1.25e+32) tmp = fma(y, Float64(z / Float64(z - a)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * (-t) + x), $MachinePrecision]}, If[LessEqual[t, -1.75e+91], t$95$1, If[LessEqual[t, 1.25e+32], N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{z - a}, -t, x\right)\\
\mathbf{if}\;t \leq -1.75 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+32}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{z - a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.75e91 or 1.2499999999999999e32 < t Initial program 86.2%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6495.8
Applied egg-rr95.8%
Taylor expanded in z around 0
mul-1-negN/A
neg-lowering-neg.f6489.2
Simplified89.2%
if -1.75e91 < t < 1.2499999999999999e32Initial program 88.1%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6492.9
Applied egg-rr92.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6488.2
Simplified88.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (- 1.0 (/ t z)) x))) (if (<= z -2.3e-151) t_1 (if (<= z 9.6e-55) (fma (- t z) (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (1.0 - (t / z)), x);
double tmp;
if (z <= -2.3e-151) {
tmp = t_1;
} else if (z <= 9.6e-55) {
tmp = fma((t - z), (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(1.0 - Float64(t / z)), x) tmp = 0.0 if (z <= -2.3e-151) tmp = t_1; elseif (z <= 9.6e-55) tmp = fma(Float64(t - z), Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -2.3e-151], t$95$1, If[LessEqual[z, 9.6e-55], N[(N[(t - z), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, 1 - \frac{t}{z}, x\right)\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{-151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{-55}:\\
\;\;\;\;\mathsf{fma}\left(t - z, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.29999999999999996e-151 or 9.59999999999999966e-55 < z Initial program 83.8%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
div-subN/A
*-inversesN/A
--lowering--.f64N/A
/-lowering-/.f6483.1
Simplified83.1%
if -2.29999999999999996e-151 < z < 9.59999999999999966e-55Initial program 94.4%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6496.6
Applied egg-rr96.6%
Taylor expanded in a around inf
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-lft-inN/A
mul-1-negN/A
unsub-negN/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
--lowering--.f64N/A
/-lowering-/.f6487.5
Simplified87.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (- 1.0 (/ t z)) x))) (if (<= z -1.6e-151) t_1 (if (<= z 7.4e-29) (fma t (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (1.0 - (t / z)), x);
double tmp;
if (z <= -1.6e-151) {
tmp = t_1;
} else if (z <= 7.4e-29) {
tmp = fma(t, (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(1.0 - Float64(t / z)), x) tmp = 0.0 if (z <= -1.6e-151) tmp = t_1; elseif (z <= 7.4e-29) tmp = fma(t, Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -1.6e-151], t$95$1, If[LessEqual[z, 7.4e-29], N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, 1 - \frac{t}{z}, x\right)\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{-151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{-29}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.60000000000000011e-151 or 7.3999999999999995e-29 < z Initial program 83.5%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
div-subN/A
*-inversesN/A
--lowering--.f64N/A
/-lowering-/.f6483.3
Simplified83.3%
if -1.60000000000000011e-151 < z < 7.3999999999999995e-29Initial program 94.6%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f6494.6
Applied egg-rr94.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6485.6
Simplified85.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.95e-14) (+ y x) (if (<= z 1.15e-15) (fma t (/ y a) x) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.95e-14) {
tmp = y + x;
} else if (z <= 1.15e-15) {
tmp = fma(t, (y / a), x);
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.95e-14) tmp = Float64(y + x); elseif (z <= 1.15e-15) tmp = fma(t, Float64(y / a), x); else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.95e-14], N[(y + x), $MachinePrecision], If[LessEqual[z, 1.15e-15], N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{-14}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -1.9499999999999999e-14 or 1.14999999999999995e-15 < z Initial program 79.8%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6480.2
Simplified80.2%
if -1.9499999999999999e-14 < z < 1.14999999999999995e-15Initial program 95.9%
+-commutativeN/A
clear-numN/A
associate-/r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f6495.9
Applied egg-rr95.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6474.9
Simplified74.9%
(FPCore (x y z t a) :precision binary64 (fma (/ y (- z a)) (- z t) x))
double code(double x, double y, double z, double t, double a) {
return fma((y / (z - a)), (z - t), x);
}
function code(x, y, z, t, a) return fma(Float64(y / Float64(z - a)), Float64(z - t), x) end
code[x_, y_, z_, t_, a_] := N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)
\end{array}
Initial program 87.4%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.0
Applied egg-rr94.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.48e+205) (/ (* y t) a) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.48e+205) {
tmp = (y * t) / a;
} 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 <= (-1.48d+205)) then
tmp = (y * t) / a
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 <= -1.48e+205) {
tmp = (y * t) / a;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.48e+205: tmp = (y * t) / a else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.48e+205) tmp = Float64(Float64(y * t) / a); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.48e+205) tmp = (y * t) / a; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.48e+205], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.48 \cdot 10^{+205}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.48e205Initial program 95.4%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6461.3
Simplified61.3%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6465.4
Simplified65.4%
if -1.48e205 < t Initial program 86.6%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6466.2
Simplified66.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -7e+203) (* y (/ t a)) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7e+203) {
tmp = y * (t / a);
} 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 <= (-7d+203)) then
tmp = y * (t / a)
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 <= -7e+203) {
tmp = y * (t / a);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7e+203: tmp = y * (t / a) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7e+203) tmp = Float64(y * Float64(t / a)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7e+203) tmp = y * (t / a); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7e+203], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+203}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -7.00000000000000062e203Initial program 95.4%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
neg-lowering-neg.f6474.7
Simplified74.7%
Taylor expanded in a around inf
Simplified57.1%
if -7.00000000000000062e203 < t Initial program 86.6%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6466.2
Simplified66.2%
(FPCore (x y z t a) :precision binary64 (+ y x))
double code(double x, double y, double z, double t, double a) {
return y + 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 = y + x
end function
public static double code(double x, double y, double z, double t, double a) {
return y + x;
}
def code(x, y, z, t, a): return y + x
function code(x, y, z, t, a) return Float64(y + x) end
function tmp = code(x, y, z, t, a) tmp = y + x; end
code[x_, y_, z_, t_, a_] := N[(y + x), $MachinePrecision]
\begin{array}{l}
\\
y + x
\end{array}
Initial program 87.4%
Taylor expanded in z around inf
+-commutativeN/A
+-lowering-+.f6461.7
Simplified61.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 87.4%
Taylor expanded in x around inf
Simplified45.8%
(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 2024205
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks 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))))