
(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 (fma (/ (- z y) (- z a)) (- t x) x))
(t_2 (- x (* (/ (- x t) (- a z)) (- y z)))))
(if (<= t_2 -1e-267)
t_1
(if (<= t_2 0.0) (fma (fma t -1.0 x) (/ (- y a) z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((z - y) / (z - a)), (t - x), x);
double t_2 = x - (((x - t) / (a - z)) * (y - z));
double tmp;
if (t_2 <= -1e-267) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = fma(fma(t, -1.0, x), ((y - a) / z), t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(z - y) / Float64(z - a)), Float64(t - x), x) t_2 = Float64(x - Float64(Float64(Float64(x - t) / Float64(a - z)) * Float64(y - z))) tmp = 0.0 if (t_2 <= -1e-267) tmp = t_1; elseif (t_2 <= 0.0) tmp = fma(fma(t, -1.0, x), Float64(Float64(y - a) / z), t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(N[(x - t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-267], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(t * -1.0 + x), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{z - y}{z - a}, t - x, x\right)\\
t_2 := x - \frac{x - t}{a - z} \cdot \left(y - z\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-267}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(t, -1, x\right), \frac{y - a}{z}, 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.9999999999999998e-268 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 89.9%
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.2
Applied rewrites95.2%
if -9.9999999999999998e-268 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 3.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
Applied rewrites100.0%
Final simplification95.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- x t) (- z a)) (- y z) x))
(t_2 (- x (* (/ (- x t) (- a z)) (- y z)))))
(if (<= t_2 -1e-267)
t_1
(if (<= t_2 0.0)
(fma (fma t -1.0 x) (/ (- y a) z) t)
(if (<= t_2 1e+290) t_1 (+ (* (/ y (- z a)) (- x t)) x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((x - t) / (z - a)), (y - z), x);
double t_2 = x - (((x - t) / (a - z)) * (y - z));
double tmp;
if (t_2 <= -1e-267) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = fma(fma(t, -1.0, x), ((y - a) / z), t);
} else if (t_2 <= 1e+290) {
tmp = t_1;
} else {
tmp = ((y / (z - a)) * (x - t)) + x;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(x - t) / Float64(z - a)), Float64(y - z), x) t_2 = Float64(x - Float64(Float64(Float64(x - t) / Float64(a - z)) * Float64(y - z))) tmp = 0.0 if (t_2 <= -1e-267) tmp = t_1; elseif (t_2 <= 0.0) tmp = fma(fma(t, -1.0, x), Float64(Float64(y - a) / z), t); elseif (t_2 <= 1e+290) tmp = t_1; else tmp = Float64(Float64(Float64(y / Float64(z - a)) * Float64(x - t)) + x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(N[(x - t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-267], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(t * -1.0 + x), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[t$95$2, 1e+290], t$95$1, N[(N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x - t}{z - a}, y - z, x\right)\\
t_2 := x - \frac{x - t}{a - z} \cdot \left(y - z\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-267}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(t, -1, x\right), \frac{y - a}{z}, t\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+290}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z - a} \cdot \left(x - t\right) + x\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999998e-268 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000006e290Initial program 92.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6492.5
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6492.5
Applied rewrites92.5%
if -9.9999999999999998e-268 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 3.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
Applied rewrites100.0%
if 1.00000000000000006e290 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 64.3%
Taylor expanded in y around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6488.7
Applied rewrites88.7%
Final simplification92.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- y z) a) (- t x) x)))
(if (<= a -255.0)
t_1
(if (<= a 3.1e-99)
(- t (/ (* (- a y) (- x t)) z))
(if (<= a 3.5e+69) (* (/ t (- z a)) (- z y)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - z) / a), (t - x), x);
double tmp;
if (a <= -255.0) {
tmp = t_1;
} else if (a <= 3.1e-99) {
tmp = t - (((a - y) * (x - t)) / z);
} else if (a <= 3.5e+69) {
tmp = (t / (z - a)) * (z - y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - z) / a), Float64(t - x), x) tmp = 0.0 if (a <= -255.0) tmp = t_1; elseif (a <= 3.1e-99) tmp = Float64(t - Float64(Float64(Float64(a - y) * Float64(x - t)) / z)); elseif (a <= 3.5e+69) tmp = Float64(Float64(t / Float64(z - a)) * Float64(z - y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -255.0], t$95$1, If[LessEqual[a, 3.1e-99], N[(t - N[(N[(N[(a - y), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.5e+69], N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\
\mathbf{if}\;a \leq -255:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.1 \cdot 10^{-99}:\\
\;\;\;\;t - \frac{\left(a - y\right) \cdot \left(x - t\right)}{z}\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{+69}:\\
\;\;\;\;\frac{t}{z - a} \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -255 or 3.49999999999999987e69 < a Initial program 90.5%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6477.3
Applied rewrites77.3%
if -255 < a < 3.0999999999999999e-99Initial program 71.8%
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-/.f6478.6
Applied rewrites78.6%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites81.0%
if 3.0999999999999999e-99 < a < 3.49999999999999987e69Initial program 86.6%
Taylor expanded in t around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6469.8
Applied rewrites69.8%
Final simplification78.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- y z) a) (- t x) x)))
(if (<= a -205.0)
t_1
(if (<= a 1.65e-91)
(- t (/ (* (- t x) y) z))
(if (<= a 3.5e+69) (* (/ t (- z a)) (- z y)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - z) / a), (t - x), x);
double tmp;
if (a <= -205.0) {
tmp = t_1;
} else if (a <= 1.65e-91) {
tmp = t - (((t - x) * y) / z);
} else if (a <= 3.5e+69) {
tmp = (t / (z - a)) * (z - y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - z) / a), Float64(t - x), x) tmp = 0.0 if (a <= -205.0) tmp = t_1; elseif (a <= 1.65e-91) tmp = Float64(t - Float64(Float64(Float64(t - x) * y) / z)); elseif (a <= 3.5e+69) tmp = Float64(Float64(t / Float64(z - a)) * Float64(z - y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -205.0], t$95$1, If[LessEqual[a, 1.65e-91], N[(t - N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.5e+69], N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\
\mathbf{if}\;a \leq -205:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{-91}:\\
\;\;\;\;t - \frac{\left(t - x\right) \cdot y}{z}\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{+69}:\\
\;\;\;\;\frac{t}{z - a} \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -205 or 3.49999999999999987e69 < a Initial program 90.5%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6477.3
Applied rewrites77.3%
if -205 < a < 1.65000000000000006e-91Initial program 71.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-/.f6478.9
Applied rewrites78.9%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites80.5%
Taylor expanded in a around 0
Applied rewrites77.1%
if 1.65000000000000006e-91 < a < 3.49999999999999987e69Initial program 89.3%
Taylor expanded in t around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6471.2
Applied rewrites71.2%
Final simplification76.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ y a) (- t x) x)))
(if (<= a -95000000000.0)
t_1
(if (<= a 1.65e-91)
(- t (/ (* (- t x) y) z))
(if (<= a 1.65e+117) (* (/ t (- z a)) (- z y)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y / a), (t - x), x);
double tmp;
if (a <= -95000000000.0) {
tmp = t_1;
} else if (a <= 1.65e-91) {
tmp = t - (((t - x) * y) / z);
} else if (a <= 1.65e+117) {
tmp = (t / (z - a)) * (z - y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y / a), Float64(t - x), x) tmp = 0.0 if (a <= -95000000000.0) tmp = t_1; elseif (a <= 1.65e-91) tmp = Float64(t - Float64(Float64(Float64(t - x) * y) / z)); elseif (a <= 1.65e+117) tmp = Float64(Float64(t / Float64(z - a)) * Float64(z - y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -95000000000.0], t$95$1, If[LessEqual[a, 1.65e-91], N[(t - N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.65e+117], N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{if}\;a \leq -95000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{-91}:\\
\;\;\;\;t - \frac{\left(t - x\right) \cdot y}{z}\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{+117}:\\
\;\;\;\;\frac{t}{z - a} \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -9.5e10 or 1.6499999999999999e117 < a Initial program 93.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-/.f6494.0
Applied rewrites94.0%
Taylor expanded in z around 0
lower-/.f6474.4
Applied rewrites74.4%
if -9.5e10 < a < 1.65000000000000006e-91Initial program 71.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-/.f6479.6
Applied rewrites79.6%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites79.6%
Taylor expanded in a around 0
Applied rewrites76.3%
if 1.65000000000000006e-91 < a < 1.6499999999999999e117Initial program 85.4%
Taylor expanded in t around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6466.8
Applied rewrites66.8%
Final simplification74.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (fma t -1.0 x) (/ (- y a) z) t)))
(if (<= z -320000000.0)
t_1
(if (<= z 0.034) (+ (* (/ y (- z a)) (- x t)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(fma(t, -1.0, x), ((y - a) / z), t);
double tmp;
if (z <= -320000000.0) {
tmp = t_1;
} else if (z <= 0.034) {
tmp = ((y / (z - a)) * (x - t)) + x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(fma(t, -1.0, x), Float64(Float64(y - a) / z), t) tmp = 0.0 if (z <= -320000000.0) tmp = t_1; elseif (z <= 0.034) tmp = Float64(Float64(Float64(y / Float64(z - a)) * Float64(x - t)) + x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t * -1.0 + x), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -320000000.0], t$95$1, If[LessEqual[z, 0.034], N[(N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(t, -1, x\right), \frac{y - a}{z}, t\right)\\
\mathbf{if}\;z \leq -320000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.034:\\
\;\;\;\;\frac{y}{z - a} \cdot \left(x - t\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.2e8 or 0.034000000000000002 < z Initial program 73.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
Applied rewrites85.0%
if -3.2e8 < z < 0.034000000000000002Initial program 88.1%
Taylor expanded in y around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6485.2
Applied rewrites85.2%
Final simplification85.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (/ (* a x) z))))
(if (<= z -6.9e+62)
t_1
(if (<= z -4.75e-110)
(* (/ (- x t) z) y)
(if (<= z 0.034) (- x (* (/ y a) x)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((a * x) / z);
double tmp;
if (z <= -6.9e+62) {
tmp = t_1;
} else if (z <= -4.75e-110) {
tmp = ((x - t) / z) * y;
} else if (z <= 0.034) {
tmp = x - ((y / a) * x);
} 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 - ((a * x) / z)
if (z <= (-6.9d+62)) then
tmp = t_1
else if (z <= (-4.75d-110)) then
tmp = ((x - t) / z) * y
else if (z <= 0.034d0) then
tmp = x - ((y / a) * x)
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 - ((a * x) / z);
double tmp;
if (z <= -6.9e+62) {
tmp = t_1;
} else if (z <= -4.75e-110) {
tmp = ((x - t) / z) * y;
} else if (z <= 0.034) {
tmp = x - ((y / a) * x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - ((a * x) / z) tmp = 0 if z <= -6.9e+62: tmp = t_1 elif z <= -4.75e-110: tmp = ((x - t) / z) * y elif z <= 0.034: tmp = x - ((y / a) * x) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(a * x) / z)) tmp = 0.0 if (z <= -6.9e+62) tmp = t_1; elseif (z <= -4.75e-110) tmp = Float64(Float64(Float64(x - t) / z) * y); elseif (z <= 0.034) tmp = Float64(x - Float64(Float64(y / a) * x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - ((a * x) / z); tmp = 0.0; if (z <= -6.9e+62) tmp = t_1; elseif (z <= -4.75e-110) tmp = ((x - t) / z) * y; elseif (z <= 0.034) tmp = x - ((y / a) * x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(a * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.9e+62], t$95$1, If[LessEqual[z, -4.75e-110], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 0.034], N[(x - N[(N[(y / a), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{a \cdot x}{z}\\
\mathbf{if}\;z \leq -6.9 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.75 \cdot 10^{-110}:\\
\;\;\;\;\frac{x - t}{z} \cdot y\\
\mathbf{elif}\;z \leq 0.034:\\
\;\;\;\;x - \frac{y}{a} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.89999999999999998e62 or 0.034000000000000002 < z Initial program 73.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-/.f6477.0
Applied rewrites77.0%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites67.0%
Taylor expanded in t around 0
Applied rewrites68.6%
Taylor expanded in a around inf
Applied rewrites55.7%
if -6.89999999999999998e62 < z < -4.75000000000000002e-110Initial program 87.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-/.f6486.9
Applied rewrites86.9%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites63.1%
Taylor expanded in y around 0
Applied rewrites17.6%
Taylor expanded in y around inf
Applied rewrites43.7%
if -4.75000000000000002e-110 < z < 0.034000000000000002Initial program 87.0%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6476.6
Applied rewrites76.6%
Taylor expanded in t around 0
Applied rewrites52.8%
Taylor expanded in z around 0
Applied rewrites53.1%
Final simplification53.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -340000000.0)
(* (/ (- z y) (- z a)) t)
(if (<= z 0.034)
(+ (* (/ y (- z a)) (- x t)) x)
(- t (/ (* (- a y) (- x t)) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -340000000.0) {
tmp = ((z - y) / (z - a)) * t;
} else if (z <= 0.034) {
tmp = ((y / (z - a)) * (x - t)) + x;
} else {
tmp = t - (((a - y) * (x - t)) / 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 <= (-340000000.0d0)) then
tmp = ((z - y) / (z - a)) * t
else if (z <= 0.034d0) then
tmp = ((y / (z - a)) * (x - t)) + x
else
tmp = t - (((a - y) * (x - t)) / 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 <= -340000000.0) {
tmp = ((z - y) / (z - a)) * t;
} else if (z <= 0.034) {
tmp = ((y / (z - a)) * (x - t)) + x;
} else {
tmp = t - (((a - y) * (x - t)) / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -340000000.0: tmp = ((z - y) / (z - a)) * t elif z <= 0.034: tmp = ((y / (z - a)) * (x - t)) + x else: tmp = t - (((a - y) * (x - t)) / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -340000000.0) tmp = Float64(Float64(Float64(z - y) / Float64(z - a)) * t); elseif (z <= 0.034) tmp = Float64(Float64(Float64(y / Float64(z - a)) * Float64(x - t)) + x); else tmp = Float64(t - Float64(Float64(Float64(a - y) * Float64(x - t)) / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -340000000.0) tmp = ((z - y) / (z - a)) * t; elseif (z <= 0.034) tmp = ((y / (z - a)) * (x - t)) + x; else tmp = t - (((a - y) * (x - t)) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -340000000.0], N[(N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, 0.034], N[(N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(t - N[(N[(N[(a - y), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -340000000:\\
\;\;\;\;\frac{z - y}{z - a} \cdot t\\
\mathbf{elif}\;z \leq 0.034:\\
\;\;\;\;\frac{y}{z - a} \cdot \left(x - t\right) + x\\
\mathbf{else}:\\
\;\;\;\;t - \frac{\left(a - y\right) \cdot \left(x - t\right)}{z}\\
\end{array}
\end{array}
if z < -3.4e8Initial program 72.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6472.2
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6472.2
Applied rewrites72.2%
Taylor expanded in t around inf
associate-/l*N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6466.0
Applied rewrites66.0%
if -3.4e8 < z < 0.034000000000000002Initial program 88.1%
Taylor expanded in y around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6485.2
Applied rewrites85.2%
if 0.034000000000000002 < z Initial program 75.3%
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-/.f6479.9
Applied rewrites79.9%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites74.1%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.3e-45) (* (/ t (- z a)) (- z y)) (if (<= z 0.034) (fma (/ y a) (- t x) x) (- t (/ (* (- y) x) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.3e-45) {
tmp = (t / (z - a)) * (z - y);
} else if (z <= 0.034) {
tmp = fma((y / a), (t - x), x);
} else {
tmp = t - ((-y * x) / z);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.3e-45) tmp = Float64(Float64(t / Float64(z - a)) * Float64(z - y)); elseif (z <= 0.034) tmp = fma(Float64(y / a), Float64(t - x), x); else tmp = Float64(t - Float64(Float64(Float64(-y) * x) / z)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.3e-45], N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.034], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], N[(t - N[(N[((-y) * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{-45}:\\
\;\;\;\;\frac{t}{z - a} \cdot \left(z - y\right)\\
\mathbf{elif}\;z \leq 0.034:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t - \frac{\left(-y\right) \cdot x}{z}\\
\end{array}
\end{array}
if z < -5.2999999999999997e-45Initial program 74.8%
Taylor expanded in t around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6460.4
Applied rewrites60.4%
if -5.2999999999999997e-45 < z < 0.034000000000000002Initial program 87.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-/.f6494.1
Applied rewrites94.1%
Taylor expanded in z around 0
lower-/.f6473.5
Applied rewrites73.5%
if 0.034000000000000002 < z Initial program 75.3%
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-/.f6479.9
Applied rewrites79.9%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites74.1%
Taylor expanded in t around 0
Applied rewrites71.9%
Taylor expanded in a around 0
Applied rewrites68.9%
Final simplification68.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- t (/ (* (- y) x) z)))) (if (<= z -1.52) t_1 (if (<= z 0.034) (fma (/ y a) (- t x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((-y * x) / z);
double tmp;
if (z <= -1.52) {
tmp = t_1;
} else if (z <= 0.034) {
tmp = fma((y / a), (t - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(Float64(-y) * x) / z)) tmp = 0.0 if (z <= -1.52) tmp = t_1; elseif (z <= 0.034) 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[(t - N[(N[((-y) * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.52], t$95$1, If[LessEqual[z, 0.034], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{\left(-y\right) \cdot x}{z}\\
\mathbf{if}\;z \leq -1.52:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.034:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.52 or 0.034000000000000002 < z Initial program 74.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-/.f6477.2
Applied rewrites77.2%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites68.9%
Taylor expanded in t around 0
Applied rewrites66.5%
Taylor expanded in a around 0
Applied rewrites62.2%
if -1.52 < z < 0.034000000000000002Initial program 88.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-/.f6494.3
Applied rewrites94.3%
Taylor expanded in z around 0
lower-/.f6472.3
Applied rewrites72.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a (/ (- t x) z) t)))
(if (<= z -5800000000.0)
t_1
(if (<= z 0.035) (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 <= -5800000000.0) {
tmp = t_1;
} else if (z <= 0.035) {
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 <= -5800000000.0) tmp = t_1; elseif (z <= 0.035) 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, -5800000000.0], t$95$1, If[LessEqual[z, 0.035], 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 -5800000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.035:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.8e9 or 0.035000000000000003 < z Initial program 73.9%
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-/.f6477.0
Applied rewrites77.0%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites68.7%
Taylor expanded in y around 0
Applied rewrites54.5%
if -5.8e9 < z < 0.035000000000000003Initial program 88.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-/.f6494.4
Applied rewrites94.4%
Taylor expanded in z around 0
lower-/.f6471.8
Applied rewrites71.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a (/ (- t x) z) t)))
(if (<= z -5800000000.0)
t_1
(if (<= z 0.034) (fma (/ (- t x) a) y 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 <= -5800000000.0) {
tmp = t_1;
} else if (z <= 0.034) {
tmp = fma(((t - x) / a), y, 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 <= -5800000000.0) tmp = t_1; elseif (z <= 0.034) tmp = fma(Float64(Float64(t - x) / a), y, 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, -5800000000.0], t$95$1, If[LessEqual[z, 0.034], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + 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 -5800000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.034:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.8e9 or 0.034000000000000002 < z Initial program 73.9%
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-/.f6477.0
Applied rewrites77.0%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites68.7%
Taylor expanded in y around 0
Applied rewrites54.5%
if -5.8e9 < z < 0.034000000000000002Initial program 88.1%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6466.3
Applied rewrites66.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (/ (* a x) z))))
(if (<= z -5800000000.0)
t_1
(if (<= z 0.034) (fma (/ (- t x) a) y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((a * x) / z);
double tmp;
if (z <= -5800000000.0) {
tmp = t_1;
} else if (z <= 0.034) {
tmp = fma(((t - x) / a), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(a * x) / z)) tmp = 0.0 if (z <= -5800000000.0) tmp = t_1; elseif (z <= 0.034) tmp = fma(Float64(Float64(t - x) / a), y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(a * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5800000000.0], t$95$1, If[LessEqual[z, 0.034], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{a \cdot x}{z}\\
\mathbf{if}\;z \leq -5800000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.034:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.8e9 or 0.034000000000000002 < z Initial program 73.9%
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-/.f6477.0
Applied rewrites77.0%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites68.7%
Taylor expanded in t around 0
Applied rewrites66.3%
Taylor expanded in a around inf
Applied rewrites52.5%
if -5.8e9 < z < 0.034000000000000002Initial program 88.1%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6466.3
Applied rewrites66.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -320000000.0) (fma a (/ t z) t) (if (<= z 0.034) (- x (* (/ y a) x)) (fma (/ a z) t t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -320000000.0) {
tmp = fma(a, (t / z), t);
} else if (z <= 0.034) {
tmp = x - ((y / a) * x);
} else {
tmp = fma((a / z), t, t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -320000000.0) tmp = fma(a, Float64(t / z), t); elseif (z <= 0.034) tmp = Float64(x - Float64(Float64(y / a) * x)); else tmp = fma(Float64(a / z), t, t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -320000000.0], N[(a * N[(t / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 0.034], N[(x - N[(N[(y / a), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(a / z), $MachinePrecision] * t + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -320000000:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t}{z}, t\right)\\
\mathbf{elif}\;z \leq 0.034:\\
\;\;\;\;x - \frac{y}{a} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a}{z}, t, t\right)\\
\end{array}
\end{array}
if z < -3.2e8Initial program 72.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-/.f6474.1
Applied rewrites74.1%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites63.3%
Taylor expanded in y around 0
Applied rewrites50.9%
Taylor expanded in t around inf
Applied rewrites44.4%
if -3.2e8 < z < 0.034000000000000002Initial program 88.1%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6473.3
Applied rewrites73.3%
Taylor expanded in t around 0
Applied rewrites50.1%
Taylor expanded in z around 0
Applied rewrites50.4%
if 0.034000000000000002 < z Initial program 75.3%
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-/.f6479.9
Applied rewrites79.9%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites74.1%
Taylor expanded in y around 0
Applied rewrites58.1%
Taylor expanded in t around inf
Applied rewrites54.5%
Final simplification49.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -320000000.0) (fma a (/ t z) t) (if (<= z 0.034) (- x (/ (* y x) a)) (fma (/ a z) t t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -320000000.0) {
tmp = fma(a, (t / z), t);
} else if (z <= 0.034) {
tmp = x - ((y * x) / a);
} else {
tmp = fma((a / z), t, t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -320000000.0) tmp = fma(a, Float64(t / z), t); elseif (z <= 0.034) tmp = Float64(x - Float64(Float64(y * x) / a)); else tmp = fma(Float64(a / z), t, t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -320000000.0], N[(a * N[(t / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 0.034], N[(x - N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(a / z), $MachinePrecision] * t + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -320000000:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t}{z}, t\right)\\
\mathbf{elif}\;z \leq 0.034:\\
\;\;\;\;x - \frac{y \cdot x}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a}{z}, t, t\right)\\
\end{array}
\end{array}
if z < -3.2e8Initial program 72.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-/.f6474.1
Applied rewrites74.1%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites63.3%
Taylor expanded in y around 0
Applied rewrites50.9%
Taylor expanded in t around inf
Applied rewrites44.4%
if -3.2e8 < z < 0.034000000000000002Initial program 88.1%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6473.3
Applied rewrites73.3%
Taylor expanded in t around 0
Applied rewrites50.1%
Taylor expanded in z around inf
Applied rewrites3.7%
Taylor expanded in z around 0
Applied rewrites46.9%
if 0.034000000000000002 < z Initial program 75.3%
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-/.f6479.9
Applied rewrites79.9%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites74.1%
Taylor expanded in y around 0
Applied rewrites58.1%
Taylor expanded in t around inf
Applied rewrites54.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma x (/ z a) x))) (if (<= a -6.8e+132) t_1 (if (<= a 2.65e+73) (fma (/ a z) t t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(x, (z / a), x);
double tmp;
if (a <= -6.8e+132) {
tmp = t_1;
} else if (a <= 2.65e+73) {
tmp = fma((a / z), t, t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(x, Float64(z / a), x) tmp = 0.0 if (a <= -6.8e+132) tmp = t_1; elseif (a <= 2.65e+73) tmp = fma(Float64(a / z), t, t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(z / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -6.8e+132], t$95$1, If[LessEqual[a, 2.65e+73], N[(N[(a / z), $MachinePrecision] * t + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, \frac{z}{a}, x\right)\\
\mathbf{if}\;a \leq -6.8 \cdot 10^{+132}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.65 \cdot 10^{+73}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a}{z}, t, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.80000000000000051e132 or 2.64999999999999998e73 < a Initial program 92.1%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.9
Applied rewrites84.9%
Taylor expanded in t around 0
Applied rewrites59.0%
Taylor expanded in y around 0
Applied rewrites52.7%
if -6.80000000000000051e132 < a < 2.64999999999999998e73Initial program 76.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-/.f6482.3
Applied rewrites82.3%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites70.2%
Taylor expanded in y around 0
Applied rewrites42.1%
Taylor expanded in t around inf
Applied rewrites38.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ (- t x) x))) (if (<= z -290000000000.0) t_1 (if (<= z 1.75e+37) (fma x (/ z a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - x) + x;
double tmp;
if (z <= -290000000000.0) {
tmp = t_1;
} else if (z <= 1.75e+37) {
tmp = fma(x, (z / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - x) + x) tmp = 0.0 if (z <= -290000000000.0) tmp = t_1; elseif (z <= 1.75e+37) tmp = fma(x, Float64(z / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -290000000000.0], t$95$1, If[LessEqual[z, 1.75e+37], N[(x * N[(z / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - x\right) + x\\
\mathbf{if}\;z \leq -290000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.9e11 or 1.75e37 < z Initial program 72.8%
Taylor expanded in z around inf
lower--.f6441.5
Applied rewrites41.5%
if -2.9e11 < z < 1.75e37Initial program 87.7%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6470.0
Applied rewrites70.0%
Taylor expanded in t around 0
Applied rewrites47.6%
Taylor expanded in y around 0
Applied rewrites34.1%
Final simplification37.4%
(FPCore (x y z t a) :precision binary64 (+ (- t x) x))
double code(double x, double y, double z, double t, double a) {
return (t - 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 = (t - x) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return (t - x) + x;
}
def code(x, y, z, t, a): return (t - x) + x
function code(x, y, z, t, a) return Float64(Float64(t - x) + x) end
function tmp = code(x, y, z, t, a) tmp = (t - x) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\left(t - x\right) + x
\end{array}
Initial program 81.1%
Taylor expanded in z around inf
lower--.f6423.7
Applied rewrites23.7%
Final simplification23.7%
(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(Float64(-x) + 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}
\\
\left(-x\right) + x
\end{array}
Initial program 81.1%
Taylor expanded in z around inf
lower--.f6423.7
Applied rewrites23.7%
Taylor expanded in t around 0
Applied rewrites2.7%
Final simplification2.7%
herbie shell --seed 2024277
(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)))))