
(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 18 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 (<= t_1 -1e-307)
(fma (/ (- y z) (- a z)) (- t x) x)
(if (<= t_1 0.0)
(fma (fma -1.0 t x) (/ (- y a) z) t)
(fma -1.0 (/ (- t x) (/ (- (- a z)) (- y z))) x)))))
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-307) {
tmp = fma(((y - z) / (a - z)), (t - x), x);
} else if (t_1 <= 0.0) {
tmp = fma(fma(-1.0, t, x), ((y - a) / z), t);
} else {
tmp = fma(-1.0, ((t - x) / (-(a - z) / (y - z))), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= -1e-307) tmp = fma(Float64(Float64(y - z) / Float64(a - z)), Float64(t - x), x); elseif (t_1 <= 0.0) tmp = fma(fma(-1.0, t, x), Float64(Float64(y - a) / z), t); else tmp = fma(-1.0, Float64(Float64(t - x) / Float64(Float64(-Float64(a - z)) / Float64(y - z))), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-307], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(-1.0 * t + x), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], N[(-1.0 * N[(N[(t - x), $MachinePrecision] / N[((-N[(a - z), $MachinePrecision]) / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $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^{-307}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, t, x\right), \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{t - x}{\frac{-\left(a - z\right)}{y - z}}, x\right)\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.99999999999999909e-308Initial program 86.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-/.f6495.2
Applied rewrites95.2%
if -9.99999999999999909e-308 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 2.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 rewrites96.6%
if 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 89.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-/.f6496.5
Applied rewrites96.5%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6496.4
Applied rewrites96.4%
lift--.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lift-/.f64N/A
un-div-invN/A
*-lft-identityN/A
remove-double-divN/A
frac-2negN/A
metadata-evalN/A
associate-/r/N/A
metadata-evalN/A
times-fracN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites96.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (or (<= t_1 -1e-307) (not (<= t_1 0.0)))
(fma (/ (- y z) (- a z)) (- t x) x)
(fma (fma -1.0 t x) (/ (- y a) z) t))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if ((t_1 <= -1e-307) || !(t_1 <= 0.0)) {
tmp = fma(((y - z) / (a - z)), (t - x), x);
} else {
tmp = fma(fma(-1.0, t, x), ((y - a) / z), t);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if ((t_1 <= -1e-307) || !(t_1 <= 0.0)) tmp = fma(Float64(Float64(y - z) / Float64(a - z)), Float64(t - x), x); else tmp = fma(fma(-1.0, t, x), Float64(Float64(y - a) / z), t); 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-307], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(-1.0 * t + x), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-307} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, t, x\right), \frac{y - a}{z}, t\right)\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.99999999999999909e-308 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 87.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-/.f6495.8
Applied rewrites95.8%
if -9.99999999999999909e-308 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 2.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 rewrites96.6%
Final simplification95.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (or (<= t_1 -4e-200) (not (<= t_1 2e-282)))
(fma (/ (- x t) (- z a)) (- y z) x)
(fma (fma -1.0 t x) (/ (- y a) z) 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 <= -4e-200) || !(t_1 <= 2e-282)) {
tmp = fma(((x - t) / (z - a)), (y - z), x);
} else {
tmp = fma(fma(-1.0, t, x), ((y - a) / z), 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 <= -4e-200) || !(t_1 <= 2e-282)) tmp = fma(Float64(Float64(x - t) / Float64(z - a)), Float64(y - z), x); else tmp = fma(fma(-1.0, t, x), Float64(Float64(y - a) / z), t); 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, -4e-200], N[Not[LessEqual[t$95$1, 2e-282]], $MachinePrecision]], N[(N[(N[(x - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision], N[(N[(-1.0 * t + x), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-200} \lor \neg \left(t\_1 \leq 2 \cdot 10^{-282}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z - a}, y - z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, t, x\right), \frac{y - a}{z}, t\right)\\
\end{array}
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -3.9999999999999999e-200 or 2e-282 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 91.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6491.8
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--.f6491.8
Applied rewrites91.8%
if -3.9999999999999999e-200 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 2e-282Initial program 10.8%
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 rewrites86.6%
Final simplification90.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.32e+39) (not (<= z 7.8e+28))) (fma (fma -1.0 t x) (/ (- y a) z) t) (fma (/ (- y z) a) (- t x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.32e+39) || !(z <= 7.8e+28)) {
tmp = fma(fma(-1.0, t, x), ((y - a) / z), t);
} else {
tmp = fma(((y - z) / a), (t - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.32e+39) || !(z <= 7.8e+28)) tmp = fma(fma(-1.0, t, x), Float64(Float64(y - a) / z), t); else tmp = fma(Float64(Float64(y - z) / a), Float64(t - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.32e+39], N[Not[LessEqual[z, 7.8e+28]], $MachinePrecision]], N[(N[(-1.0 * t + x), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.32 \cdot 10^{+39} \lor \neg \left(z \leq 7.8 \cdot 10^{+28}\right):\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, t, x\right), \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\
\end{array}
\end{array}
if z < -1.32e39 or 7.7999999999999997e28 < z Initial program 61.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
Applied rewrites81.4%
if -1.32e39 < z < 7.7999999999999997e28Initial program 90.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-/.f6495.6
Applied rewrites95.6%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6482.9
Applied rewrites82.9%
Final simplification82.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (/ (* y t) z))))
(if (<= z -1.85e+92)
t_1
(if (<= z -7.2e+42)
(* (/ (- x t) z) y)
(if (<= z 6.4e+19) (fma y (/ t a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((y * t) / z);
double tmp;
if (z <= -1.85e+92) {
tmp = t_1;
} else if (z <= -7.2e+42) {
tmp = ((x - t) / z) * y;
} else if (z <= 6.4e+19) {
tmp = fma(y, (t / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(y * t) / z)) tmp = 0.0 if (z <= -1.85e+92) tmp = t_1; elseif (z <= -7.2e+42) tmp = Float64(Float64(Float64(x - t) / z) * y); elseif (z <= 6.4e+19) tmp = fma(y, Float64(t / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.85e+92], t$95$1, If[LessEqual[z, -7.2e+42], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 6.4e+19], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{y \cdot t}{z}\\
\mathbf{if}\;z \leq -1.85 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{+42}:\\
\;\;\;\;\frac{x - t}{z} \cdot y\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.84999999999999999e92 or 6.4e19 < z Initial program 60.6%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6455.2
Applied rewrites55.2%
Taylor expanded in a around 0
Applied rewrites59.4%
Taylor expanded in y around 0
Applied rewrites56.4%
if -1.84999999999999999e92 < z < -7.2000000000000002e42Initial program 67.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
Applied rewrites83.5%
Taylor expanded in y around inf
Applied rewrites68.0%
if -7.2000000000000002e42 < z < 6.4e19Initial program 90.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-/.f6495.6
Applied rewrites95.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6475.3
Applied rewrites75.3%
Taylor expanded in x around 0
Applied rewrites63.8%
Final simplification61.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.3e+39) (not (<= z 1.15e+29))) (fma (/ (- x t) z) y t) (fma (/ (- y z) a) (- t x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.3e+39) || !(z <= 1.15e+29)) {
tmp = fma(((x - t) / z), y, t);
} else {
tmp = fma(((y - z) / a), (t - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.3e+39) || !(z <= 1.15e+29)) tmp = fma(Float64(Float64(x - t) / z), y, t); else tmp = fma(Float64(Float64(y - z) / a), Float64(t - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.3e+39], N[Not[LessEqual[z, 1.15e+29]], $MachinePrecision]], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{+39} \lor \neg \left(z \leq 1.15 \cdot 10^{+29}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\
\end{array}
\end{array}
if z < -5.29999999999999979e39 or 1.1500000000000001e29 < z Initial program 61.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
Applied rewrites81.4%
Taylor expanded in a around 0
Applied rewrites69.9%
if -5.29999999999999979e39 < z < 1.1500000000000001e29Initial program 90.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-/.f6495.6
Applied rewrites95.6%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6482.9
Applied rewrites82.9%
Final simplification77.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.2e+39) (not (<= z 7.8e+28))) (fma (/ (- x t) z) y t) (fma (- y z) (/ (- t x) a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+39) || !(z <= 7.8e+28)) {
tmp = fma(((x - t) / z), y, t);
} else {
tmp = fma((y - z), ((t - x) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.2e+39) || !(z <= 7.8e+28)) tmp = fma(Float64(Float64(x - t) / z), y, t); else tmp = fma(Float64(y - z), Float64(Float64(t - x) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.2e+39], N[Not[LessEqual[z, 7.8e+28]], $MachinePrecision]], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+39} \lor \neg \left(z \leq 7.8 \cdot 10^{+28}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\end{array}
\end{array}
if z < -5.2e39 or 7.7999999999999997e28 < z Initial program 61.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
Applied rewrites81.4%
Taylor expanded in a around 0
Applied rewrites69.9%
if -5.2e39 < z < 7.7999999999999997e28Initial program 90.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--.f6480.0
Applied rewrites80.0%
Final simplification75.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e-5) (not (<= z 7.6e+17))) (fma (/ (- x t) z) y t) (fma (/ y a) (- t x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e-5) || !(z <= 7.6e+17)) {
tmp = fma(((x - t) / z), y, t);
} else {
tmp = fma((y / a), (t - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.9e-5) || !(z <= 7.6e+17)) tmp = fma(Float64(Float64(x - t) / z), y, t); else tmp = fma(Float64(y / a), Float64(t - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.9e-5], N[Not[LessEqual[z, 7.6e+17]], $MachinePrecision]], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-5} \lor \neg \left(z \leq 7.6 \cdot 10^{+17}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\end{array}
\end{array}
if z < -1.9000000000000001e-5 or 7.6e17 < z Initial program 63.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
Applied rewrites78.4%
Taylor expanded in a around 0
Applied rewrites67.9%
if -1.9000000000000001e-5 < z < 7.6e17Initial program 89.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-/.f6495.4
Applied rewrites95.4%
Taylor expanded in z around 0
lower-/.f6479.9
Applied rewrites79.9%
Final simplification74.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e+39) (not (<= z 7.6e+17))) (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 ((z <= -4.8e+39) || !(z <= 7.6e+17)) {
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 ((z <= -4.8e+39) || !(z <= 7.6e+17)) 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[Or[LessEqual[z, -4.8e+39], N[Not[LessEqual[z, 7.6e+17]], $MachinePrecision]], 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}\;z \leq -4.8 \cdot 10^{+39} \lor \neg \left(z \leq 7.6 \cdot 10^{+17}\right):\\
\;\;\;\;\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 z < -4.8000000000000002e39 or 7.6e17 < z Initial program 61.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
Applied rewrites80.6%
Taylor expanded in a around 0
Applied rewrites69.4%
if -4.8000000000000002e39 < z < 7.6e17Initial program 90.3%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6475.3
Applied rewrites75.3%
Final simplification72.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.6e+39) (not (<= z 5.4e+17))) (fma (/ (- x t) z) y t) (fma y (/ t a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.6e+39) || !(z <= 5.4e+17)) {
tmp = fma(((x - t) / z), y, t);
} else {
tmp = fma(y, (t / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.6e+39) || !(z <= 5.4e+17)) tmp = fma(Float64(Float64(x - t) / z), y, t); else tmp = fma(y, Float64(t / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.6e+39], N[Not[LessEqual[z, 5.4e+17]], $MachinePrecision]], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{+39} \lor \neg \left(z \leq 5.4 \cdot 10^{+17}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\end{array}
\end{array}
if z < -4.60000000000000024e39 or 5.4e17 < z Initial program 61.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
Applied rewrites80.6%
Taylor expanded in a around 0
Applied rewrites69.4%
if -4.60000000000000024e39 < z < 5.4e17Initial program 90.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-/.f6495.6
Applied rewrites95.6%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6475.3
Applied rewrites75.3%
Taylor expanded in x around 0
Applied rewrites63.8%
Final simplification66.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -7.5e+31) (not (<= a 29500000.0))) (fma y (/ t a) x) (- t (/ (* y t) z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.5e+31) || !(a <= 29500000.0)) {
tmp = fma(y, (t / a), x);
} else {
tmp = t - ((y * t) / z);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7.5e+31) || !(a <= 29500000.0)) tmp = fma(y, Float64(t / a), x); else tmp = Float64(t - Float64(Float64(y * t) / z)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7.5e+31], N[Not[LessEqual[a, 29500000.0]], $MachinePrecision]], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], N[(t - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.5 \cdot 10^{+31} \lor \neg \left(a \leq 29500000\right):\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t - \frac{y \cdot t}{z}\\
\end{array}
\end{array}
if a < -7.5e31 or 2.95e7 < a Initial program 89.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
lift--.f64N/A
flip--N/A
clear-numN/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-fma.f64N/A
lower-/.f6492.0
Applied rewrites92.0%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6467.3
Applied rewrites67.3%
Taylor expanded in x around 0
Applied rewrites62.7%
if -7.5e31 < a < 2.95e7Initial program 67.8%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6453.6
Applied rewrites53.6%
Taylor expanded in a around 0
Applied rewrites60.7%
Taylor expanded in y around 0
Applied rewrites56.5%
Final simplification59.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -7.5e+31) (fma y (/ t a) x) (if (<= a 29500000.0) (- t (/ (* y t) z)) (+ x (/ (* t y) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.5e+31) {
tmp = fma(y, (t / a), x);
} else if (a <= 29500000.0) {
tmp = t - ((y * t) / z);
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.5e+31) tmp = fma(y, Float64(t / a), x); elseif (a <= 29500000.0) tmp = Float64(t - Float64(Float64(y * t) / z)); else tmp = Float64(x + Float64(Float64(t * y) / a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.5e+31], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 29500000.0], N[(t - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.5 \cdot 10^{+31}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\mathbf{elif}\;a \leq 29500000:\\
\;\;\;\;t - \frac{y \cdot t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\end{array}
\end{array}
if a < -7.5e31Initial program 86.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-/.f6490.3
Applied rewrites90.3%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6466.4
Applied rewrites66.4%
Taylor expanded in x around 0
Applied rewrites59.3%
if -7.5e31 < a < 2.95e7Initial program 67.8%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6453.6
Applied rewrites53.6%
Taylor expanded in a around 0
Applied rewrites60.7%
Taylor expanded in y around 0
Applied rewrites56.5%
if 2.95e7 < a Initial program 91.1%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6466.7
Applied rewrites66.7%
Taylor expanded in x around 0
Applied rewrites66.8%
Final simplification59.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.35e+116) (not (<= z 1.22e+20))) (* (- t) -1.0) (fma y (/ t a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e+116) || !(z <= 1.22e+20)) {
tmp = -t * -1.0;
} else {
tmp = fma(y, (t / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.35e+116) || !(z <= 1.22e+20)) tmp = Float64(Float64(-t) * -1.0); else tmp = fma(y, Float64(t / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.35e+116], N[Not[LessEqual[z, 1.22e+20]], $MachinePrecision]], N[((-t) * -1.0), $MachinePrecision], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+116} \lor \neg \left(z \leq 1.22 \cdot 10^{+20}\right):\\
\;\;\;\;\left(-t\right) \cdot -1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
\end{array}
\end{array}
if z < -1.35e116 or 1.22e20 < z Initial program 59.0%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6454.7
Applied rewrites54.7%
Taylor expanded in a around 0
Applied rewrites59.9%
Taylor expanded in y around 0
Applied rewrites52.7%
if -1.35e116 < z < 1.22e20Initial program 88.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-/.f6493.2
Applied rewrites93.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6470.8
Applied rewrites70.8%
Taylor expanded in x around 0
Applied rewrites60.0%
Final simplification57.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.2e+90) (not (<= z 1.3e+19))) (* (- t) -1.0) (* (/ y a) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.2e+90) || !(z <= 1.3e+19)) {
tmp = -t * -1.0;
} else {
tmp = (y / a) * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.2d+90)) .or. (.not. (z <= 1.3d+19))) then
tmp = -t * (-1.0d0)
else
tmp = (y / a) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.2e+90) || !(z <= 1.3e+19)) {
tmp = -t * -1.0;
} else {
tmp = (y / a) * t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.2e+90) or not (z <= 1.3e+19): tmp = -t * -1.0 else: tmp = (y / a) * t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.2e+90) || !(z <= 1.3e+19)) tmp = Float64(Float64(-t) * -1.0); else tmp = Float64(Float64(y / a) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.2e+90) || ~((z <= 1.3e+19))) tmp = -t * -1.0; else tmp = (y / a) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.2e+90], N[Not[LessEqual[z, 1.3e+19]], $MachinePrecision]], N[((-t) * -1.0), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+90} \lor \neg \left(z \leq 1.3 \cdot 10^{+19}\right):\\
\;\;\;\;\left(-t\right) \cdot -1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot t\\
\end{array}
\end{array}
if z < -3.19999999999999998e90 or 1.3e19 < z Initial program 60.6%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6455.2
Applied rewrites55.2%
Taylor expanded in a around 0
Applied rewrites59.4%
Taylor expanded in y around 0
Applied rewrites51.8%
if -3.19999999999999998e90 < z < 1.3e19Initial program 88.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-/.f6493.5
Applied rewrites93.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6471.5
Applied rewrites71.5%
Taylor expanded in x around 0
Applied rewrites31.0%
Applied rewrites34.3%
Final simplification41.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.2e+90) (not (<= z 1.3e+19))) (* (- t) -1.0) (* y (/ t a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.2e+90) || !(z <= 1.3e+19)) {
tmp = -t * -1.0;
} else {
tmp = y * (t / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.2d+90)) .or. (.not. (z <= 1.3d+19))) then
tmp = -t * (-1.0d0)
else
tmp = y * (t / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.2e+90) || !(z <= 1.3e+19)) {
tmp = -t * -1.0;
} else {
tmp = y * (t / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.2e+90) or not (z <= 1.3e+19): tmp = -t * -1.0 else: tmp = y * (t / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.2e+90) || !(z <= 1.3e+19)) tmp = Float64(Float64(-t) * -1.0); else tmp = Float64(y * Float64(t / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.2e+90) || ~((z <= 1.3e+19))) tmp = -t * -1.0; else tmp = y * (t / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.2e+90], N[Not[LessEqual[z, 1.3e+19]], $MachinePrecision]], N[((-t) * -1.0), $MachinePrecision], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+90} \lor \neg \left(z \leq 1.3 \cdot 10^{+19}\right):\\
\;\;\;\;\left(-t\right) \cdot -1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3.19999999999999998e90 or 1.3e19 < z Initial program 60.6%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6455.2
Applied rewrites55.2%
Taylor expanded in a around 0
Applied rewrites59.4%
Taylor expanded in y around 0
Applied rewrites51.8%
if -3.19999999999999998e90 < z < 1.3e19Initial program 88.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-/.f6493.5
Applied rewrites93.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6471.5
Applied rewrites71.5%
Taylor expanded in x around 0
Applied rewrites31.0%
Applied rewrites33.4%
Final simplification40.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.0) (not (<= z 6.8e+19))) (* (- t) -1.0) (* 1.0 x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.0) || !(z <= 6.8e+19)) {
tmp = -t * -1.0;
} else {
tmp = 1.0 * 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 ((z <= (-4.0d0)) .or. (.not. (z <= 6.8d+19))) then
tmp = -t * (-1.0d0)
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.0) || !(z <= 6.8e+19)) {
tmp = -t * -1.0;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.0) or not (z <= 6.8e+19): tmp = -t * -1.0 else: tmp = 1.0 * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.0) || !(z <= 6.8e+19)) tmp = Float64(Float64(-t) * -1.0); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.0) || ~((z <= 6.8e+19))) tmp = -t * -1.0; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.0], N[Not[LessEqual[z, 6.8e+19]], $MachinePrecision]], N[((-t) * -1.0), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \lor \neg \left(z \leq 6.8 \cdot 10^{+19}\right):\\
\;\;\;\;\left(-t\right) \cdot -1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -4 or 6.8e19 < z Initial program 63.3%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6457.3
Applied rewrites57.3%
Taylor expanded in a around 0
Applied rewrites56.6%
Taylor expanded in y around 0
Applied rewrites45.3%
if -4 < z < 6.8e19Initial 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.5
Applied rewrites95.5%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6476.2
Applied rewrites76.2%
Taylor expanded in x around inf
Applied rewrites52.1%
Taylor expanded in y around 0
Applied rewrites33.0%
Final simplification38.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.5e+180) (not (<= z 1.22e+20))) (+ x (- t x)) (* 1.0 x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.5e+180) || !(z <= 1.22e+20)) {
tmp = x + (t - x);
} else {
tmp = 1.0 * 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 ((z <= (-2.5d+180)) .or. (.not. (z <= 1.22d+20))) then
tmp = x + (t - x)
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.5e+180) || !(z <= 1.22e+20)) {
tmp = x + (t - x);
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.5e+180) or not (z <= 1.22e+20): tmp = x + (t - x) else: tmp = 1.0 * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.5e+180) || !(z <= 1.22e+20)) tmp = Float64(x + Float64(t - x)); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.5e+180) || ~((z <= 1.22e+20))) tmp = x + (t - x); else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.5e+180], N[Not[LessEqual[z, 1.22e+20]], $MachinePrecision]], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+180} \lor \neg \left(z \leq 1.22 \cdot 10^{+20}\right):\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -2.4999999999999998e180 or 1.22e20 < z Initial program 58.1%
Taylor expanded in z around inf
lower--.f6439.4
Applied rewrites39.4%
if -2.4999999999999998e180 < z < 1.22e20Initial 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-/.f6491.7
Applied rewrites91.7%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6468.2
Applied rewrites68.2%
Taylor expanded in x around inf
Applied rewrites46.1%
Taylor expanded in y around 0
Applied rewrites30.4%
Final simplification33.2%
(FPCore (x y z t a) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t, double a) {
return 1.0 * 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 = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t, double a) {
return 1.0 * x;
}
def code(x, y, z, t, a): return 1.0 * x
function code(x, y, z, t, a) return Float64(1.0 * x) end
function tmp = code(x, y, z, t, a) tmp = 1.0 * x; end
code[x_, y_, z_, t_, a_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot x
\end{array}
Initial program 77.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-/.f6485.0
Applied rewrites85.0%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6450.2
Applied rewrites50.2%
Taylor expanded in x around inf
Applied rewrites34.9%
Taylor expanded in y around 0
Applied rewrites23.5%
Final simplification23.5%
herbie shell --seed 2024318
(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)))))