
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - 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 - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - 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 - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= t 7e-142) (fma (/ y (- a t)) (- z t) x) (fma (- 0.0 y) (* (- z t) (/ 1.0 (- t a))) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 7e-142) {
tmp = fma((y / (a - t)), (z - t), x);
} else {
tmp = fma((0.0 - y), ((z - t) * (1.0 / (t - a))), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= 7e-142) tmp = fma(Float64(y / Float64(a - t)), Float64(z - t), x); else tmp = fma(Float64(0.0 - y), Float64(Float64(z - t) * Float64(1.0 / Float64(t - a))), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 7e-142], N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision], N[(N[(0.0 - y), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] * N[(1.0 / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7 \cdot 10^{-142}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0 - y, \left(z - t\right) \cdot \frac{1}{t - a}, x\right)\\
\end{array}
\end{array}
if t < 7.00000000000000029e-142Initial program 84.1%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6498.6
Applied egg-rr98.6%
if 7.00000000000000029e-142 < t Initial program 85.4%
+-commutativeN/A
frac-2negN/A
div-invN/A
distribute-lft-neg-inN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6499.8
Applied egg-rr99.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -26500000000.0)
(+ y x)
(if (<= t 4.5e-96)
(fma z (/ y a) x)
(if (<= t 6.8e+168) (- x (/ (* y z) t)) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -26500000000.0) {
tmp = y + x;
} else if (t <= 4.5e-96) {
tmp = fma(z, (y / a), x);
} else if (t <= 6.8e+168) {
tmp = x - ((y * z) / t);
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -26500000000.0) tmp = Float64(y + x); elseif (t <= 4.5e-96) tmp = fma(z, Float64(y / a), x); elseif (t <= 6.8e+168) tmp = Float64(x - Float64(Float64(y * z) / t)); else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -26500000000.0], N[(y + x), $MachinePrecision], If[LessEqual[t, 4.5e-96], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 6.8e+168], N[(x - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -26500000000:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-96}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{+168}:\\
\;\;\;\;x - \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -2.65e10 or 6.80000000000000005e168 < t Initial program 73.6%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6475.5
Simplified75.5%
if -2.65e10 < t < 4.5e-96Initial program 92.0%
+-commutativeN/A
frac-2negN/A
div-invN/A
distribute-lft-neg-inN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6493.8
Applied egg-rr93.8%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6482.7
Simplified82.7%
if 4.5e-96 < t < 6.80000000000000005e168Initial program 89.0%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.4
Applied egg-rr94.4%
Taylor expanded in z around inf
Simplified77.9%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6472.5
Simplified72.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ y (- a t)) z x))) (if (<= z -2e+76) t_1 (if (<= z 3.9e-8) (fma y (/ t (- t a)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y / (a - t)), z, x);
double tmp;
if (z <= -2e+76) {
tmp = t_1;
} else if (z <= 3.9e-8) {
tmp = fma(y, (t / (t - a)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y / Float64(a - t)), z, x) tmp = 0.0 if (z <= -2e+76) tmp = t_1; elseif (z <= 3.9e-8) tmp = fma(y, Float64(t / Float64(t - a)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision]}, If[LessEqual[z, -2e+76], t$95$1, If[LessEqual[z, 3.9e-8], N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{a - t}, z, x\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{t - a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.0000000000000001e76 or 3.89999999999999985e-8 < z Initial program 85.0%
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6496.8
Applied egg-rr96.8%
Taylor expanded in z around inf
Simplified92.6%
if -2.0000000000000001e76 < z < 3.89999999999999985e-8Initial program 84.0%
+-commutativeN/A
frac-2negN/A
div-invN/A
distribute-lft-neg-inN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6499.1
Applied egg-rr99.1%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6490.3
Simplified90.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.2e-17) (fma y (/ t (- t a)) x) (if (<= t 4.8e-85) (fma y (/ (- z t) a) x) (fma y (- 1.0 (/ z t)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.2e-17) {
tmp = fma(y, (t / (t - a)), x);
} else if (t <= 4.8e-85) {
tmp = fma(y, ((z - t) / a), x);
} else {
tmp = fma(y, (1.0 - (z / t)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.2e-17) tmp = fma(y, Float64(t / Float64(t - a)), x); elseif (t <= 4.8e-85) tmp = fma(y, Float64(Float64(z - t) / a), x); else tmp = fma(y, Float64(1.0 - Float64(z / t)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.2e-17], N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 4.8e-85], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{t - a}, x\right)\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-85}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, 1 - \frac{z}{t}, x\right)\\
\end{array}
\end{array}
if t < -1.19999999999999993e-17Initial program 76.8%
+-commutativeN/A
frac-2negN/A
div-invN/A
distribute-lft-neg-inN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6499.9
Applied egg-rr99.9%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6482.1
Simplified82.1%
if -1.19999999999999993e-17 < t < 4.8000000000000001e-85Initial program 91.4%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6487.2
Simplified87.2%
if 4.8000000000000001e-85 < t Initial program 83.7%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6483.9
Simplified83.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -7e-61) (fma y (/ t (- t a)) x) (if (<= t 1.6e-94) (fma z (/ y a) x) (fma y (- 1.0 (/ z t)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7e-61) {
tmp = fma(y, (t / (t - a)), x);
} else if (t <= 1.6e-94) {
tmp = fma(z, (y / a), x);
} else {
tmp = fma(y, (1.0 - (z / t)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7e-61) tmp = fma(y, Float64(t / Float64(t - a)), x); elseif (t <= 1.6e-94) tmp = fma(z, Float64(y / a), x); else tmp = fma(y, Float64(1.0 - Float64(z / t)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7e-61], N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 1.6e-94], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{-61}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{t - a}, x\right)\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{-94}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, 1 - \frac{z}{t}, x\right)\\
\end{array}
\end{array}
if t < -7.0000000000000006e-61Initial program 78.8%
+-commutativeN/A
frac-2negN/A
div-invN/A
distribute-lft-neg-inN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6497.7
Applied egg-rr97.7%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6479.6
Simplified79.6%
if -7.0000000000000006e-61 < t < 1.59999999999999998e-94Initial program 90.4%
+-commutativeN/A
frac-2negN/A
div-invN/A
distribute-lft-neg-inN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6494.6
Applied egg-rr94.6%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6487.9
Simplified87.9%
if 1.59999999999999998e-94 < t Initial program 84.1%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6483.1
Simplified83.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (- 1.0 (/ z t)) x))) (if (<= t -3.2e-32) t_1 (if (<= t 1.75e-94) (fma 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 - (z / t)), x);
double tmp;
if (t <= -3.2e-32) {
tmp = t_1;
} else if (t <= 1.75e-94) {
tmp = fma(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(z / t)), x) tmp = 0.0 if (t <= -3.2e-32) tmp = t_1; elseif (t <= 1.75e-94) tmp = fma(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[(z / t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -3.2e-32], t$95$1, If[LessEqual[t, 1.75e-94], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, 1 - \frac{z}{t}, x\right)\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{-94}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.2000000000000002e-32 or 1.74999999999999999e-94 < t Initial program 81.0%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6480.7
Simplified80.7%
if -3.2000000000000002e-32 < t < 1.74999999999999999e-94Initial program 90.7%
+-commutativeN/A
frac-2negN/A
div-invN/A
distribute-lft-neg-inN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6492.7
Applied egg-rr92.7%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6486.2
Simplified86.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -290000000000.0) (+ y x) (if (<= t 7.8e+56) (fma z (/ y a) x) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -290000000000.0) {
tmp = y + x;
} else if (t <= 7.8e+56) {
tmp = fma(z, (y / a), x);
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -290000000000.0) tmp = Float64(y + x); elseif (t <= 7.8e+56) tmp = fma(z, Float64(y / a), x); else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -290000000000.0], N[(y + x), $MachinePrecision], If[LessEqual[t, 7.8e+56], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -290000000000:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -2.9e11 or 7.79999999999999989e56 < t Initial program 75.1%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6471.6
Simplified71.6%
if -2.9e11 < t < 7.79999999999999989e56Initial program 92.4%
+-commutativeN/A
frac-2negN/A
div-invN/A
distribute-lft-neg-inN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6495.1
Applied egg-rr95.1%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6476.1
Simplified76.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -7800000000.0) (+ y x) (if (<= t 5.9e+57) (fma y (/ z a) x) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7800000000.0) {
tmp = y + x;
} else if (t <= 5.9e+57) {
tmp = fma(y, (z / a), x);
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7800000000.0) tmp = Float64(y + x); elseif (t <= 5.9e+57) tmp = fma(y, Float64(z / a), x); else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7800000000.0], N[(y + x), $MachinePrecision], If[LessEqual[t, 5.9e+57], N[(y * N[(z / a), $MachinePrecision] + x), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7800000000:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 5.9 \cdot 10^{+57}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -7.8e9 or 5.90000000000000013e57 < t Initial program 75.1%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6471.6
Simplified71.6%
if -7.8e9 < t < 5.90000000000000013e57Initial program 92.4%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6473.8
Simplified73.8%
(FPCore (x y z t a) :precision binary64 (if (<= (/ (* y (- z t)) (- a t)) 2e+175) x y))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((y * (z - t)) / (a - t)) <= 2e+175) {
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 * (z - t)) / (a - t)) <= 2d+175) 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 * (z - t)) / (a - t)) <= 2e+175) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((y * (z - t)) / (a - t)) <= 2e+175: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(y * Float64(z - t)) / Float64(a - t)) <= 2e+175) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((y * (z - t)) / (a - t)) <= 2e+175) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], 2e+175], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq 2 \cdot 10^{+175}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 1.9999999999999999e175Initial program 93.0%
Taylor expanded in x around inf
Simplified58.2%
if 1.9999999999999999e175 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 37.3%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6438.9
Simplified38.9%
Taylor expanded in y around inf
Simplified33.0%
(FPCore (x y z t a) :precision binary64 (fma (/ y (- a t)) (- z t) x))
double code(double x, double y, double z, double t, double a) {
return fma((y / (a - t)), (z - t), x);
}
function code(x, y, z, t, a) return fma(Float64(y / Float64(a - t)), Float64(z - t), x) end
code[x_, y_, z_, t_, a_] := N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)
\end{array}
Initial program 84.5%
+-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%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.62e+31) (+ y x) (if (<= t 3.9e+31) x (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.62e+31) {
tmp = y + x;
} else if (t <= 3.9e+31) {
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 <= (-1.62d+31)) then
tmp = y + x
else if (t <= 3.9d+31) 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 <= -1.62e+31) {
tmp = y + x;
} else if (t <= 3.9e+31) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.62e+31: tmp = y + x elif t <= 3.9e+31: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.62e+31) tmp = Float64(y + x); elseif (t <= 3.9e+31) 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 <= -1.62e+31) tmp = y + x; elseif (t <= 3.9e+31) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.62e+31], N[(y + x), $MachinePrecision], If[LessEqual[t, 3.9e+31], x, N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.62 \cdot 10^{+31}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{+31}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.6199999999999999e31 or 3.89999999999999999e31 < t Initial program 74.2%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6469.4
Simplified69.4%
if -1.6199999999999999e31 < t < 3.89999999999999999e31Initial program 93.6%
Taylor expanded in x around inf
Simplified54.8%
(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 84.5%
Taylor expanded in x around inf
Simplified51.2%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2024195
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- a t) (- z t)))))
(+ x (/ (* y (- z t)) (- a t))))