
(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 16 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-305)
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-305) {
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-305) 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-305], 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^{-305}:\\
\;\;\;\;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)))) < -1.99999999999999999e-305 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.2%
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
div-invN/A
div-invN/A
lift-/.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites96.1%
if -1.99999999999999999e-305 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 3.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
lower-fma.f64N/A
Applied rewrites99.8%
Final simplification96.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z)))))
(t_2 (+ x (* (- y z) (/ t (- a z))))))
(if (<= t_1 (- INFINITY))
(/ (* y (- t x)) (- a z))
(if (<= t_1 -2e-184)
t_2
(if (<= t_1 0.0)
(fma a (/ (- t x) z) t)
(if (<= t_1 2e+277) t_2 (fma (/ y (- a z)) (- t x) x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double t_2 = x + ((y - z) * (t / (a - z)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (y * (t - x)) / (a - z);
} else if (t_1 <= -2e-184) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = fma(a, ((t - x) / z), t);
} else if (t_1 <= 2e+277) {
tmp = t_2;
} else {
tmp = fma((y / (a - z)), (t - x), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) t_2 = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(y * Float64(t - x)) / Float64(a - z)); elseif (t_1 <= -2e-184) tmp = t_2; elseif (t_1 <= 0.0) tmp = fma(a, Float64(Float64(t - x) / z), t); elseif (t_1 <= 2e+277) tmp = t_2; else tmp = fma(Float64(y / Float64(a - z)), Float64(t - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-184], t$95$2, If[LessEqual[t$95$1, 0.0], N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[t$95$1, 2e+277], t$95$2, N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
t_2 := x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{y \cdot \left(t - x\right)}{a - z}\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-184}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t - x}{z}, t\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+277}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - z}, t - x, x\right)\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0Initial program 92.9%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f64100.0
Applied rewrites100.0%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.0000000000000001e-184 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 2.00000000000000001e277Initial program 94.5%
Taylor expanded in t around inf
lower-/.f64N/A
lower--.f6479.9
Applied rewrites79.9%
if -2.0000000000000001e-184 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 3.5%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f643.5
Applied rewrites3.5%
Taylor expanded in z around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6476.8
Applied rewrites76.8%
if 2.00000000000000001e277 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 82.7%
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
div-invN/A
div-invN/A
lift-/.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites99.9%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6487.2
Applied rewrites87.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 (- INFINITY))
(* y (/ t a))
(if (<= t_1 -1e-145) (+ x t) (if (<= t_1 0.0) (+ t (- x x)) (+ x t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * (t / a);
} else if (t_1 <= -1e-145) {
tmp = x + t;
} else if (t_1 <= 0.0) {
tmp = t + (x - x);
} else {
tmp = x + t;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = y * (t / a);
} else if (t_1 <= -1e-145) {
tmp = x + t;
} else if (t_1 <= 0.0) {
tmp = t + (x - x);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_1 <= -math.inf: tmp = y * (t / a) elif t_1 <= -1e-145: tmp = x + t elif t_1 <= 0.0: tmp = t + (x - x) else: tmp = x + t return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(t / a)); elseif (t_1 <= -1e-145) tmp = Float64(x + t); elseif (t_1 <= 0.0) tmp = Float64(t + Float64(x - x)); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_1 <= -Inf) tmp = y * (t / a); elseif (t_1 <= -1e-145) tmp = x + t; elseif (t_1 <= 0.0) tmp = t + (x - x); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e-145], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(t + N[(x - x), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-145}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t + \left(x - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0Initial program 92.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6478.9
Applied rewrites78.9%
Taylor expanded in t around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6457.5
Applied rewrites57.5%
if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.99999999999999915e-146 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 93.2%
Taylor expanded in t around inf
lower-/.f64N/A
lower--.f6478.1
Applied rewrites78.1%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6444.4
Applied rewrites44.4%
if -9.99999999999999915e-146 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 8.2%
Taylor expanded in z around inf
lower--.f6410.5
Applied rewrites10.5%
lift--.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f6443.6
Applied rewrites43.6%
Final simplification45.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z)))))) (if (<= t_1 -1e-145) (+ x t) (if (<= t_1 1e-270) (+ t (- x x)) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -1e-145) {
tmp = x + t;
} else if (t_1 <= 1e-270) {
tmp = t + (x - x);
} else {
tmp = x + 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) :: t_1
real(8) :: tmp
t_1 = x + ((y - z) * ((t - x) / (a - z)))
if (t_1 <= (-1d-145)) then
tmp = x + t
else if (t_1 <= 1d-270) then
tmp = t + (x - x)
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -1e-145) {
tmp = x + t;
} else if (t_1 <= 1e-270) {
tmp = t + (x - x);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if t_1 <= -1e-145: tmp = x + t elif t_1 <= 1e-270: tmp = t + (x - x) else: tmp = x + t return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= -1e-145) tmp = Float64(x + t); elseif (t_1 <= 1e-270) tmp = Float64(t + Float64(x - x)); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * ((t - x) / (a - z))); tmp = 0.0; if (t_1 <= -1e-145) tmp = x + t; elseif (t_1 <= 1e-270) tmp = t + (x - x); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-145], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, 1e-270], N[(t + N[(x - x), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-145}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;t\_1 \leq 10^{-270}:\\
\;\;\;\;t + \left(x - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.99999999999999915e-146 or 1e-270 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 93.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower--.f6477.1
Applied rewrites77.1%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6441.8
Applied rewrites41.8%
if -9.99999999999999915e-146 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1e-270Initial program 10.4%
Taylor expanded in z around inf
lower--.f6410.3
Applied rewrites10.3%
lift--.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f6442.7
Applied rewrites42.7%
Final simplification42.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ y (- a z)) (- t x) x)) (t_2 (fma a (/ (- t x) z) t)))
(if (<= z -4e+145)
t_2
(if (<= z 1.25e-41)
t_1
(if (<= z 3e+65)
(* (- y z) (/ t (- a z)))
(if (<= z 2.6e+101) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y / (a - z)), (t - x), x);
double t_2 = fma(a, ((t - x) / z), t);
double tmp;
if (z <= -4e+145) {
tmp = t_2;
} else if (z <= 1.25e-41) {
tmp = t_1;
} else if (z <= 3e+65) {
tmp = (y - z) * (t / (a - z));
} else if (z <= 2.6e+101) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y / Float64(a - z)), Float64(t - x), x) t_2 = fma(a, Float64(Float64(t - x) / z), t) tmp = 0.0 if (z <= -4e+145) tmp = t_2; elseif (z <= 1.25e-41) tmp = t_1; elseif (z <= 3e+65) tmp = Float64(Float64(y - z) * Float64(t / Float64(a - z))); elseif (z <= 2.6e+101) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -4e+145], t$95$2, If[LessEqual[z, 1.25e-41], t$95$1, If[LessEqual[z, 3e+65], N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e+101], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{a - z}, t - x, x\right)\\
t_2 := \mathsf{fma}\left(a, \frac{t - x}{z}, t\right)\\
\mathbf{if}\;z \leq -4 \cdot 10^{+145}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+65}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4e145 or 2.6e101 < z Initial program 55.8%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6447.4
Applied rewrites47.4%
Taylor expanded in z around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6472.3
Applied rewrites72.3%
if -4e145 < z < 1.2499999999999999e-41 or 3.0000000000000002e65 < z < 2.6e101Initial program 90.3%
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
div-invN/A
div-invN/A
lift-/.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites93.9%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6481.9
Applied rewrites81.9%
if 1.2499999999999999e-41 < z < 3.0000000000000002e65Initial program 82.4%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6475.0
Applied rewrites75.0%
lift--.f64N/A
lift--.f64N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6481.7
Applied rewrites81.7%
Final simplification79.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- y z) (/ t (- a z)))) (t_2 (fma a (/ (- t x) z) t)))
(if (<= z -2.25e+163)
t_2
(if (<= z -4e-12)
t_1
(if (<= z 3.1e-50)
(fma (/ y a) (- t x) x)
(if (<= z 5.5e+149) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) * (t / (a - z));
double t_2 = fma(a, ((t - x) / z), t);
double tmp;
if (z <= -2.25e+163) {
tmp = t_2;
} else if (z <= -4e-12) {
tmp = t_1;
} else if (z <= 3.1e-50) {
tmp = fma((y / a), (t - x), x);
} else if (z <= 5.5e+149) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y - z) * Float64(t / Float64(a - z))) t_2 = fma(a, Float64(Float64(t - x) / z), t) tmp = 0.0 if (z <= -2.25e+163) tmp = t_2; elseif (z <= -4e-12) tmp = t_1; elseif (z <= 3.1e-50) tmp = fma(Float64(y / a), Float64(t - x), x); elseif (z <= 5.5e+149) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -2.25e+163], t$95$2, If[LessEqual[z, -4e-12], t$95$1, If[LessEqual[z, 3.1e-50], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 5.5e+149], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \frac{t}{a - z}\\
t_2 := \mathsf{fma}\left(a, \frac{t - x}{z}, t\right)\\
\mathbf{if}\;z \leq -2.25 \cdot 10^{+163}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-50}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -2.24999999999999994e163 or 5.49999999999999999e149 < z Initial program 48.6%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6441.4
Applied rewrites41.4%
Taylor expanded in z around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6473.9
Applied rewrites73.9%
if -2.24999999999999994e163 < z < -3.99999999999999992e-12 or 3.1000000000000002e-50 < z < 5.49999999999999999e149Initial program 82.6%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6457.6
Applied rewrites57.6%
lift--.f64N/A
lift--.f64N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6465.8
Applied rewrites65.8%
if -3.99999999999999992e-12 < z < 3.1000000000000002e-50Initial program 93.1%
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
div-invN/A
div-invN/A
lift-/.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites95.4%
Taylor expanded in z around 0
lower-/.f6475.5
Applied rewrites75.5%
Final simplification72.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a (/ (- t x) z) t)))
(if (<= z -2.1e+145)
t_1
(if (<= z 9.8e-42)
(fma y (/ (- t x) (- a z)) x)
(if (<= z 5.5e+149) (* (- y z) (/ t (- a 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.1e+145) {
tmp = t_1;
} else if (z <= 9.8e-42) {
tmp = fma(y, ((t - x) / (a - z)), x);
} else if (z <= 5.5e+149) {
tmp = (y - z) * (t / (a - 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.1e+145) tmp = t_1; elseif (z <= 9.8e-42) tmp = fma(y, Float64(Float64(t - x) / Float64(a - z)), x); elseif (z <= 5.5e+149) tmp = Float64(Float64(y - z) * Float64(t / Float64(a - 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.1e+145], t$95$1, If[LessEqual[z, 9.8e-42], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 5.5e+149], N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $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.1 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-42}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a - z}, x\right)\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+149}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.09999999999999989e145 or 5.49999999999999999e149 < z Initial program 51.8%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6443.7
Applied rewrites43.7%
Taylor expanded in z around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6474.0
Applied rewrites74.0%
if -2.09999999999999989e145 < z < 9.8000000000000001e-42Initial program 91.1%
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
div-invN/A
div-invN/A
lift-/.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites94.2%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6481.6
Applied rewrites81.6%
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6479.7
Applied rewrites79.7%
if 9.8000000000000001e-42 < z < 5.49999999999999999e149Initial program 80.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6459.8
Applied rewrites59.8%
lift--.f64N/A
lift--.f64N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6467.8
Applied rewrites67.8%
Final simplification76.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a (/ (- t x) z) t)))
(if (<= z -4.9e+104)
t_1
(if (<= z 9.8e-42)
(fma (/ y a) (- t x) x)
(if (<= z 7.2e+148) (fma t (/ y (- z)) t) 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 <= -4.9e+104) {
tmp = t_1;
} else if (z <= 9.8e-42) {
tmp = fma((y / a), (t - x), x);
} else if (z <= 7.2e+148) {
tmp = fma(t, (y / -z), t);
} 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 <= -4.9e+104) tmp = t_1; elseif (z <= 9.8e-42) tmp = fma(Float64(y / a), Float64(t - x), x); elseif (z <= 7.2e+148) tmp = fma(t, Float64(y / Float64(-z)), t); 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, -4.9e+104], t$95$1, If[LessEqual[z, 9.8e-42], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 7.2e+148], N[(t * N[(y / (-z)), $MachinePrecision] + t), $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 -4.9 \cdot 10^{+104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-42}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+148}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{-z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.89999999999999985e104 or 7.20000000000000013e148 < z Initial program 57.7%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6442.6
Applied rewrites42.6%
Taylor expanded in z around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6465.7
Applied rewrites65.7%
if -4.89999999999999985e104 < z < 9.8000000000000001e-42Initial program 92.3%
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
div-invN/A
div-invN/A
lift-/.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites95.2%
Taylor expanded in z around 0
lower-/.f6472.1
Applied rewrites72.1%
if 9.8000000000000001e-42 < z < 7.20000000000000013e148Initial program 80.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6459.8
Applied rewrites59.8%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f6448.5
Applied rewrites48.5%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-neg.f6458.6
Applied rewrites58.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ (- t x) a) x)))
(if (<= a -8000.0)
t_1
(if (<= a 2e-47)
(fma t (/ y (- z)) t)
(if (<= a 4.7e+139) t_1 (fma t (/ (- y z) a) x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, ((t - x) / a), x);
double tmp;
if (a <= -8000.0) {
tmp = t_1;
} else if (a <= 2e-47) {
tmp = fma(t, (y / -z), t);
} else if (a <= 4.7e+139) {
tmp = t_1;
} else {
tmp = fma(t, ((y - z) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(Float64(t - x) / a), x) tmp = 0.0 if (a <= -8000.0) tmp = t_1; elseif (a <= 2e-47) tmp = fma(t, Float64(y / Float64(-z)), t); elseif (a <= 4.7e+139) tmp = t_1; else tmp = fma(t, Float64(Float64(y - z) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -8000.0], t$95$1, If[LessEqual[a, 2e-47], N[(t * N[(y / (-z)), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[a, 4.7e+139], t$95$1, N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -8000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-47}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{-z}, t\right)\\
\mathbf{elif}\;a \leq 4.7 \cdot 10^{+139}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y - z}{a}, x\right)\\
\end{array}
\end{array}
if a < -8e3 or 1.9999999999999999e-47 < a < 4.7000000000000001e139Initial program 84.4%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6466.5
Applied rewrites66.5%
if -8e3 < a < 1.9999999999999999e-47Initial program 72.2%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6459.1
Applied rewrites59.1%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f6450.5
Applied rewrites50.5%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-neg.f6463.8
Applied rewrites63.8%
if 4.7000000000000001e139 < a Initial program 91.1%
Taylor expanded in t around inf
lower-/.f64N/A
lower--.f6487.9
Applied rewrites87.9%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6480.5
Applied rewrites80.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.9e+104)
(fma (/ (- t x) z) (- a y) t)
(if (<= z 0.025)
(fma (/ y (- a z)) (- t x) x)
(+ t (* (- t x) (/ (- a y) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.9e+104) {
tmp = fma(((t - x) / z), (a - y), t);
} else if (z <= 0.025) {
tmp = fma((y / (a - z)), (t - x), x);
} else {
tmp = t + ((t - x) * ((a - y) / z));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.9e+104) tmp = fma(Float64(Float64(t - x) / z), Float64(a - y), t); elseif (z <= 0.025) tmp = fma(Float64(y / Float64(a - z)), Float64(t - x), x); else tmp = Float64(t + Float64(Float64(t - x) * Float64(Float64(a - y) / z))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.9e+104], N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(a - y), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 0.025], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], N[(t + N[(N[(t - x), $MachinePrecision] * N[(N[(a - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.9 \cdot 10^{+104}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{z}, a - y, t\right)\\
\mathbf{elif}\;z \leq 0.025:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - z}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t + \left(t - x\right) \cdot \frac{a - y}{z}\\
\end{array}
\end{array}
if z < -4.89999999999999985e104Initial program 56.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
lower-fma.f64N/A
Applied rewrites86.1%
if -4.89999999999999985e104 < z < 0.025000000000000001Initial program 92.9%
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
div-invN/A
div-invN/A
lift-/.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites94.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6483.1
Applied rewrites83.1%
if 0.025000000000000001 < z Initial program 68.1%
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6468.4
Applied rewrites68.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
distribute-rgt-out--N/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6477.7
Applied rewrites77.7%
Final simplification82.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ t (* (- t x) (/ (- a y) z)))))
(if (<= z -4.9e+104)
t_1
(if (<= z 0.025) (fma (/ y (- a z)) (- t x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t + ((t - x) * ((a - y) / z));
double tmp;
if (z <= -4.9e+104) {
tmp = t_1;
} else if (z <= 0.025) {
tmp = fma((y / (a - z)), (t - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t + Float64(Float64(t - x) * Float64(Float64(a - y) / z))) tmp = 0.0 if (z <= -4.9e+104) tmp = t_1; elseif (z <= 0.025) 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[(t + N[(N[(t - x), $MachinePrecision] * N[(N[(a - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.9e+104], t$95$1, If[LessEqual[z, 0.025], 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 := t + \left(t - x\right) \cdot \frac{a - y}{z}\\
\mathbf{if}\;z \leq -4.9 \cdot 10^{+104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.025:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - z}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.89999999999999985e104 or 0.025000000000000001 < z Initial program 62.9%
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6462.6
Applied rewrites62.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
distribute-rgt-out--N/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6481.4
Applied rewrites81.4%
if -4.89999999999999985e104 < z < 0.025000000000000001Initial program 92.9%
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
div-invN/A
div-invN/A
lift-/.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites94.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6483.1
Applied rewrites83.1%
Final simplification82.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma t (/ (- y z) a) x))) (if (<= a -100000.0) t_1 (if (<= a 1.22e-33) (fma t (/ y (- z)) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(t, ((y - z) / a), x);
double tmp;
if (a <= -100000.0) {
tmp = t_1;
} else if (a <= 1.22e-33) {
tmp = fma(t, (y / -z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(t, Float64(Float64(y - z) / a), x) tmp = 0.0 if (a <= -100000.0) tmp = t_1; elseif (a <= 1.22e-33) tmp = fma(t, Float64(y / Float64(-z)), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -100000.0], t$95$1, If[LessEqual[a, 1.22e-33], N[(t * N[(y / (-z)), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, \frac{y - z}{a}, x\right)\\
\mathbf{if}\;a \leq -100000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.22 \cdot 10^{-33}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{-z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1e5 or 1.22e-33 < a Initial program 85.7%
Taylor expanded in t around inf
lower-/.f64N/A
lower--.f6474.1
Applied rewrites74.1%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6465.4
Applied rewrites65.4%
if -1e5 < a < 1.22e-33Initial program 73.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6457.3
Applied rewrites57.3%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f6449.0
Applied rewrites49.0%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-neg.f6462.6
Applied rewrites62.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma t (/ y a) x))) (if (<= a -29500000.0) t_1 (if (<= a 1.8e-28) (fma t (/ y (- z)) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(t, (y / a), x);
double tmp;
if (a <= -29500000.0) {
tmp = t_1;
} else if (a <= 1.8e-28) {
tmp = fma(t, (y / -z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(t, Float64(y / a), x) tmp = 0.0 if (a <= -29500000.0) tmp = t_1; elseif (a <= 1.8e-28) tmp = fma(t, Float64(y / Float64(-z)), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -29500000.0], t$95$1, If[LessEqual[a, 1.8e-28], N[(t * N[(y / (-z)), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\mathbf{if}\;a \leq -29500000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{-28}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{-z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.95e7 or 1.7999999999999999e-28 < a Initial program 85.7%
Taylor expanded in t around inf
lower-/.f64N/A
lower--.f6474.1
Applied rewrites74.1%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6458.3
Applied rewrites58.3%
if -2.95e7 < a < 1.7999999999999999e-28Initial program 73.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6457.3
Applied rewrites57.3%
Taylor expanded in a around 0
mul-1-negN/A
lower-neg.f6449.0
Applied rewrites49.0%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-neg.f6462.6
Applied rewrites62.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.9e+104) (+ t (- x x)) (if (<= z 9e-23) (fma t (/ y a) x) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.9e+104) {
tmp = t + (x - x);
} else if (z <= 9e-23) {
tmp = fma(t, (y / a), x);
} else {
tmp = x + t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.9e+104) tmp = Float64(t + Float64(x - x)); elseif (z <= 9e-23) tmp = fma(t, Float64(y / a), x); else tmp = Float64(x + t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.9e+104], N[(t + N[(x - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-23], N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.9 \cdot 10^{+104}:\\
\;\;\;\;t + \left(x - x\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-23}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -4.89999999999999985e104Initial program 56.3%
Taylor expanded in z around inf
lower--.f6437.4
Applied rewrites37.4%
lift--.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f6453.1
Applied rewrites53.1%
if -4.89999999999999985e104 < z < 8.9999999999999995e-23Initial program 92.8%
Taylor expanded in t around inf
lower-/.f64N/A
lower--.f6475.5
Applied rewrites75.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6458.1
Applied rewrites58.1%
if 8.9999999999999995e-23 < z Initial program 69.5%
Taylor expanded in t around inf
lower-/.f64N/A
lower--.f6462.1
Applied rewrites62.1%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6444.7
Applied rewrites44.7%
Final simplification53.6%
(FPCore (x y z t a) :precision binary64 (+ x t))
double code(double x, double y, double z, double t, double a) {
return x + 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 + t
end function
public static double code(double x, double y, double z, double t, double a) {
return x + t;
}
def code(x, y, z, t, a): return x + t
function code(x, y, z, t, a) return Float64(x + t) end
function tmp = code(x, y, z, t, a) tmp = x + t; end
code[x_, y_, z_, t_, a_] := N[(x + t), $MachinePrecision]
\begin{array}{l}
\\
x + t
\end{array}
Initial program 79.6%
Taylor expanded in t around inf
lower-/.f64N/A
lower--.f6466.2
Applied rewrites66.2%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6436.7
Applied rewrites36.7%
(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.6%
Taylor expanded in z around inf
lower--.f6421.0
Applied rewrites21.0%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f642.8
Applied rewrites2.8%
unsub-negN/A
+-inverses2.8
Applied rewrites2.8%
herbie shell --seed 2024214
(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)))))