
(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 19 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 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (or (<= t_1 -1e-278) (not (<= t_1 0.0)))
(fma (- t x) (/ (- y z) (- a z)) x)
(- t (* (/ (- t x) z) (- y a))))))
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-278) || !(t_1 <= 0.0)) {
tmp = fma((t - x), ((y - z) / (a - z)), x);
} else {
tmp = t - (((t - x) / z) * (y - a));
}
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-278) || !(t_1 <= 0.0)) tmp = fma(Float64(t - x), Float64(Float64(y - z) / Float64(a - z)), x); else tmp = Float64(t - Float64(Float64(Float64(t - x) / z) * Float64(y - a))); 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]}, If[Or[LessEqual[t$95$1, -1e-278], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(t - N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision]), $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^{-278} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t - \frac{t - x}{z} \cdot \left(y - a\right)\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.99999999999999938e-279 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6494.8
Applied rewrites94.8%
if -9.99999999999999938e-279 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 3.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f643.4
Applied rewrites3.4%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Final simplification95.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (or (<= t_1 -2e+300)
(not
(or (<= t_1 -2e-274)
(not (or (<= t_1 0.0) (not (<= t_1 1e+306)))))))
(* (/ (- x t) z) y)
(+ x (* 1.0 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 <= -2e+300) || !((t_1 <= -2e-274) || !((t_1 <= 0.0) || !(t_1 <= 1e+306)))) {
tmp = ((x - t) / z) * y;
} else {
tmp = x + (1.0 * 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 <= (-2d+300)) .or. (.not. (t_1 <= (-2d-274)) .or. (.not. (t_1 <= 0.0d0) .or. (.not. (t_1 <= 1d+306))))) then
tmp = ((x - t) / z) * y
else
tmp = x + (1.0d0 * 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 <= -2e+300) || !((t_1 <= -2e-274) || !((t_1 <= 0.0) || !(t_1 <= 1e+306)))) {
tmp = ((x - t) / z) * y;
} else {
tmp = x + (1.0 * t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if (t_1 <= -2e+300) or not ((t_1 <= -2e-274) or not ((t_1 <= 0.0) or not (t_1 <= 1e+306))): tmp = ((x - t) / z) * y else: tmp = x + (1.0 * 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 <= -2e+300) || !((t_1 <= -2e-274) || !((t_1 <= 0.0) || !(t_1 <= 1e+306)))) tmp = Float64(Float64(Float64(x - t) / z) * y); else tmp = Float64(x + Float64(1.0 * 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 <= -2e+300) || ~(((t_1 <= -2e-274) || ~(((t_1 <= 0.0) || ~((t_1 <= 1e+306))))))) tmp = ((x - t) / z) * y; else tmp = x + (1.0 * 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[Or[LessEqual[t$95$1, -2e+300], N[Not[Or[LessEqual[t$95$1, -2e-274], N[Not[Or[LessEqual[t$95$1, 0.0], N[Not[LessEqual[t$95$1, 1e+306]], $MachinePrecision]]], $MachinePrecision]]], $MachinePrecision]], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision], N[(x + N[(1.0 * t), $MachinePrecision]), $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 -2 \cdot 10^{+300} \lor \neg \left(t\_1 \leq -2 \cdot 10^{-274} \lor \neg \left(t\_1 \leq 0 \lor \neg \left(t\_1 \leq 10^{+306}\right)\right)\right):\\
\;\;\;\;\frac{x - t}{z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + 1 \cdot t\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.0000000000000001e300 or -1.99999999999999993e-274 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0 or 1.00000000000000002e306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 44.0%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6481.9
Applied rewrites81.9%
Taylor expanded in y around inf
Applied rewrites51.5%
if -2.0000000000000001e300 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.99999999999999993e-274 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000002e306Initial program 94.1%
Taylor expanded in z around inf
lower--.f6428.8
Applied rewrites28.8%
Taylor expanded in t around inf
Applied rewrites28.8%
Taylor expanded in x around 0
Applied rewrites51.0%
Final simplification51.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- x t) z) y))
(t_2 (+ x (* (- y z) (/ (- t x) (- a z)))))
(t_3 (+ x (* 1.0 t))))
(if (<= t_2 -2e+300)
t_1
(if (<= t_2 -2e-274)
t_3
(if (<= t_2 0.0) (/ (* (- y a) x) z) (if (<= t_2 1e+306) t_3 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - t) / z) * y;
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double t_3 = x + (1.0 * t);
double tmp;
if (t_2 <= -2e+300) {
tmp = t_1;
} else if (t_2 <= -2e-274) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = ((y - a) * x) / z;
} else if (t_2 <= 1e+306) {
tmp = t_3;
} 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = ((x - t) / z) * y
t_2 = x + ((y - z) * ((t - x) / (a - z)))
t_3 = x + (1.0d0 * t)
if (t_2 <= (-2d+300)) then
tmp = t_1
else if (t_2 <= (-2d-274)) then
tmp = t_3
else if (t_2 <= 0.0d0) then
tmp = ((y - a) * x) / z
else if (t_2 <= 1d+306) then
tmp = t_3
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 = ((x - t) / z) * y;
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double t_3 = x + (1.0 * t);
double tmp;
if (t_2 <= -2e+300) {
tmp = t_1;
} else if (t_2 <= -2e-274) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = ((y - a) * x) / z;
} else if (t_2 <= 1e+306) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((x - t) / z) * y t_2 = x + ((y - z) * ((t - x) / (a - z))) t_3 = x + (1.0 * t) tmp = 0 if t_2 <= -2e+300: tmp = t_1 elif t_2 <= -2e-274: tmp = t_3 elif t_2 <= 0.0: tmp = ((y - a) * x) / z elif t_2 <= 1e+306: tmp = t_3 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x - t) / z) * y) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) t_3 = Float64(x + Float64(1.0 * t)) tmp = 0.0 if (t_2 <= -2e+300) tmp = t_1; elseif (t_2 <= -2e-274) tmp = t_3; elseif (t_2 <= 0.0) tmp = Float64(Float64(Float64(y - a) * x) / z); elseif (t_2 <= 1e+306) tmp = t_3; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((x - t) / z) * y; t_2 = x + ((y - z) * ((t - x) / (a - z))); t_3 = x + (1.0 * t); tmp = 0.0; if (t_2 <= -2e+300) tmp = t_1; elseif (t_2 <= -2e-274) tmp = t_3; elseif (t_2 <= 0.0) tmp = ((y - a) * x) / z; elseif (t_2 <= 1e+306) tmp = t_3; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y), $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[(1.0 * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+300], t$95$1, If[LessEqual[t$95$2, -2e-274], t$95$3, If[LessEqual[t$95$2, 0.0], N[(N[(N[(y - a), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$2, 1e+306], t$95$3, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - t}{z} \cdot y\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
t_3 := x + 1 \cdot t\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+300}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-274}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\left(y - a\right) \cdot x}{z}\\
\mathbf{elif}\;t\_2 \leq 10^{+306}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.0000000000000001e300 or 1.00000000000000002e306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.5%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6473.3
Applied rewrites73.3%
Taylor expanded in y around inf
Applied rewrites61.6%
if -2.0000000000000001e300 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.99999999999999993e-274 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000002e306Initial program 94.1%
Taylor expanded in z around inf
lower--.f6428.8
Applied rewrites28.8%
Taylor expanded in t around inf
Applied rewrites28.8%
Taylor expanded in x around 0
Applied rewrites51.0%
if -1.99999999999999993e-274 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 3.4%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6491.7
Applied rewrites91.7%
Taylor expanded in x around inf
Applied rewrites43.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (or (<= t_1 -2e+300) (not (<= t_1 1e+298)))
(/ (* t y) a)
(+ x (* 1.0 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 <= -2e+300) || !(t_1 <= 1e+298)) {
tmp = (t * y) / a;
} else {
tmp = x + (1.0 * 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 <= (-2d+300)) .or. (.not. (t_1 <= 1d+298))) then
tmp = (t * y) / a
else
tmp = x + (1.0d0 * 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 <= -2e+300) || !(t_1 <= 1e+298)) {
tmp = (t * y) / a;
} else {
tmp = x + (1.0 * t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * ((t - x) / (a - z))) tmp = 0 if (t_1 <= -2e+300) or not (t_1 <= 1e+298): tmp = (t * y) / a else: tmp = x + (1.0 * 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 <= -2e+300) || !(t_1 <= 1e+298)) tmp = Float64(Float64(t * y) / a); else tmp = Float64(x + Float64(1.0 * 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 <= -2e+300) || ~((t_1 <= 1e+298))) tmp = (t * y) / a; else tmp = x + (1.0 * 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[Or[LessEqual[t$95$1, -2e+300], N[Not[LessEqual[t$95$1, 1e+298]], $MachinePrecision]], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], N[(x + N[(1.0 * t), $MachinePrecision]), $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 -2 \cdot 10^{+300} \lor \neg \left(t\_1 \leq 10^{+298}\right):\\
\;\;\;\;\frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + 1 \cdot t\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.0000000000000001e300 or 9.9999999999999996e297 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 80.0%
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--.f6458.4
Applied rewrites58.4%
Taylor expanded in y around inf
Applied rewrites58.8%
Taylor expanded in x around 0
Applied rewrites47.6%
if -2.0000000000000001e300 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 9.9999999999999996e297Initial program 78.9%
Taylor expanded in z around inf
lower--.f6424.6
Applied rewrites24.6%
Taylor expanded in t around inf
Applied rewrites24.6%
Taylor expanded in x around 0
Applied rewrites43.1%
Final simplification43.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -0.000135) (not (<= a 4e+32))) (fma (- y z) (/ (- t x) a) x) (fma (- (- t x)) (/ (- y a) z) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.000135) || !(a <= 4e+32)) {
tmp = fma((y - z), ((t - x) / a), x);
} else {
tmp = fma(-(t - x), ((y - a) / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -0.000135) || !(a <= 4e+32)) tmp = fma(Float64(y - z), Float64(Float64(t - x) / a), x); else tmp = fma(Float64(-Float64(t - x)), Float64(Float64(y - a) / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -0.000135], N[Not[LessEqual[a, 4e+32]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[((-N[(t - x), $MachinePrecision]) * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.000135 \lor \neg \left(a \leq 4 \cdot 10^{+32}\right):\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-\left(t - x\right), \frac{y - a}{z}, t\right)\\
\end{array}
\end{array}
if a < -1.35000000000000002e-4 or 4.00000000000000021e32 < a Initial program 91.8%
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--.f6483.2
Applied rewrites83.2%
if -1.35000000000000002e-4 < a < 4.00000000000000021e32Initial program 66.9%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6487.2
Applied rewrites87.2%
Final simplification85.2%
(FPCore (x y z t a)
:precision binary64
(if (<= y -2.1e+165)
(* t (/ y (- a z)))
(if (<= y -9.5e+71)
(* (/ (- x t) z) y)
(if (<= y 6e+123) (+ x (* 1.0 t)) (* (/ (- t x) a) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.1e+165) {
tmp = t * (y / (a - z));
} else if (y <= -9.5e+71) {
tmp = ((x - t) / z) * y;
} else if (y <= 6e+123) {
tmp = x + (1.0 * t);
} else {
tmp = ((t - x) / a) * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-2.1d+165)) then
tmp = t * (y / (a - z))
else if (y <= (-9.5d+71)) then
tmp = ((x - t) / z) * y
else if (y <= 6d+123) then
tmp = x + (1.0d0 * t)
else
tmp = ((t - x) / a) * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.1e+165) {
tmp = t * (y / (a - z));
} else if (y <= -9.5e+71) {
tmp = ((x - t) / z) * y;
} else if (y <= 6e+123) {
tmp = x + (1.0 * t);
} else {
tmp = ((t - x) / a) * y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.1e+165: tmp = t * (y / (a - z)) elif y <= -9.5e+71: tmp = ((x - t) / z) * y elif y <= 6e+123: tmp = x + (1.0 * t) else: tmp = ((t - x) / a) * y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.1e+165) tmp = Float64(t * Float64(y / Float64(a - z))); elseif (y <= -9.5e+71) tmp = Float64(Float64(Float64(x - t) / z) * y); elseif (y <= 6e+123) tmp = Float64(x + Float64(1.0 * t)); else tmp = Float64(Float64(Float64(t - x) / a) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.1e+165) tmp = t * (y / (a - z)); elseif (y <= -9.5e+71) tmp = ((x - t) / z) * y; elseif (y <= 6e+123) tmp = x + (1.0 * t); else tmp = ((t - x) / a) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.1e+165], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -9.5e+71], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 6e+123], N[(x + N[(1.0 * t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+165}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\mathbf{elif}\;y \leq -9.5 \cdot 10^{+71}:\\
\;\;\;\;\frac{x - t}{z} \cdot y\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+123}:\\
\;\;\;\;x + 1 \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{t - x}{a} \cdot y\\
\end{array}
\end{array}
if y < -2.1000000000000001e165Initial program 93.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6499.8
Applied rewrites99.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--.f6450.3
Applied rewrites50.3%
Taylor expanded in x around 0
Applied rewrites59.1%
if -2.1000000000000001e165 < y < -9.50000000000000015e71Initial program 74.7%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6484.7
Applied rewrites84.7%
Taylor expanded in y around inf
Applied rewrites64.5%
if -9.50000000000000015e71 < y < 6.00000000000000016e123Initial program 74.2%
Taylor expanded in z around inf
lower--.f6427.9
Applied rewrites27.9%
Taylor expanded in t around inf
Applied rewrites27.7%
Taylor expanded in x around 0
Applied rewrites46.7%
if 6.00000000000000016e123 < y Initial program 92.4%
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--.f6472.6
Applied rewrites72.6%
Taylor expanded in y around inf
Applied rewrites62.8%
Final simplification51.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- z) (/ t a) x)))
(if (<= a -9e-6)
t_1
(if (<= a 3.4e-12)
(* (/ (- x t) z) y)
(if (<= a 6.6e+168) (+ x (* 1.0 t)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-z, (t / a), x);
double tmp;
if (a <= -9e-6) {
tmp = t_1;
} else if (a <= 3.4e-12) {
tmp = ((x - t) / z) * y;
} else if (a <= 6.6e+168) {
tmp = x + (1.0 * t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-z), Float64(t / a), x) tmp = 0.0 if (a <= -9e-6) tmp = t_1; elseif (a <= 3.4e-12) tmp = Float64(Float64(Float64(x - t) / z) * y); elseif (a <= 6.6e+168) tmp = Float64(x + Float64(1.0 * t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-z) * N[(t / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -9e-6], t$95$1, If[LessEqual[a, 3.4e-12], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[a, 6.6e+168], N[(x + N[(1.0 * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-z, \frac{t}{a}, x\right)\\
\mathbf{if}\;a \leq -9 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{-12}:\\
\;\;\;\;\frac{x - t}{z} \cdot y\\
\mathbf{elif}\;a \leq 6.6 \cdot 10^{+168}:\\
\;\;\;\;x + 1 \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -9.00000000000000023e-6 or 6.5999999999999997e168 < a Initial program 91.3%
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--.f6484.4
Applied rewrites84.4%
Taylor expanded in x around 0
Applied rewrites73.9%
Taylor expanded in y around 0
Applied rewrites61.8%
if -9.00000000000000023e-6 < a < 3.4000000000000001e-12Initial program 66.6%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6487.7
Applied rewrites87.7%
Taylor expanded in y around inf
Applied rewrites44.4%
if 3.4000000000000001e-12 < a < 6.5999999999999997e168Initial program 87.6%
Taylor expanded in z around inf
lower--.f6425.0
Applied rewrites25.0%
Taylor expanded in t around inf
Applied rewrites25.3%
Taylor expanded in x around 0
Applied rewrites49.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- t x) a) y)))
(if (<= y -5.2e+158)
t_1
(if (<= y -9.5e+71)
(* (/ (- x t) z) y)
(if (<= y 6e+123) (+ x (* 1.0 t)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((t - x) / a) * y;
double tmp;
if (y <= -5.2e+158) {
tmp = t_1;
} else if (y <= -9.5e+71) {
tmp = ((x - t) / z) * y;
} else if (y <= 6e+123) {
tmp = x + (1.0 * 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 - x) / a) * y
if (y <= (-5.2d+158)) then
tmp = t_1
else if (y <= (-9.5d+71)) then
tmp = ((x - t) / z) * y
else if (y <= 6d+123) then
tmp = x + (1.0d0 * 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 - x) / a) * y;
double tmp;
if (y <= -5.2e+158) {
tmp = t_1;
} else if (y <= -9.5e+71) {
tmp = ((x - t) / z) * y;
} else if (y <= 6e+123) {
tmp = x + (1.0 * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((t - x) / a) * y tmp = 0 if y <= -5.2e+158: tmp = t_1 elif y <= -9.5e+71: tmp = ((x - t) / z) * y elif y <= 6e+123: tmp = x + (1.0 * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(t - x) / a) * y) tmp = 0.0 if (y <= -5.2e+158) tmp = t_1; elseif (y <= -9.5e+71) tmp = Float64(Float64(Float64(x - t) / z) * y); elseif (y <= 6e+123) tmp = Float64(x + Float64(1.0 * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((t - x) / a) * y; tmp = 0.0; if (y <= -5.2e+158) tmp = t_1; elseif (y <= -9.5e+71) tmp = ((x - t) / z) * y; elseif (y <= 6e+123) tmp = x + (1.0 * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -5.2e+158], t$95$1, If[LessEqual[y, -9.5e+71], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 6e+123], N[(x + N[(1.0 * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - x}{a} \cdot y\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -9.5 \cdot 10^{+71}:\\
\;\;\;\;\frac{x - t}{z} \cdot y\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+123}:\\
\;\;\;\;x + 1 \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.2e158 or 6.00000000000000016e123 < y Initial program 92.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--.f6472.3
Applied rewrites72.3%
Taylor expanded in y around inf
Applied rewrites59.7%
if -5.2e158 < y < -9.50000000000000015e71Initial program 74.7%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6484.7
Applied rewrites84.7%
Taylor expanded in y around inf
Applied rewrites64.5%
if -9.50000000000000015e71 < y < 6.00000000000000016e123Initial program 74.2%
Taylor expanded in z around inf
lower--.f6427.9
Applied rewrites27.9%
Taylor expanded in t around inf
Applied rewrites27.7%
Taylor expanded in x around 0
Applied rewrites46.7%
(FPCore (x y z t a)
:precision binary64
(if (<= a -0.000135)
(+ x (* (/ (- y z) a) (- t x)))
(if (<= a 4e+32)
(fma (- (- t x)) (/ (- y a) z) t)
(fma (- y z) (/ (- t x) a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -0.000135) {
tmp = x + (((y - z) / a) * (t - x));
} else if (a <= 4e+32) {
tmp = fma(-(t - x), ((y - a) / z), t);
} else {
tmp = fma((y - z), ((t - x) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -0.000135) tmp = Float64(x + Float64(Float64(Float64(y - z) / a) * Float64(t - x))); elseif (a <= 4e+32) tmp = fma(Float64(-Float64(t - x)), Float64(Float64(y - a) / z), t); else tmp = fma(Float64(y - z), Float64(Float64(t - x) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -0.000135], N[(x + N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4e+32], N[((-N[(t - x), $MachinePrecision]) * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.000135:\\
\;\;\;\;x + \frac{y - z}{a} \cdot \left(t - x\right)\\
\mathbf{elif}\;a \leq 4 \cdot 10^{+32}:\\
\;\;\;\;\mathsf{fma}\left(-\left(t - x\right), \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\end{array}
\end{array}
if a < -1.35000000000000002e-4Initial program 89.3%
Taylor expanded in a around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6487.5
Applied rewrites87.5%
if -1.35000000000000002e-4 < a < 4.00000000000000021e32Initial program 66.9%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6487.2
Applied rewrites87.2%
if 4.00000000000000021e32 < a Initial program 94.4%
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--.f6483.2
Applied rewrites83.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -0.000122) (not (<= a 2.6e+32))) (fma (- y z) (/ (- t x) a) x) (fma (/ (- x t) z) y t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.000122) || !(a <= 2.6e+32)) {
tmp = fma((y - z), ((t - x) / a), x);
} else {
tmp = fma(((x - t) / z), y, t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -0.000122) || !(a <= 2.6e+32)) tmp = fma(Float64(y - z), Float64(Float64(t - x) / a), x); else tmp = fma(Float64(Float64(x - t) / z), y, t); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -0.000122], N[Not[LessEqual[a, 2.6e+32]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.000122 \lor \neg \left(a \leq 2.6 \cdot 10^{+32}\right):\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
\end{array}
\end{array}
if a < -1.21999999999999997e-4 or 2.6000000000000002e32 < a Initial program 91.8%
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--.f6483.2
Applied rewrites83.2%
if -1.21999999999999997e-4 < a < 2.6000000000000002e32Initial program 66.9%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6487.2
Applied rewrites87.2%
Taylor expanded in a around 0
Applied rewrites84.3%
Final simplification83.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -0.00013) (not (<= a 6e+32))) (fma (- t x) (/ y a) x) (fma (/ (- x t) z) y t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.00013) || !(a <= 6e+32)) {
tmp = fma((t - x), (y / a), x);
} else {
tmp = fma(((x - t) / z), y, t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -0.00013) || !(a <= 6e+32)) tmp = fma(Float64(t - x), Float64(y / a), x); else tmp = fma(Float64(Float64(x - t) / z), y, t); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -0.00013], N[Not[LessEqual[a, 6e+32]], $MachinePrecision]], N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.00013 \lor \neg \left(a \leq 6 \cdot 10^{+32}\right):\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
\end{array}
\end{array}
if a < -1.29999999999999989e-4 or 6e32 < a Initial program 91.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6493.2
Applied rewrites93.2%
Taylor expanded in z around 0
lower-/.f6475.2
Applied rewrites75.2%
if -1.29999999999999989e-4 < a < 6e32Initial program 66.9%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6487.2
Applied rewrites87.2%
Taylor expanded in a around 0
Applied rewrites84.3%
Final simplification79.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -0.00021) (not (<= a 8.2e+34))) (fma (- y z) (/ t a) x) (fma (/ (- x t) z) y t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.00021) || !(a <= 8.2e+34)) {
tmp = fma((y - z), (t / a), x);
} else {
tmp = fma(((x - t) / z), y, t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -0.00021) || !(a <= 8.2e+34)) tmp = fma(Float64(y - z), Float64(t / a), x); else tmp = fma(Float64(Float64(x - t) / z), y, t); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -0.00021], N[Not[LessEqual[a, 8.2e+34]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.00021 \lor \neg \left(a \leq 8.2 \cdot 10^{+34}\right):\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
\end{array}
\end{array}
if a < -2.1000000000000001e-4 or 8.1999999999999997e34 < a Initial program 91.8%
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--.f6483.2
Applied rewrites83.2%
Taylor expanded in x around 0
Applied rewrites72.8%
if -2.1000000000000001e-4 < a < 8.1999999999999997e34Initial program 66.9%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6487.2
Applied rewrites87.2%
Taylor expanded in a around 0
Applied rewrites84.3%
Final simplification78.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -5.6e+49) (not (<= a 1.4e+39))) (fma (- z) (/ t a) x) (fma (/ (- x t) z) y t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.6e+49) || !(a <= 1.4e+39)) {
tmp = fma(-z, (t / a), x);
} else {
tmp = fma(((x - t) / z), y, t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -5.6e+49) || !(a <= 1.4e+39)) tmp = fma(Float64(-z), Float64(t / a), x); else tmp = fma(Float64(Float64(x - t) / z), y, t); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5.6e+49], N[Not[LessEqual[a, 1.4e+39]], $MachinePrecision]], N[((-z) * N[(t / a), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.6 \cdot 10^{+49} \lor \neg \left(a \leq 1.4 \cdot 10^{+39}\right):\\
\;\;\;\;\mathsf{fma}\left(-z, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
\end{array}
\end{array}
if a < -5.5999999999999996e49 or 1.40000000000000001e39 < a Initial program 91.9%
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--.f6483.9
Applied rewrites83.9%
Taylor expanded in x around 0
Applied rewrites72.9%
Taylor expanded in y around 0
Applied rewrites57.2%
if -5.5999999999999996e49 < a < 1.40000000000000001e39Initial program 68.1%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6485.7
Applied rewrites85.7%
Taylor expanded in a around 0
Applied rewrites82.9%
Final simplification71.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -0.00021) (fma (- y z) (/ t a) x) (if (<= a 6e+32) (fma (/ (- x t) z) y t) (fma (/ (- t x) a) y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -0.00021) {
tmp = fma((y - z), (t / a), x);
} else if (a <= 6e+32) {
tmp = fma(((x - t) / z), y, t);
} else {
tmp = fma(((t - x) / a), y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -0.00021) tmp = fma(Float64(y - z), Float64(t / a), x); elseif (a <= 6e+32) tmp = fma(Float64(Float64(x - t) / z), y, t); else tmp = fma(Float64(Float64(t - x) / a), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -0.00021], N[(N[(y - z), $MachinePrecision] * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 6e+32], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.00021:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a}, x\right)\\
\mathbf{elif}\;a \leq 6 \cdot 10^{+32}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\end{array}
\end{array}
if a < -2.1000000000000001e-4Initial program 89.3%
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--.f6483.2
Applied rewrites83.2%
Taylor expanded in x around 0
Applied rewrites73.9%
if -2.1000000000000001e-4 < a < 6e32Initial program 66.9%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6487.2
Applied rewrites87.2%
Taylor expanded in a around 0
Applied rewrites84.3%
if 6e32 < a Initial program 94.4%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6474.1
Applied rewrites74.1%
(FPCore (x y z t a) :precision binary64 (if (<= y -5.4e+140) (* (/ t a) y) (if (<= y 9.5e+164) (+ x (* 1.0 t)) (* (/ y (- a)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.4e+140) {
tmp = (t / a) * y;
} else if (y <= 9.5e+164) {
tmp = x + (1.0 * t);
} else {
tmp = (y / -a) * x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-5.4d+140)) then
tmp = (t / a) * y
else if (y <= 9.5d+164) then
tmp = x + (1.0d0 * t)
else
tmp = (y / -a) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.4e+140) {
tmp = (t / a) * y;
} else if (y <= 9.5e+164) {
tmp = x + (1.0 * t);
} else {
tmp = (y / -a) * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5.4e+140: tmp = (t / a) * y elif y <= 9.5e+164: tmp = x + (1.0 * t) else: tmp = (y / -a) * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5.4e+140) tmp = Float64(Float64(t / a) * y); elseif (y <= 9.5e+164) tmp = Float64(x + Float64(1.0 * t)); else tmp = Float64(Float64(y / Float64(-a)) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5.4e+140) tmp = (t / a) * y; elseif (y <= 9.5e+164) tmp = x + (1.0 * t); else tmp = (y / -a) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5.4e+140], N[(N[(t / a), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 9.5e+164], N[(x + N[(1.0 * t), $MachinePrecision]), $MachinePrecision], N[(N[(y / (-a)), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.4 \cdot 10^{+140}:\\
\;\;\;\;\frac{t}{a} \cdot y\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+164}:\\
\;\;\;\;x + 1 \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{-a} \cdot x\\
\end{array}
\end{array}
if y < -5.40000000000000036e140Initial program 93.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--.f6464.8
Applied rewrites64.8%
Taylor expanded in y around inf
Applied rewrites50.1%
Taylor expanded in x around 0
Applied rewrites40.8%
if -5.40000000000000036e140 < y < 9.49999999999999976e164Initial program 75.4%
Taylor expanded in z around inf
lower--.f6426.3
Applied rewrites26.3%
Taylor expanded in t around inf
Applied rewrites27.2%
Taylor expanded in x around 0
Applied rewrites45.4%
if 9.49999999999999976e164 < y Initial program 89.1%
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--.f6463.9
Applied rewrites63.9%
Taylor expanded in y around inf
Applied rewrites60.5%
Taylor expanded in x around inf
Applied rewrites46.0%
Final simplification44.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -5.4e+140) (not (<= y 1.5e+132))) (* (/ t a) y) (+ x (* 1.0 t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -5.4e+140) || !(y <= 1.5e+132)) {
tmp = (t / a) * y;
} else {
tmp = x + (1.0 * 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 ((y <= (-5.4d+140)) .or. (.not. (y <= 1.5d+132))) then
tmp = (t / a) * y
else
tmp = x + (1.0d0 * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -5.4e+140) || !(y <= 1.5e+132)) {
tmp = (t / a) * y;
} else {
tmp = x + (1.0 * t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -5.4e+140) or not (y <= 1.5e+132): tmp = (t / a) * y else: tmp = x + (1.0 * t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -5.4e+140) || !(y <= 1.5e+132)) tmp = Float64(Float64(t / a) * y); else tmp = Float64(x + Float64(1.0 * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -5.4e+140) || ~((y <= 1.5e+132))) tmp = (t / a) * y; else tmp = x + (1.0 * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -5.4e+140], N[Not[LessEqual[y, 1.5e+132]], $MachinePrecision]], N[(N[(t / a), $MachinePrecision] * y), $MachinePrecision], N[(x + N[(1.0 * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.4 \cdot 10^{+140} \lor \neg \left(y \leq 1.5 \cdot 10^{+132}\right):\\
\;\;\;\;\frac{t}{a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + 1 \cdot t\\
\end{array}
\end{array}
if y < -5.40000000000000036e140 or 1.4999999999999999e132 < y Initial program 93.0%
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--.f6469.2
Applied rewrites69.2%
Taylor expanded in y around inf
Applied rewrites57.1%
Taylor expanded in x around 0
Applied rewrites40.7%
if -5.40000000000000036e140 < y < 1.4999999999999999e132Initial program 73.8%
Taylor expanded in z around inf
lower--.f6427.3
Applied rewrites27.3%
Taylor expanded in t around inf
Applied rewrites28.2%
Taylor expanded in x around 0
Applied rewrites46.0%
Final simplification44.5%
(FPCore (x y z t a) :precision binary64 (+ x (* 1.0 t)))
double code(double x, double y, double z, double t, double a) {
return x + (1.0 * 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 + (1.0d0 * t)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (1.0 * t);
}
def code(x, y, z, t, a): return x + (1.0 * t)
function code(x, y, z, t, a) return Float64(x + Float64(1.0 * t)) end
function tmp = code(x, y, z, t, a) tmp = x + (1.0 * t); end
code[x_, y_, z_, t_, a_] := N[(x + N[(1.0 * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + 1 \cdot t
\end{array}
Initial program 79.0%
Taylor expanded in z around inf
lower--.f6422.2
Applied rewrites22.2%
Taylor expanded in t around inf
Applied rewrites23.4%
Taylor expanded in x around 0
Applied rewrites38.2%
(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.0%
Taylor expanded in z around inf
lower--.f6422.2
Applied rewrites22.2%
(FPCore (x y z t a) :precision binary64 (+ x (- x)))
double code(double x, double y, double z, double t, double a) {
return x + -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 + -x
end function
public static double code(double x, double y, double z, double t, double a) {
return x + -x;
}
def code(x, y, z, t, a): return x + -x
function code(x, y, z, t, a) return Float64(x + Float64(-x)) end
function tmp = code(x, y, z, t, a) tmp = x + -x; end
code[x_, y_, z_, t_, a_] := N[(x + (-x)), $MachinePrecision]
\begin{array}{l}
\\
x + \left(-x\right)
\end{array}
Initial program 79.0%
Taylor expanded in z around inf
lower--.f6422.2
Applied rewrites22.2%
Taylor expanded in x around inf
Applied rewrites2.7%
herbie shell --seed 2024329
(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)))))