
(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 17 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 -1e-283)
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 <= -1e-283) {
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 <= -1e-283) 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, -1e-283], 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 -1 \cdot 10^{-283}:\\
\;\;\;\;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)))) < -9.99999999999999947e-284 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 93.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6495.8
Applied rewrites95.8%
if -9.99999999999999947e-284 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 3.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
lower-fma.f64N/A
Applied rewrites99.8%
Final simplification96.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ (- t x) a)))
(t_2 (+ x (* (- y z) (/ (- t x) (- a z)))))
(t_3 (+ x (/ (* y t) a))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -1e-283)
t_3
(if (<= t_2 1e-301)
(/ (* x (- y a)) z)
(if (<= t_2 5e+298) t_3 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((t - x) / a);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double t_3 = x + ((y * t) / a);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -1e-283) {
tmp = t_3;
} else if (t_2 <= 1e-301) {
tmp = (x * (y - a)) / z;
} else if (t_2 <= 5e+298) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((t - x) / a);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double t_3 = x + ((y * t) / a);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -1e-283) {
tmp = t_3;
} else if (t_2 <= 1e-301) {
tmp = (x * (y - a)) / z;
} else if (t_2 <= 5e+298) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((t - x) / a) t_2 = x + ((y - z) * ((t - x) / (a - z))) t_3 = x + ((y * t) / a) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -1e-283: tmp = t_3 elif t_2 <= 1e-301: tmp = (x * (y - a)) / z elif t_2 <= 5e+298: tmp = t_3 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(t - x) / a)) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) t_3 = Float64(x + Float64(Float64(y * t) / a)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -1e-283) tmp = t_3; elseif (t_2 <= 1e-301) tmp = Float64(Float64(x * Float64(y - a)) / z); elseif (t_2 <= 5e+298) tmp = t_3; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((t - x) / a); t_2 = x + ((y - z) * ((t - x) / (a - z))); t_3 = x + ((y * t) / a); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= -1e-283) tmp = t_3; elseif (t_2 <= 1e-301) tmp = (x * (y - a)) / z; elseif (t_2 <= 5e+298) tmp = t_3; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -1e-283], t$95$3, If[LessEqual[t$95$2, 1e-301], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$2, 5e+298], t$95$3, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{t - x}{a}\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
t_3 := x + \frac{y \cdot t}{a}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-283}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 10^{-301}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+298}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0 or 5.0000000000000003e298 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 89.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f64100.0
Applied rewrites100.0%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6495.5
Applied rewrites95.5%
Taylor expanded in a around inf
Applied rewrites76.9%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.99999999999999947e-284 or 1.00000000000000007e-301 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.0000000000000003e298Initial program 95.1%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6451.4
Applied rewrites51.4%
Taylor expanded in t around inf
Applied rewrites49.0%
if -9.99999999999999947e-284 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000007e-301Initial program 3.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6410.3
Applied rewrites10.3%
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
lower--.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites88.7%
Taylor expanded in t around 0
Applied rewrites46.8%
Final simplification53.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ (- t x) a)))
(t_2 (+ x (* (- y z) (/ (- t x) (- a z)))))
(t_3 (- x (* x (/ y a)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -2e-285)
t_3
(if (<= t_2 1e-301)
(/ (* x (- y a)) z)
(if (<= t_2 5e+298) t_3 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((t - x) / a);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double t_3 = x - (x * (y / a));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -2e-285) {
tmp = t_3;
} else if (t_2 <= 1e-301) {
tmp = (x * (y - a)) / z;
} else if (t_2 <= 5e+298) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((t - x) / a);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double t_3 = x - (x * (y / a));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -2e-285) {
tmp = t_3;
} else if (t_2 <= 1e-301) {
tmp = (x * (y - a)) / z;
} else if (t_2 <= 5e+298) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((t - x) / a) t_2 = x + ((y - z) * ((t - x) / (a - z))) t_3 = x - (x * (y / a)) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -2e-285: tmp = t_3 elif t_2 <= 1e-301: tmp = (x * (y - a)) / z elif t_2 <= 5e+298: tmp = t_3 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(t - x) / a)) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) t_3 = Float64(x - Float64(x * Float64(y / a))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -2e-285) tmp = t_3; elseif (t_2 <= 1e-301) tmp = Float64(Float64(x * Float64(y - a)) / z); elseif (t_2 <= 5e+298) tmp = t_3; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((t - x) / a); t_2 = x + ((y - z) * ((t - x) / (a - z))); t_3 = x - (x * (y / a)); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= -2e-285) tmp = t_3; elseif (t_2 <= 1e-301) tmp = (x * (y - a)) / z; elseif (t_2 <= 5e+298) tmp = t_3; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x - N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -2e-285], t$95$3, If[LessEqual[t$95$2, 1e-301], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$2, 5e+298], t$95$3, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{t - x}{a}\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
t_3 := x - x \cdot \frac{y}{a}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-285}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 10^{-301}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+298}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0 or 5.0000000000000003e298 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 89.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f64100.0
Applied rewrites100.0%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6495.5
Applied rewrites95.5%
Taylor expanded in a around inf
Applied rewrites76.9%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.00000000000000015e-285 or 1.00000000000000007e-301 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5.0000000000000003e298Initial program 94.6%
Taylor expanded in x around inf
+-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f6451.3
Applied rewrites51.3%
Taylor expanded in z around 0
Applied rewrites44.6%
if -2.00000000000000015e-285 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000007e-301Initial program 3.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f648.1
Applied rewrites8.1%
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
lower--.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites88.4%
Taylor expanded in t around 0
Applied rewrites47.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a (/ (- t x) z) t)))
(if (<= z -2.15e+102)
t_1
(if (<= z 1.52e+40)
(fma (/ y a) (- t x) x)
(if (<= z 4.8e+147)
(/ (* (- y z) t) (- a z))
(if (<= z 5.1e+191) (* y (/ (- x t) z)) 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.15e+102) {
tmp = t_1;
} else if (z <= 1.52e+40) {
tmp = fma((y / a), (t - x), x);
} else if (z <= 4.8e+147) {
tmp = ((y - z) * t) / (a - z);
} else if (z <= 5.1e+191) {
tmp = y * ((x - t) / z);
} 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.15e+102) tmp = t_1; elseif (z <= 1.52e+40) tmp = fma(Float64(y / a), Float64(t - x), x); elseif (z <= 4.8e+147) tmp = Float64(Float64(Float64(y - z) * t) / Float64(a - z)); elseif (z <= 5.1e+191) tmp = Float64(y * Float64(Float64(x - t) / z)); 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.15e+102], t$95$1, If[LessEqual[z, 1.52e+40], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 4.8e+147], N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.1e+191], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $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.15 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.52 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+147}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{+191}:\\
\;\;\;\;y \cdot \frac{x - t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.15e102 or 5.09999999999999982e191 < z Initial program 50.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6458.4
Applied rewrites58.4%
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
lower--.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites74.7%
Taylor expanded in y around 0
Applied rewrites71.3%
if -2.15e102 < z < 1.5199999999999999e40Initial program 91.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6492.7
Applied rewrites92.7%
Taylor expanded in z around 0
lower-/.f6472.4
Applied rewrites72.4%
if 1.5199999999999999e40 < z < 4.80000000000000004e147Initial program 93.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6464.9
Applied rewrites64.9%
if 4.80000000000000004e147 < z < 5.09999999999999982e191Initial program 48.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6448.8
Applied rewrites48.8%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6443.0
Applied rewrites43.0%
Taylor expanded in a around 0
Applied rewrites55.8%
Final simplification70.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t x) z) (- a y) t)))
(if (<= z -6.2e+99)
t_1
(if (<= z 4.4e+48)
(fma (/ y (- a z)) (- t x) x)
(if (<= z 1.42e+135) (+ x (* t (/ (- y z) a))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - x) / z), (a - y), t);
double tmp;
if (z <= -6.2e+99) {
tmp = t_1;
} else if (z <= 4.4e+48) {
tmp = fma((y / (a - z)), (t - x), x);
} else if (z <= 1.42e+135) {
tmp = x + (t * ((y - z) / a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - x) / z), Float64(a - y), t) tmp = 0.0 if (z <= -6.2e+99) tmp = t_1; elseif (z <= 4.4e+48) tmp = fma(Float64(y / Float64(a - z)), Float64(t - x), x); elseif (z <= 1.42e+135) tmp = Float64(x + Float64(t * Float64(Float64(y - z) / a))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(a - y), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -6.2e+99], t$95$1, If[LessEqual[z, 4.4e+48], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1.42e+135], N[(x + N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - x}{z}, a - y, t\right)\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+48}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - z}, t - x, x\right)\\
\mathbf{elif}\;z \leq 1.42 \cdot 10^{+135}:\\
\;\;\;\;x + t \cdot \frac{y - z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.2000000000000001e99 or 1.41999999999999998e135 < z Initial program 50.7%
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
lower-fma.f64N/A
Applied rewrites85.7%
if -6.2000000000000001e99 < z < 4.3999999999999999e48Initial program 91.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6492.7
Applied rewrites92.7%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6480.9
Applied rewrites80.9%
if 4.3999999999999999e48 < z < 1.41999999999999998e135Initial program 93.1%
Taylor expanded in a around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6454.5
Applied rewrites54.5%
Taylor expanded in t around inf
Applied rewrites61.7%
Taylor expanded in t around inf
Applied rewrites74.3%
Final simplification82.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a (/ (- t x) z) t)))
(if (<= z -2.15e+102)
t_1
(if (<= z 3e+59)
(fma (/ y a) (- t x) x)
(if (<= z 2e+140) (+ x (/ (* t (- z)) a)) 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.15e+102) {
tmp = t_1;
} else if (z <= 3e+59) {
tmp = fma((y / a), (t - x), x);
} else if (z <= 2e+140) {
tmp = x + ((t * -z) / a);
} 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.15e+102) tmp = t_1; elseif (z <= 3e+59) tmp = fma(Float64(y / a), Float64(t - x), x); elseif (z <= 2e+140) tmp = Float64(x + Float64(Float64(t * Float64(-z)) / a)); 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.15e+102], t$95$1, If[LessEqual[z, 3e+59], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 2e+140], N[(x + N[(N[(t * (-z)), $MachinePrecision] / a), $MachinePrecision]), $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.15 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+59}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+140}:\\
\;\;\;\;x + \frac{t \cdot \left(-z\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.15e102 or 2.00000000000000012e140 < z Initial program 50.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6457.1
Applied rewrites57.1%
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
lower--.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites72.5%
Taylor expanded in y around 0
Applied rewrites62.6%
if -2.15e102 < z < 3e59Initial program 91.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6492.8
Applied rewrites92.8%
Taylor expanded in z around 0
lower-/.f6472.2
Applied rewrites72.2%
if 3e59 < z < 2.00000000000000012e140Initial program 92.6%
Taylor expanded in a around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6451.3
Applied rewrites51.3%
Taylor expanded in t around inf
Applied rewrites59.0%
Taylor expanded in y around 0
Applied rewrites59.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ (- x t) z) t)))
(if (<= z -6.2e+99)
t_1
(if (<= z -1.55e-116)
(+ x (* t (/ (- y z) a)))
(if (<= z 1e+28) (fma (/ y a) (- t x) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, ((x - t) / z), t);
double tmp;
if (z <= -6.2e+99) {
tmp = t_1;
} else if (z <= -1.55e-116) {
tmp = x + (t * ((y - z) / a));
} else if (z <= 1e+28) {
tmp = fma((y / a), (t - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(Float64(x - t) / z), t) tmp = 0.0 if (z <= -6.2e+99) tmp = t_1; elseif (z <= -1.55e-116) tmp = Float64(x + Float64(t * Float64(Float64(y - z) / a))); elseif (z <= 1e+28) 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[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -6.2e+99], t$95$1, If[LessEqual[z, -1.55e-116], N[(x + N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+28], 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(y, \frac{x - t}{z}, t\right)\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-116}:\\
\;\;\;\;x + t \cdot \frac{y - z}{a}\\
\mathbf{elif}\;z \leq 10^{+28}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.2000000000000001e99 or 9.99999999999999958e27 < z Initial program 58.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6463.6
Applied rewrites63.6%
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
lower--.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites67.4%
Taylor expanded in a around 0
Applied rewrites71.3%
if -6.2000000000000001e99 < z < -1.55000000000000009e-116Initial program 83.0%
Taylor expanded in a around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6457.9
Applied rewrites57.9%
Taylor expanded in t around inf
Applied rewrites58.3%
Taylor expanded in t around inf
Applied rewrites60.3%
if -1.55000000000000009e-116 < z < 9.99999999999999958e27Initial program 95.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6495.6
Applied rewrites95.6%
Taylor expanded in z around 0
lower-/.f6482.2
Applied rewrites82.2%
Final simplification73.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ (- x t) z) t)))
(if (<= z -2.15e+102)
t_1
(if (<= z 2.9e+28) (fma (/ y (- a z)) (- t x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, ((x - t) / z), t);
double tmp;
if (z <= -2.15e+102) {
tmp = t_1;
} else if (z <= 2.9e+28) {
tmp = fma((y / (a - z)), (t - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(Float64(x - t) / z), t) tmp = 0.0 if (z <= -2.15e+102) tmp = t_1; elseif (z <= 2.9e+28) tmp = fma(Float64(y / Float64(a - z)), Float64(t - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -2.15e+102], t$95$1, If[LessEqual[z, 2.9e+28], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{x - t}{z}, t\right)\\
\mathbf{if}\;z \leq -2.15 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+28}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - z}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.15e102 or 2.9000000000000001e28 < z Initial program 58.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6463.6
Applied rewrites63.6%
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
lower--.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites67.4%
Taylor expanded in a around 0
Applied rewrites71.3%
if -2.15e102 < z < 2.9000000000000001e28Initial program 91.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6492.9
Applied rewrites92.9%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6481.8
Applied rewrites81.8%
Final simplification77.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ (- x t) z) t)))
(if (<= z -6.4e+99)
t_1
(if (<= z 1.42e+135) (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(y, ((x - t) / z), t);
double tmp;
if (z <= -6.4e+99) {
tmp = t_1;
} else if (z <= 1.42e+135) {
tmp = fma((y - z), ((t - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(Float64(x - t) / z), t) tmp = 0.0 if (z <= -6.4e+99) tmp = t_1; elseif (z <= 1.42e+135) 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[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -6.4e+99], t$95$1, If[LessEqual[z, 1.42e+135], 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(y, \frac{x - t}{z}, t\right)\\
\mathbf{if}\;z \leq -6.4 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.42 \cdot 10^{+135}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.39999999999999999e99 or 1.41999999999999998e135 < z Initial program 50.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6457.1
Applied rewrites57.1%
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
lower--.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites72.5%
Taylor expanded in a around 0
Applied rewrites77.0%
if -6.39999999999999999e99 < z < 1.41999999999999998e135Initial program 91.7%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6476.7
Applied rewrites76.7%
Final simplification76.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (/ (- x t) z) t))) (if (<= z -6.2e+99) t_1 (if (<= z 1e+28) (fma (/ y a) (- t x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, ((x - t) / z), t);
double tmp;
if (z <= -6.2e+99) {
tmp = t_1;
} else if (z <= 1e+28) {
tmp = fma((y / a), (t - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(Float64(x - t) / z), t) tmp = 0.0 if (z <= -6.2e+99) tmp = t_1; elseif (z <= 1e+28) 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[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -6.2e+99], t$95$1, If[LessEqual[z, 1e+28], 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(y, \frac{x - t}{z}, t\right)\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{+28}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.2000000000000001e99 or 9.99999999999999958e27 < z Initial program 58.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6463.6
Applied rewrites63.6%
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
lower--.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites67.4%
Taylor expanded in a around 0
Applied rewrites71.3%
if -6.2000000000000001e99 < z < 9.99999999999999958e27Initial program 91.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6492.9
Applied rewrites92.9%
Taylor expanded in z around 0
lower-/.f6472.7
Applied rewrites72.7%
Final simplification72.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a (/ (- t x) z) t)))
(if (<= z -2.15e+102)
t_1
(if (<= z 1.88e+140) (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.15e+102) {
tmp = t_1;
} else if (z <= 1.88e+140) {
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.15e+102) tmp = t_1; elseif (z <= 1.88e+140) 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.15e+102], t$95$1, If[LessEqual[z, 1.88e+140], 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.15 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.88 \cdot 10^{+140}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.15e102 or 1.88e140 < z Initial program 50.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6457.1
Applied rewrites57.1%
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
lower--.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites72.5%
Taylor expanded in y around 0
Applied rewrites62.6%
if -2.15e102 < z < 1.88e140Initial program 91.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6492.8
Applied rewrites92.8%
Taylor expanded in z around 0
lower-/.f6468.6
Applied rewrites68.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a (/ (- t x) z) t)))
(if (<= z -2.15e+102)
t_1
(if (<= z 1.88e+140) (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 <= -2.15e+102) {
tmp = t_1;
} else if (z <= 1.88e+140) {
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 <= -2.15e+102) tmp = t_1; elseif (z <= 1.88e+140) 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, -2.15e+102], t$95$1, If[LessEqual[z, 1.88e+140], 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 -2.15 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.88 \cdot 10^{+140}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.15e102 or 1.88e140 < z Initial program 50.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6457.1
Applied rewrites57.1%
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
lower--.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites72.5%
Taylor expanded in y around 0
Applied rewrites62.6%
if -2.15e102 < z < 1.88e140Initial program 91.7%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6467.9
Applied rewrites67.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.85e+115) (+ x (- t x)) (if (<= z 3.7e+145) (- x (* x (/ y a))) (/ (* x (- y a)) z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e+115) {
tmp = x + (t - x);
} else if (z <= 3.7e+145) {
tmp = x - (x * (y / a));
} else {
tmp = (x * (y - a)) / z;
}
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.85d+115)) then
tmp = x + (t - x)
else if (z <= 3.7d+145) then
tmp = x - (x * (y / a))
else
tmp = (x * (y - a)) / z
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.85e+115) {
tmp = x + (t - x);
} else if (z <= 3.7e+145) {
tmp = x - (x * (y / a));
} else {
tmp = (x * (y - a)) / z;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.85e+115: tmp = x + (t - x) elif z <= 3.7e+145: tmp = x - (x * (y / a)) else: tmp = (x * (y - a)) / z return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.85e+115) tmp = Float64(x + Float64(t - x)); elseif (z <= 3.7e+145) tmp = Float64(x - Float64(x * Float64(y / a))); else tmp = Float64(Float64(x * Float64(y - a)) / z); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.85e+115) tmp = x + (t - x); elseif (z <= 3.7e+145) tmp = x - (x * (y / a)); else tmp = (x * (y - a)) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.85e+115], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e+145], N[(x - N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+115}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+145}:\\
\;\;\;\;x - x \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\
\end{array}
\end{array}
if z < -1.85000000000000003e115Initial program 60.2%
Taylor expanded in z around inf
lower--.f6445.4
Applied rewrites45.4%
if -1.85000000000000003e115 < z < 3.69999999999999993e145Initial program 91.3%
Taylor expanded in x around inf
+-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f6455.4
Applied rewrites55.4%
Taylor expanded in z around 0
Applied rewrites50.8%
if 3.69999999999999993e145 < z Initial program 41.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6448.8
Applied rewrites48.8%
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
lower--.f64N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites70.1%
Taylor expanded in t around 0
Applied rewrites29.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.15e+115) (+ x (- t x)) (fma y (/ (- t x) a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.15e+115) {
tmp = x + (t - x);
} else {
tmp = fma(y, ((t - x) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.15e+115) tmp = Float64(x + Float64(t - x)); else tmp = fma(y, Float64(Float64(t - x) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.15e+115], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+115}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\end{array}
\end{array}
if z < -2.1499999999999998e115Initial program 60.2%
Taylor expanded in z around inf
lower--.f6445.4
Applied rewrites45.4%
if -2.1499999999999998e115 < z Initial program 82.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6459.0
Applied rewrites59.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.85e+115) (+ x (- t x)) (- x (* x (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e+115) {
tmp = x + (t - x);
} else {
tmp = x - (x * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.85d+115)) then
tmp = x + (t - x)
else
tmp = x - (x * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e+115) {
tmp = x + (t - x);
} else {
tmp = x - (x * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.85e+115: tmp = x + (t - x) else: tmp = x - (x * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.85e+115) tmp = Float64(x + Float64(t - x)); else tmp = Float64(x - Float64(x * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.85e+115) tmp = x + (t - x); else tmp = x - (x * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.85e+115], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+115}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.85000000000000003e115Initial program 60.2%
Taylor expanded in z around inf
lower--.f6445.4
Applied rewrites45.4%
if -1.85000000000000003e115 < z Initial program 82.5%
Taylor expanded in x around inf
+-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f6450.4
Applied rewrites50.4%
Taylor expanded in z around 0
Applied rewrites45.1%
(FPCore (x y z t a) :precision binary64 (+ x (- t x)))
double code(double x, double y, double z, double t, double a) {
return x + (t - 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 + (t - x)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t - x);
}
def code(x, y, z, t, a): return x + (t - x)
function code(x, y, z, t, a) return Float64(x + Float64(t - x)) end
function tmp = code(x, y, z, t, a) tmp = x + (t - x); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t - x\right)
\end{array}
Initial program 79.1%
Taylor expanded in z around inf
lower--.f6415.2
Applied rewrites15.2%
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
return 0.0;
}
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 = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return 0.0;
}
def code(x, y, z, t, a): return 0.0
function code(x, y, z, t, a) return 0.0 end
function tmp = code(x, y, z, t, a) tmp = 0.0; end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 79.1%
Taylor expanded in x around inf
+-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lft-identityN/A
lower-fma.f64N/A
lower--.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f6444.6
Applied rewrites44.6%
Taylor expanded in z around inf
Applied rewrites2.8%
herbie shell --seed 2024233
(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)))))