
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
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 - x) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * ((t - x) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * ((t - x) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
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 - x) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * ((t - x) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * ((t - x) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- y z) (- a z)) (- t x) x))
(t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_2 -2e-247)
t_1
(if (<= t_2 0.0) (fma (/ (- t x) z) (- a y) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - z) / (a - z)), (t - x), x);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -2e-247) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = fma(((t - x) / z), (a - y), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - z) / Float64(a - z)), Float64(t - x), x) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= -2e-247) tmp = t_1; elseif (t_2 <= 0.0) tmp = fma(Float64(Float64(t - x) / z), Float64(a - y), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-247], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(a - y), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-247}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{z}, a - y, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2e-247 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 88.1%
+-commutativeN/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
flip3--N/A
clear-numN/A
clear-numN/A
flip3--N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
--lowering--.f6491.9
Applied egg-rr91.9%
if -2e-247 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 4.3%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
associate-+r+N/A
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
distribute-rgt-outN/A
accelerator-lowering-fma.f64N/A
Simplified98.9%
Final simplification92.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a (/ (- t x) z) t)))
(if (<= z -8.5e+105)
t_1
(if (<= z 3.2e-196)
(fma (/ y a) t x)
(if (<= z 106000000000.0) (fma (/ y a) (- x) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, ((t - x) / z), t);
double tmp;
if (z <= -8.5e+105) {
tmp = t_1;
} else if (z <= 3.2e-196) {
tmp = fma((y / a), t, x);
} else if (z <= 106000000000.0) {
tmp = fma((y / a), -x, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, Float64(Float64(t - x) / z), t) tmp = 0.0 if (z <= -8.5e+105) tmp = t_1; elseif (z <= 3.2e-196) tmp = fma(Float64(y / a), t, x); elseif (z <= 106000000000.0) tmp = fma(Float64(y / a), Float64(-x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -8.5e+105], t$95$1, If[LessEqual[z, 3.2e-196], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision], If[LessEqual[z, 106000000000.0], N[(N[(y / a), $MachinePrecision] * (-x) + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, \frac{t - x}{z}, t\right)\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-196}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\mathbf{elif}\;z \leq 106000000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, -x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.49999999999999986e105 or 1.06e11 < z Initial program 62.4%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
mul-1-negN/A
neg-lowering-neg.f6450.4
Simplified50.4%
Taylor expanded in z around inf
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6464.6
Simplified64.6%
if -8.49999999999999986e105 < z < 3.2e-196Initial program 91.9%
+-commutativeN/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
flip3--N/A
clear-numN/A
clear-numN/A
flip3--N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
--lowering--.f6494.3
Applied egg-rr94.3%
Taylor expanded in z around 0
/-lowering-/.f6472.7
Simplified72.7%
Taylor expanded in t around inf
Simplified64.0%
if 3.2e-196 < z < 1.06e11Initial program 88.4%
+-commutativeN/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
flip3--N/A
clear-numN/A
clear-numN/A
flip3--N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
--lowering--.f6490.1
Applied egg-rr90.1%
Taylor expanded in z around 0
/-lowering-/.f6462.0
Simplified62.0%
Taylor expanded in t around 0
mul-1-negN/A
neg-lowering-neg.f6457.7
Simplified57.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a (/ x (- z)) t)))
(if (<= z -7.5e+99)
t_1
(if (<= z 4e-196)
(fma (/ y a) t x)
(if (<= z 1.1e+15) (fma (/ y a) (- x) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, (x / -z), t);
double tmp;
if (z <= -7.5e+99) {
tmp = t_1;
} else if (z <= 4e-196) {
tmp = fma((y / a), t, x);
} else if (z <= 1.1e+15) {
tmp = fma((y / a), -x, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, Float64(x / Float64(-z)), t) tmp = 0.0 if (z <= -7.5e+99) tmp = t_1; elseif (z <= 4e-196) tmp = fma(Float64(y / a), t, x); elseif (z <= 1.1e+15) tmp = fma(Float64(y / a), Float64(-x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[(x / (-z)), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -7.5e+99], t$95$1, If[LessEqual[z, 4e-196], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision], If[LessEqual[z, 1.1e+15], N[(N[(y / a), $MachinePrecision] * (-x) + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, \frac{x}{-z}, t\right)\\
\mathbf{if}\;z \leq -7.5 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-196}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, -x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.49999999999999963e99 or 1.1e15 < z Initial program 62.4%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
mul-1-negN/A
neg-lowering-neg.f6450.4
Simplified50.4%
Taylor expanded in z around inf
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6464.6
Simplified64.6%
Taylor expanded in t around 0
mul-1-negN/A
neg-lowering-neg.f6464.5
Simplified64.5%
if -7.49999999999999963e99 < z < 4.0000000000000002e-196Initial program 91.9%
+-commutativeN/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
flip3--N/A
clear-numN/A
clear-numN/A
flip3--N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
--lowering--.f6494.3
Applied egg-rr94.3%
Taylor expanded in z around 0
/-lowering-/.f6472.7
Simplified72.7%
Taylor expanded in t around inf
Simplified64.0%
if 4.0000000000000002e-196 < z < 1.1e15Initial program 88.4%
+-commutativeN/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
flip3--N/A
clear-numN/A
clear-numN/A
flip3--N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
--lowering--.f6490.1
Applied egg-rr90.1%
Taylor expanded in z around 0
/-lowering-/.f6462.0
Simplified62.0%
Taylor expanded in t around 0
mul-1-negN/A
neg-lowering-neg.f6457.7
Simplified57.7%
Final simplification62.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) a) x)))
(if (<= a -8.2e-5)
t_1
(if (<= a 6.2e-90) (+ t (/ (* (- t x) (- a y)) z)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / a), x);
double tmp;
if (a <= -8.2e-5) {
tmp = t_1;
} else if (a <= 6.2e-90) {
tmp = t + (((t - x) * (a - y)) / z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / a), x) tmp = 0.0 if (a <= -8.2e-5) tmp = t_1; elseif (a <= 6.2e-90) tmp = Float64(t + Float64(Float64(Float64(t - x) * Float64(a - y)) / z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -8.2e-5], t$95$1, If[LessEqual[a, 6.2e-90], N[(t + N[(N[(N[(t - x), $MachinePrecision] * N[(a - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -8.2 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{-90}:\\
\;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -8.20000000000000009e-5 or 6.2000000000000003e-90 < a Initial program 88.0%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6475.9
Simplified75.9%
if -8.20000000000000009e-5 < a < 6.2000000000000003e-90Initial program 71.4%
+-commutativeN/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
flip3--N/A
clear-numN/A
clear-numN/A
flip3--N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
--lowering--.f6478.0
Applied egg-rr78.0%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
distribute-rgt-out--N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6479.6
Simplified79.6%
Final simplification77.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y z) (/ (- t x) a) x)))
(if (<= a -0.000108)
t_1
(if (<= a 1.1e-89) (fma (/ (- t x) z) (- a y) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - z), ((t - x) / a), x);
double tmp;
if (a <= -0.000108) {
tmp = t_1;
} else if (a <= 1.1e-89) {
tmp = fma(((t - x) / z), (a - y), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - z), Float64(Float64(t - x) / a), x) tmp = 0.0 if (a <= -0.000108) tmp = t_1; elseif (a <= 1.1e-89) tmp = fma(Float64(Float64(t - x) / z), Float64(a - y), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -0.000108], t$95$1, If[LessEqual[a, 1.1e-89], N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(a - y), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -0.000108:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{-89}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{z}, a - y, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.08e-4 or 1.10000000000000006e-89 < a Initial program 88.0%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6475.9
Simplified75.9%
if -1.08e-4 < a < 1.10000000000000006e-89Initial program 71.4%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
associate-+r+N/A
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
distribute-rgt-outN/A
accelerator-lowering-fma.f64N/A
Simplified80.6%
Final simplification77.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a (/ (- t x) z) t)))
(if (<= z -5e+103)
t_1
(if (<= z 1.46e+94) (fma (- y z) (/ (- t x) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, ((t - x) / z), t);
double tmp;
if (z <= -5e+103) {
tmp = t_1;
} else if (z <= 1.46e+94) {
tmp = fma((y - z), ((t - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, Float64(Float64(t - x) / z), t) tmp = 0.0 if (z <= -5e+103) tmp = t_1; elseif (z <= 1.46e+94) tmp = fma(Float64(y - z), Float64(Float64(t - x) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -5e+103], t$95$1, If[LessEqual[z, 1.46e+94], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, \frac{t - x}{z}, t\right)\\
\mathbf{if}\;z \leq -5 \cdot 10^{+103}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.46 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5e103 or 1.46000000000000005e94 < z Initial program 57.5%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
mul-1-negN/A
neg-lowering-neg.f6451.9
Simplified51.9%
Taylor expanded in z around inf
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6471.5
Simplified71.5%
if -5e103 < z < 1.46000000000000005e94Initial program 90.1%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6470.5
Simplified70.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma a (/ (- t x) z) t))) (if (<= z -2.3e+102) t_1 (if (<= z 2.35e+94) (fma (/ y a) (- t x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, ((t - x) / z), t);
double tmp;
if (z <= -2.3e+102) {
tmp = t_1;
} else if (z <= 2.35e+94) {
tmp = fma((y / a), (t - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, Float64(Float64(t - x) / z), t) tmp = 0.0 if (z <= -2.3e+102) tmp = t_1; elseif (z <= 2.35e+94) tmp = fma(Float64(y / a), Float64(t - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -2.3e+102], t$95$1, If[LessEqual[z, 2.35e+94], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, \frac{t - x}{z}, t\right)\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.2999999999999999e102 or 2.35000000000000008e94 < z Initial program 57.5%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
mul-1-negN/A
neg-lowering-neg.f6451.9
Simplified51.9%
Taylor expanded in z around inf
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6471.5
Simplified71.5%
if -2.2999999999999999e102 < z < 2.35000000000000008e94Initial program 90.1%
+-commutativeN/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
flip3--N/A
clear-numN/A
clear-numN/A
flip3--N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
--lowering--.f6492.0
Applied egg-rr92.0%
Taylor expanded in z around 0
/-lowering-/.f6466.9
Simplified66.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma a (/ (- t x) z) t))) (if (<= z -1.3e+100) t_1 (if (<= z 1.35e+94) (fma y (/ (- t x) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, ((t - x) / z), t);
double tmp;
if (z <= -1.3e+100) {
tmp = t_1;
} else if (z <= 1.35e+94) {
tmp = fma(y, ((t - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, Float64(Float64(t - x) / z), t) tmp = 0.0 if (z <= -1.3e+100) tmp = t_1; elseif (z <= 1.35e+94) tmp = fma(y, Float64(Float64(t - x) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.3e+100], t$95$1, If[LessEqual[z, 1.35e+94], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, \frac{t - x}{z}, t\right)\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.3000000000000001e100 or 1.3500000000000001e94 < z Initial program 57.5%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
mul-1-negN/A
neg-lowering-neg.f6451.9
Simplified51.9%
Taylor expanded in z around inf
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6471.5
Simplified71.5%
if -1.3000000000000001e100 < z < 1.3500000000000001e94Initial program 90.1%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6466.7
Simplified66.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma a (/ x (- z)) t))) (if (<= z -1.65e+100) t_1 (if (<= z 2e+94) (fma (/ y a) t x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, (x / -z), t);
double tmp;
if (z <= -1.65e+100) {
tmp = t_1;
} else if (z <= 2e+94) {
tmp = fma((y / a), t, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, Float64(x / Float64(-z)), t) tmp = 0.0 if (z <= -1.65e+100) tmp = t_1; elseif (z <= 2e+94) tmp = fma(Float64(y / a), t, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[(x / (-z)), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1.65e+100], t$95$1, If[LessEqual[z, 2e+94], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, \frac{x}{-z}, t\right)\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.6500000000000001e100 or 2e94 < z Initial program 57.5%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
mul-1-negN/A
neg-lowering-neg.f6451.9
Simplified51.9%
Taylor expanded in z around inf
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6471.5
Simplified71.5%
Taylor expanded in t around 0
mul-1-negN/A
neg-lowering-neg.f6471.3
Simplified71.3%
if -1.6500000000000001e100 < z < 2e94Initial program 90.1%
+-commutativeN/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
flip3--N/A
clear-numN/A
clear-numN/A
flip3--N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
--lowering--.f6492.0
Applied egg-rr92.0%
Taylor expanded in z around 0
/-lowering-/.f6466.9
Simplified66.9%
Taylor expanded in t around inf
Simplified56.7%
Final simplification60.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma a (/ t z) t))) (if (<= z -2.4e+108) t_1 (if (<= z 3e+94) (fma (/ y a) t x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, (t / z), t);
double tmp;
if (z <= -2.4e+108) {
tmp = t_1;
} else if (z <= 3e+94) {
tmp = fma((y / a), t, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, Float64(t / z), t) tmp = 0.0 if (z <= -2.4e+108) tmp = t_1; elseif (z <= 3e+94) tmp = fma(Float64(y / a), t, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[(t / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -2.4e+108], t$95$1, If[LessEqual[z, 3e+94], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, \frac{t}{z}, t\right)\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.40000000000000019e108 or 3.0000000000000001e94 < z Initial program 58.3%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
mul-1-negN/A
neg-lowering-neg.f6452.7
Simplified52.7%
Taylor expanded in z around inf
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f6471.1
Simplified71.1%
Taylor expanded in t around inf
Simplified63.4%
if -2.40000000000000019e108 < z < 3.0000000000000001e94Initial program 89.6%
+-commutativeN/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
flip3--N/A
clear-numN/A
clear-numN/A
flip3--N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
--lowering--.f6491.6
Applied egg-rr91.6%
Taylor expanded in z around 0
/-lowering-/.f6466.5
Simplified66.5%
Taylor expanded in t around inf
Simplified56.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* t (/ y a)))) (if (<= y -1.6e+168) t_1 (if (<= y 1.15e+201) (+ x t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / a);
double tmp;
if (y <= -1.6e+168) {
tmp = t_1;
} else if (y <= 1.15e+201) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = t * (y / a)
if (y <= (-1.6d+168)) then
tmp = t_1
else if (y <= 1.15d+201) then
tmp = x + t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / a);
double tmp;
if (y <= -1.6e+168) {
tmp = t_1;
} else if (y <= 1.15e+201) {
tmp = x + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (y / a) tmp = 0 if y <= -1.6e+168: tmp = t_1 elif y <= 1.15e+201: tmp = x + t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y / a)) tmp = 0.0 if (y <= -1.6e+168) tmp = t_1; elseif (y <= 1.15e+201) tmp = Float64(x + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (y / a); tmp = 0.0; if (y <= -1.6e+168) tmp = t_1; elseif (y <= 1.15e+201) tmp = x + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.6e+168], t$95$1, If[LessEqual[y, 1.15e+201], N[(x + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{a}\\
\mathbf{if}\;y \leq -1.6 \cdot 10^{+168}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+201}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.6000000000000001e168 or 1.1500000000000001e201 < y Initial program 90.3%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6434.9
Simplified34.9%
Taylor expanded in a around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6442.8
Simplified42.8%
Taylor expanded in y around inf
/-lowering-/.f6443.0
Simplified43.0%
if -1.6000000000000001e168 < y < 1.1500000000000001e201Initial program 78.8%
Taylor expanded in z around inf
--lowering--.f6424.5
Simplified24.5%
Taylor expanded in t around inf
Simplified49.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.6e+107) t (if (<= z 5.7e-129) x (if (<= z 1.22e+91) (+ x t) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e+107) {
tmp = t;
} else if (z <= 5.7e-129) {
tmp = x;
} else if (z <= 1.22e+91) {
tmp = x + t;
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.6d+107)) then
tmp = t
else if (z <= 5.7d-129) then
tmp = x
else if (z <= 1.22d+91) then
tmp = x + t
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e+107) {
tmp = t;
} else if (z <= 5.7e-129) {
tmp = x;
} else if (z <= 1.22e+91) {
tmp = x + t;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.6e+107: tmp = t elif z <= 5.7e-129: tmp = x elif z <= 1.22e+91: tmp = x + t else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e+107) tmp = t; elseif (z <= 5.7e-129) tmp = x; elseif (z <= 1.22e+91) tmp = Float64(x + t); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.6e+107) tmp = t; elseif (z <= 5.7e-129) tmp = x; elseif (z <= 1.22e+91) tmp = x + t; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e+107], t, If[LessEqual[z, 5.7e-129], x, If[LessEqual[z, 1.22e+91], N[(x + t), $MachinePrecision], t]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+107}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 5.7 \cdot 10^{-129}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.22 \cdot 10^{+91}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -1.60000000000000015e107 or 1.2199999999999999e91 < z Initial program 58.8%
Taylor expanded in z around inf
Simplified62.4%
if -1.60000000000000015e107 < z < 5.7000000000000001e-129Initial program 92.3%
Taylor expanded in a around inf
Simplified42.6%
if 5.7000000000000001e-129 < z < 1.2199999999999999e91Initial program 82.6%
Taylor expanded in z around inf
--lowering--.f6417.5
Simplified17.5%
Taylor expanded in t around inf
Simplified39.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.8e+108) t (if (<= z 0.0225) x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e+108) {
tmp = t;
} else if (z <= 0.0225) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.8d+108)) then
tmp = t
else if (z <= 0.0225d0) then
tmp = x
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e+108) {
tmp = t;
} else if (z <= 0.0225) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.8e+108: tmp = t elif z <= 0.0225: tmp = x else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.8e+108) tmp = t; elseif (z <= 0.0225) tmp = x; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.8e+108) tmp = t; elseif (z <= 0.0225) tmp = x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.8e+108], t, If[LessEqual[z, 0.0225], x, t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+108}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \leq 0.0225:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < -2.7999999999999998e108 or 0.022499999999999999 < z Initial program 64.2%
Taylor expanded in z around inf
Simplified54.4%
if -2.7999999999999998e108 < z < 0.022499999999999999Initial program 90.1%
Taylor expanded in a around inf
Simplified40.6%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return 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 = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 80.9%
Taylor expanded in z around inf
Simplified25.1%
herbie shell --seed 2024198
(FPCore (x y z t a)
:name "Numeric.Signal:interpolate from hsignal-0.2.7.1"
:precision binary64
(+ x (* (- y z) (/ (- t x) (- a z)))))