
(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(Float64(y - z) * 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[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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(Float64(y - z) * 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[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.2e+170)
(fma (- x t) (/ (- y a) z) t)
(if (<= z 2.4e+104)
(fma (/ (- y z) (- a z)) (- t x) x)
(fma (/ (- (- t x)) z) (- y a) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+170) {
tmp = fma((x - t), ((y - a) / z), t);
} else if (z <= 2.4e+104) {
tmp = fma(((y - z) / (a - z)), (t - x), x);
} else {
tmp = fma((-(t - x) / z), (y - a), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e+170) tmp = fma(Float64(x - t), Float64(Float64(y - a) / z), t); elseif (z <= 2.4e+104) tmp = fma(Float64(Float64(y - z) / Float64(a - z)), Float64(t - x), x); else tmp = fma(Float64(Float64(-Float64(t - x)) / z), Float64(y - a), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e+170], N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 2.4e+104], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], N[(N[((-N[(t - x), $MachinePrecision]) / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+170}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+104}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-\left(t - x\right)}{z}, y - a, t\right)\\
\end{array}
\end{array}
if z < -5.1999999999999996e170Initial program 20.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
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites91.8%
Taylor expanded in z around inf
Applied rewrites93.0%
if -5.1999999999999996e170 < z < 2.4e104Initial program 84.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6492.7
Applied rewrites92.7%
if 2.4e104 < z Initial program 29.2%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites85.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* (- y z) (- t x)) (- a z)))))
(if (or (<= t_1 (- INFINITY))
(not
(or (<= t_1 -2e-267)
(not (or (<= t_1 0.0) (not (<= t_1 4e+305)))))))
(fma (- x t) (/ (- y a) z) t)
(+ x (/ (* (- y z) t) (- a z))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) * (t - x)) / (a - z));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !((t_1 <= -2e-267) || !((t_1 <= 0.0) || !(t_1 <= 4e+305)))) {
tmp = fma((x - t), ((y - a) / z), t);
} else {
tmp = x + (((y - z) * t) / (a - z));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !((t_1 <= -2e-267) || !((t_1 <= 0.0) || !(t_1 <= 4e+305)))) tmp = fma(Float64(x - t), Float64(Float64(y - a) / z), t); else tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[Or[LessEqual[t$95$1, -2e-267], N[Not[Or[LessEqual[t$95$1, 0.0], N[Not[LessEqual[t$95$1, 4e+305]], $MachinePrecision]]], $MachinePrecision]]], $MachinePrecision]], N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq -2 \cdot 10^{-267} \lor \neg \left(t\_1 \leq 0 \lor \neg \left(t\_1 \leq 4 \cdot 10^{+305}\right)\right)\right):\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -inf.0 or -2e-267 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0 or 3.9999999999999998e305 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) Initial program 30.2%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites79.8%
Taylor expanded in z around inf
Applied rewrites80.7%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -2e-267 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 3.9999999999999998e305Initial program 98.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f6487.5
Applied rewrites87.5%
Final simplification84.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.7e+40)
(fma (- x t) (/ (- y a) z) t)
(if (<= z 3.8e+37)
(fma (/ (- y z) a) (- t x) x)
(fma (/ (- (- t x)) z) (- y a) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.7e+40) {
tmp = fma((x - t), ((y - a) / z), t);
} else if (z <= 3.8e+37) {
tmp = fma(((y - z) / a), (t - x), x);
} else {
tmp = fma((-(t - x) / z), (y - a), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.7e+40) tmp = fma(Float64(x - t), Float64(Float64(y - a) / z), t); elseif (z <= 3.8e+37) tmp = fma(Float64(Float64(y - z) / a), Float64(t - x), x); else tmp = fma(Float64(Float64(-Float64(t - x)) / z), Float64(y - a), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.7e+40], N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 3.8e+37], N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], N[(N[((-N[(t - x), $MachinePrecision]) / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-\left(t - x\right)}{z}, y - a, t\right)\\
\end{array}
\end{array}
if z < -3.7e40Initial program 35.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
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites86.3%
Taylor expanded in z around inf
Applied rewrites87.0%
if -3.7e40 < z < 3.7999999999999999e37Initial program 89.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6495.5
Applied rewrites95.5%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6478.6
Applied rewrites78.6%
if 3.7999999999999999e37 < z Initial program 42.3%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites79.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.7e+40) (not (<= z 3.8e+37))) (fma (- x t) (/ (- 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 <= -3.7e+40) || !(z <= 3.8e+37)) {
tmp = fma((x - t), ((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 <= -3.7e+40) || !(z <= 3.8e+37)) tmp = fma(Float64(x - t), 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, -3.7e+40], N[Not[LessEqual[z, 3.8e+37]], $MachinePrecision]], N[(N[(x - t), $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 -3.7 \cdot 10^{+40} \lor \neg \left(z \leq 3.8 \cdot 10^{+37}\right):\\
\;\;\;\;\mathsf{fma}\left(x - t, \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 < -3.7e40 or 3.7999999999999999e37 < z Initial program 39.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
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites82.5%
Taylor expanded in z around inf
Applied rewrites82.8%
if -3.7e40 < z < 3.7999999999999999e37Initial program 89.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6495.5
Applied rewrites95.5%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6478.6
Applied rewrites78.6%
Final simplification80.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.7e+40) (not (<= z 3.8e+37))) (fma (- x t) (/ (- 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 ((z <= -3.7e+40) || !(z <= 3.8e+37)) {
tmp = fma((x - t), ((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 ((z <= -3.7e+40) || !(z <= 3.8e+37)) tmp = fma(Float64(x - t), 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[Or[LessEqual[z, -3.7e+40], N[Not[LessEqual[z, 3.8e+37]], $MachinePrecision]], N[(N[(x - t), $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}\;z \leq -3.7 \cdot 10^{+40} \lor \neg \left(z \leq 3.8 \cdot 10^{+37}\right):\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\end{array}
\end{array}
if z < -3.7e40 or 3.7999999999999999e37 < z Initial program 39.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
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites82.5%
Taylor expanded in z around inf
Applied rewrites82.8%
if -3.7e40 < z < 3.7999999999999999e37Initial program 89.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--.f6476.5
Applied rewrites76.5%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e-75) (not (<= z 3.8e+37))) (fma (- x t) (/ (- y a) z) 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-75) || !(z <= 3.8e+37)) {
tmp = fma((x - t), ((y - a) / z), 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-75) || !(z <= 3.8e+37)) tmp = fma(Float64(x - t), Float64(Float64(y - a) / z), 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-75], N[Not[LessEqual[z, 3.8e+37]], $MachinePrecision]], N[(N[(x - t), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] + 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^{-75} \lor \neg \left(z \leq 3.8 \cdot 10^{+37}\right):\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - a}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\end{array}
\end{array}
if z < -1.89999999999999997e-75 or 3.7999999999999999e37 < z Initial program 45.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
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites78.4%
Taylor expanded in z around inf
Applied rewrites78.7%
if -1.89999999999999997e-75 < z < 3.7999999999999999e37Initial program 91.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6495.6
Applied rewrites95.6%
Taylor expanded in z around 0
lower-/.f6480.4
Applied rewrites80.4%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -8e-92) (not (<= a 1.25e+76))) (fma (/ (- t x) a) y x) (fma (- x t) (/ y z) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -8e-92) || !(a <= 1.25e+76)) {
tmp = fma(((t - x) / a), y, x);
} else {
tmp = fma((x - t), (y / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -8e-92) || !(a <= 1.25e+76)) tmp = fma(Float64(Float64(t - x) / a), y, x); else tmp = fma(Float64(x - t), Float64(y / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -8e-92], N[Not[LessEqual[a, 1.25e+76]], $MachinePrecision]], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], N[(N[(x - t), $MachinePrecision] * N[(y / z), $MachinePrecision] + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8 \cdot 10^{-92} \lor \neg \left(a \leq 1.25 \cdot 10^{+76}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y}{z}, t\right)\\
\end{array}
\end{array}
if a < -7.9999999999999999e-92 or 1.24999999999999998e76 < a Initial program 71.4%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6471.1
Applied rewrites71.1%
if -7.9999999999999999e-92 < a < 1.24999999999999998e76Initial program 59.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
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites81.7%
Taylor expanded in z around inf
Applied rewrites82.6%
Taylor expanded in y around inf
Applied rewrites80.5%
Final simplification75.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.05e+34) (not (<= a 1.25e+76))) (+ x (/ (* t y) a)) (fma (- x t) (/ y z) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.05e+34) || !(a <= 1.25e+76)) {
tmp = x + ((t * y) / a);
} else {
tmp = fma((x - t), (y / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.05e+34) || !(a <= 1.25e+76)) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = fma(Float64(x - t), Float64(y / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.05e+34], N[Not[LessEqual[a, 1.25e+76]], $MachinePrecision]], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(x - t), $MachinePrecision] * N[(y / z), $MachinePrecision] + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.05 \cdot 10^{+34} \lor \neg \left(a \leq 1.25 \cdot 10^{+76}\right):\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y}{z}, t\right)\\
\end{array}
\end{array}
if a < -3.04999999999999998e34 or 1.24999999999999998e76 < a Initial program 70.4%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6463.6
Applied rewrites63.6%
Taylor expanded in x around 0
Applied rewrites64.1%
if -3.04999999999999998e34 < a < 1.24999999999999998e76Initial program 62.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
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites77.4%
Taylor expanded in z around inf
Applied rewrites78.2%
Taylor expanded in y around inf
Applied rewrites75.8%
Final simplification71.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.2e+40) (fma (/ x z) (- y a) t) (if (<= z 1.02e+39) (fma (/ y a) (- t x) x) (fma (- x t) (/ y z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e+40) {
tmp = fma((x / z), (y - a), t);
} else if (z <= 1.02e+39) {
tmp = fma((y / a), (t - x), x);
} else {
tmp = fma((x - t), (y / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.2e+40) tmp = fma(Float64(x / z), Float64(y - a), t); elseif (z <= 1.02e+39) tmp = fma(Float64(y / a), Float64(t - x), x); else tmp = fma(Float64(x - t), Float64(y / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.2e+40], N[(N[(x / z), $MachinePrecision] * N[(y - a), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[z, 1.02e+39], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(x - t), $MachinePrecision] * N[(y / z), $MachinePrecision] + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y - a, t\right)\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+39}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y}{z}, t\right)\\
\end{array}
\end{array}
if z < -3.19999999999999981e40Initial program 35.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
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites86.3%
Taylor expanded in x around inf
Applied rewrites82.9%
if -3.19999999999999981e40 < z < 1.02e39Initial program 90.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6495.6
Applied rewrites95.6%
Taylor expanded in z around 0
lower-/.f6475.7
Applied rewrites75.7%
if 1.02e39 < z Initial program 40.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
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites80.1%
Taylor expanded in z around inf
Applied rewrites80.1%
Taylor expanded in y around inf
Applied rewrites76.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -7.8e-47) (not (<= a 3.1e+92))) (+ x (/ (* t y) a)) (fma (- t) (/ y z) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.8e-47) || !(a <= 3.1e+92)) {
tmp = x + ((t * y) / a);
} else {
tmp = fma(-t, (y / z), t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7.8e-47) || !(a <= 3.1e+92)) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = fma(Float64(-t), Float64(y / z), t); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7.8e-47], N[Not[LessEqual[a, 3.1e+92]], $MachinePrecision]], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[((-t) * N[(y / z), $MachinePrecision] + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.8 \cdot 10^{-47} \lor \neg \left(a \leq 3.1 \cdot 10^{+92}\right):\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-t, \frac{y}{z}, t\right)\\
\end{array}
\end{array}
if a < -7.79999999999999956e-47 or 3.1000000000000002e92 < a Initial program 70.3%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6462.9
Applied rewrites62.9%
Taylor expanded in x around 0
Applied rewrites61.1%
if -7.79999999999999956e-47 < a < 3.1000000000000002e92Initial program 61.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
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites78.7%
Taylor expanded in z around inf
Applied rewrites79.5%
Taylor expanded in y around inf
Applied rewrites77.6%
Taylor expanded in x around 0
Applied rewrites58.6%
Final simplification59.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.2e-78) (not (<= z 2600.0))) (fma (- t) (/ y z) t) (/ (* (- t x) y) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.2e-78) || !(z <= 2600.0)) {
tmp = fma(-t, (y / z), t);
} else {
tmp = ((t - x) * y) / a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.2e-78) || !(z <= 2600.0)) tmp = fma(Float64(-t), Float64(y / z), t); else tmp = Float64(Float64(Float64(t - x) * y) / a); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.2e-78], N[Not[LessEqual[z, 2600.0]], $MachinePrecision]], N[((-t) * N[(y / z), $MachinePrecision] + t), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-78} \lor \neg \left(z \leq 2600\right):\\
\;\;\;\;\mathsf{fma}\left(-t, \frac{y}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a}\\
\end{array}
\end{array}
if z < -2.1999999999999999e-78 or 2600 < z Initial program 48.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
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites76.4%
Taylor expanded in z around inf
Applied rewrites76.6%
Taylor expanded in y around inf
Applied rewrites72.1%
Taylor expanded in x around 0
Applied rewrites54.4%
if -2.1999999999999999e-78 < z < 2600Initial program 91.4%
Taylor expanded in y 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--.f6454.9
Applied rewrites54.9%
Taylor expanded in x around inf
Applied rewrites28.1%
Taylor expanded in z around 0
Applied rewrites38.8%
Final simplification48.1%
(FPCore (x y z t a) :precision binary64 (if (<= y -5500000000.0) (* (/ (- x t) z) y) (if (<= y 2.1e-40) (+ x (- t x)) (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5500000000.0) {
tmp = ((x - t) / z) * y;
} else if (y <= 2.1e-40) {
tmp = x + (t - x);
} else {
tmp = t * (y / (a - z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-5500000000.0d0)) then
tmp = ((x - t) / z) * y
else if (y <= 2.1d-40) then
tmp = x + (t - x)
else
tmp = t * (y / (a - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5500000000.0) {
tmp = ((x - t) / z) * y;
} else if (y <= 2.1e-40) {
tmp = x + (t - x);
} else {
tmp = t * (y / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5500000000.0: tmp = ((x - t) / z) * y elif y <= 2.1e-40: tmp = x + (t - x) else: tmp = t * (y / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5500000000.0) tmp = Float64(Float64(Float64(x - t) / z) * y); elseif (y <= 2.1e-40) tmp = Float64(x + Float64(t - x)); else tmp = Float64(t * Float64(y / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5500000000.0) tmp = ((x - t) / z) * y; elseif (y <= 2.1e-40) tmp = x + (t - x); else tmp = t * (y / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5500000000.0], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 2.1e-40], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5500000000:\\
\;\;\;\;\frac{x - t}{z} \cdot y\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-40}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if y < -5.5e9Initial program 68.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
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites60.8%
Taylor expanded in y around inf
Applied rewrites46.6%
if -5.5e9 < y < 2.10000000000000018e-40Initial program 63.0%
Taylor expanded in z around inf
lower--.f6432.9
Applied rewrites32.9%
if 2.10000000000000018e-40 < y Initial program 67.2%
Taylor expanded in y 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%
Taylor expanded in x around 0
Applied rewrites43.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -5.6e+99) (/ (* (- t x) y) a) (if (<= y 2.1e-40) (+ x (- t x)) (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.6e+99) {
tmp = ((t - x) * y) / a;
} else if (y <= 2.1e-40) {
tmp = x + (t - x);
} else {
tmp = t * (y / (a - z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-5.6d+99)) then
tmp = ((t - x) * y) / a
else if (y <= 2.1d-40) then
tmp = x + (t - x)
else
tmp = t * (y / (a - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.6e+99) {
tmp = ((t - x) * y) / a;
} else if (y <= 2.1e-40) {
tmp = x + (t - x);
} else {
tmp = t * (y / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5.6e+99: tmp = ((t - x) * y) / a elif y <= 2.1e-40: tmp = x + (t - x) else: tmp = t * (y / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5.6e+99) tmp = Float64(Float64(Float64(t - x) * y) / a); elseif (y <= 2.1e-40) tmp = Float64(x + Float64(t - x)); else tmp = Float64(t * Float64(y / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5.6e+99) tmp = ((t - x) * y) / a; elseif (y <= 2.1e-40) tmp = x + (t - x); else tmp = t * (y / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5.6e+99], N[(N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[y, 2.1e-40], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{+99}:\\
\;\;\;\;\frac{\left(t - x\right) \cdot y}{a}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-40}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if y < -5.6e99Initial program 67.8%
Taylor expanded in y 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--.f6479.7
Applied rewrites79.7%
Taylor expanded in x around inf
Applied rewrites56.2%
Taylor expanded in z around 0
Applied rewrites42.4%
if -5.6e99 < y < 2.10000000000000018e-40Initial program 64.0%
Taylor expanded in z around inf
lower--.f6431.9
Applied rewrites31.9%
if 2.10000000000000018e-40 < y Initial program 67.2%
Taylor expanded in y 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%
Taylor expanded in x around 0
Applied rewrites43.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -9.2e+178) (* (- x) (/ y a)) (if (<= y 2.1e-40) (+ x (- t x)) (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -9.2e+178) {
tmp = -x * (y / a);
} else if (y <= 2.1e-40) {
tmp = x + (t - x);
} else {
tmp = t * (y / (a - z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-9.2d+178)) then
tmp = -x * (y / a)
else if (y <= 2.1d-40) then
tmp = x + (t - x)
else
tmp = t * (y / (a - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -9.2e+178) {
tmp = -x * (y / a);
} else if (y <= 2.1e-40) {
tmp = x + (t - x);
} else {
tmp = t * (y / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -9.2e+178: tmp = -x * (y / a) elif y <= 2.1e-40: tmp = x + (t - x) else: tmp = t * (y / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -9.2e+178) tmp = Float64(Float64(-x) * Float64(y / a)); elseif (y <= 2.1e-40) tmp = Float64(x + Float64(t - x)); else tmp = Float64(t * Float64(y / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -9.2e+178) tmp = -x * (y / a); elseif (y <= 2.1e-40) tmp = x + (t - x); else tmp = t * (y / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -9.2e+178], N[((-x) * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-40], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{+178}:\\
\;\;\;\;\left(-x\right) \cdot \frac{y}{a}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-40}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if y < -9.2000000000000003e178Initial program 67.7%
Taylor expanded in y 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--.f6484.2
Applied rewrites84.2%
Taylor expanded in x around inf
Applied rewrites66.9%
Taylor expanded in z around 0
Applied rewrites44.8%
if -9.2000000000000003e178 < y < 2.10000000000000018e-40Initial program 64.3%
Taylor expanded in z around inf
lower--.f6431.3
Applied rewrites31.3%
if 2.10000000000000018e-40 < y Initial program 67.2%
Taylor expanded in y 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%
Taylor expanded in x around 0
Applied rewrites43.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.1e+114) (not (<= z 1.1e+124))) (+ x (- t x)) (* t (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.1e+114) || !(z <= 1.1e+124)) {
tmp = x + (t - x);
} else {
tmp = t * (y / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2.1d+114)) .or. (.not. (z <= 1.1d+124))) then
tmp = x + (t - x)
else
tmp = t * (y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.1e+114) || !(z <= 1.1e+124)) {
tmp = x + (t - x);
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.1e+114) or not (z <= 1.1e+124): tmp = x + (t - x) else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.1e+114) || !(z <= 1.1e+124)) tmp = Float64(x + Float64(t - x)); else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.1e+114) || ~((z <= 1.1e+124))) tmp = x + (t - x); else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.1e+114], N[Not[LessEqual[z, 1.1e+124]], $MachinePrecision]], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+114} \lor \neg \left(z \leq 1.1 \cdot 10^{+124}\right):\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.1e114 or 1.1e124 < z Initial program 29.9%
Taylor expanded in z around inf
lower--.f6442.4
Applied rewrites42.4%
if -2.1e114 < z < 1.1e124Initial program 82.7%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6443.5
Applied rewrites43.5%
Taylor expanded in y around inf
Applied rewrites32.9%
Taylor expanded in z around 0
Applied rewrites28.5%
Final simplification33.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -9.2e+178) (* (- x) (/ y a)) (if (<= y 2.2e-40) (+ x (- t x)) (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -9.2e+178) {
tmp = -x * (y / a);
} else if (y <= 2.2e-40) {
tmp = x + (t - x);
} else {
tmp = t * (y / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-9.2d+178)) then
tmp = -x * (y / a)
else if (y <= 2.2d-40) then
tmp = x + (t - x)
else
tmp = t * (y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -9.2e+178) {
tmp = -x * (y / a);
} else if (y <= 2.2e-40) {
tmp = x + (t - x);
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -9.2e+178: tmp = -x * (y / a) elif y <= 2.2e-40: tmp = x + (t - x) else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -9.2e+178) tmp = Float64(Float64(-x) * Float64(y / a)); elseif (y <= 2.2e-40) tmp = Float64(x + Float64(t - x)); else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -9.2e+178) tmp = -x * (y / a); elseif (y <= 2.2e-40) tmp = x + (t - x); else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -9.2e+178], N[((-x) * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e-40], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{+178}:\\
\;\;\;\;\left(-x\right) \cdot \frac{y}{a}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-40}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < -9.2000000000000003e178Initial program 67.7%
Taylor expanded in y 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--.f6484.2
Applied rewrites84.2%
Taylor expanded in x around inf
Applied rewrites66.9%
Taylor expanded in z around 0
Applied rewrites44.8%
if -9.2000000000000003e178 < y < 2.20000000000000009e-40Initial program 64.3%
Taylor expanded in z around inf
lower--.f6431.3
Applied rewrites31.3%
if 2.20000000000000009e-40 < y Initial program 67.2%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6446.6
Applied rewrites46.6%
Taylor expanded in y around inf
Applied rewrites43.0%
Taylor expanded in z around 0
Applied rewrites35.8%
(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 65.6%
Taylor expanded in z around inf
lower--.f6420.8
Applied rewrites20.8%
(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 65.6%
Taylor expanded in z around inf
lower--.f6420.8
Applied rewrites20.8%
Taylor expanded in x around inf
Applied rewrites2.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* (/ y z) (- t x)))))
(if (< z -1.2536131056095036e+188)
t_1
(if (< z 4.446702369113811e+64)
(+ x (/ (- y z) (/ (- a z) (- t x))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((y / z) * (t - x));
double tmp;
if (z < -1.2536131056095036e+188) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x + ((y - z) / ((a - z) / (t - 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 - ((y / z) * (t - x))
if (z < (-1.2536131056095036d+188)) then
tmp = t_1
else if (z < 4.446702369113811d+64) then
tmp = x + ((y - z) / ((a - z) / (t - 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 - ((y / z) * (t - x));
double tmp;
if (z < -1.2536131056095036e+188) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x + ((y - z) / ((a - z) / (t - x)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - ((y / z) * (t - x)) tmp = 0 if z < -1.2536131056095036e+188: tmp = t_1 elif z < 4.446702369113811e+64: tmp = x + ((y - z) / ((a - z) / (t - x))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(y / z) * Float64(t - x))) tmp = 0.0 if (z < -1.2536131056095036e+188) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / Float64(t - x)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - ((y / z) * (t - x)); tmp = 0.0; if (z < -1.2536131056095036e+188) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = x + ((y - z) / ((a - z) / (t - x))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(y / z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -1.2536131056095036e+188], t$95$1, If[Less[z, 4.446702369113811e+64], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{y}{z} \cdot \left(t - x\right)\\
\mathbf{if}\;z < -1.2536131056095036 \cdot 10^{+188}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024338
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (if (< z -125361310560950360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- t (* (/ y z) (- t x))) (if (< z 44467023691138110000000000000000000000000000000000000000000000000) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x))))))
(+ x (/ (* (- y z) (- t x)) (- a z))))