
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* (- y x) (- z t)) (- a t))))
(t_2 (- (/ y x) 1.0))
(t_3 (* (fma (/ (- z t) (- a t)) t_2 1.0) x)))
(if (<= t_1 (- INFINITY))
t_3
(if (<= t_1 -2e-267)
t_1
(if (<= t_1 5e-245)
(fma x (/ (* t_2 (- z a)) (- t)) y)
(if (<= t_1 2e+282) t_1 t_3))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) * (z - t)) / (a - t));
double t_2 = (y / x) - 1.0;
double t_3 = fma(((z - t) / (a - t)), t_2, 1.0) * x;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_1 <= -2e-267) {
tmp = t_1;
} else if (t_1 <= 5e-245) {
tmp = fma(x, ((t_2 * (z - a)) / -t), y);
} else if (t_1 <= 2e+282) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) t_2 = Float64(Float64(y / x) - 1.0) t_3 = Float64(fma(Float64(Float64(z - t) / Float64(a - t)), t_2, 1.0) * x) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_3; elseif (t_1 <= -2e-267) tmp = t_1; elseif (t_1 <= 5e-245) tmp = fma(x, Float64(Float64(t_2 * Float64(z - a)) / Float64(-t)), y); elseif (t_1 <= 2e+282) tmp = t_1; else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / x), $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * t$95$2 + 1.0), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$3, If[LessEqual[t$95$1, -2e-267], t$95$1, If[LessEqual[t$95$1, 5e-245], N[(x * N[(N[(t$95$2 * N[(z - a), $MachinePrecision]), $MachinePrecision] / (-t)), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[t$95$1, 2e+282], t$95$1, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
t_2 := \frac{y}{x} - 1\\
t_3 := \mathsf{fma}\left(\frac{z - t}{a - t}, t\_2, 1\right) \cdot x\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-267}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-245}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{t\_2 \cdot \left(z - a\right)}{-t}, y\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+282}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -inf.0 or 2.00000000000000007e282 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 44.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites78.2%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -2e-267 or 4.9999999999999997e-245 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 2.00000000000000007e282Initial program 94.4%
if -2e-267 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 4.9999999999999997e-245Initial program 14.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites14.2%
Taylor expanded in t around inf
Applied rewrites100.0%
Final simplification88.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (+ (- y) x) (/ (- z a) t))))
(if (or (<= t -1.85e+122) (not (<= t 8.8e+69)))
(+ y (fma t_1 (/ a t) t_1))
(+ x (/ (* (- y x) (- z t)) (- a t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (-y + x) * ((z - a) / t);
double tmp;
if ((t <= -1.85e+122) || !(t <= 8.8e+69)) {
tmp = y + fma(t_1, (a / t), t_1);
} else {
tmp = x + (((y - x) * (z - t)) / (a - t));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(-y) + x) * Float64(Float64(z - a) / t)) tmp = 0.0 if ((t <= -1.85e+122) || !(t <= 8.8e+69)) tmp = Float64(y + fma(t_1, Float64(a / t), t_1)); else tmp = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[((-y) + x), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -1.85e+122], N[Not[LessEqual[t, 8.8e+69]], $MachinePrecision]], N[(y + N[(t$95$1 * N[(a / t), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(-y\right) + x\right) \cdot \frac{z - a}{t}\\
\mathbf{if}\;t \leq -1.85 \cdot 10^{+122} \lor \neg \left(t \leq 8.8 \cdot 10^{+69}\right):\\
\;\;\;\;y + \mathsf{fma}\left(t\_1, \frac{a}{t}, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\end{array}
\end{array}
if t < -1.8499999999999998e122 or 8.8000000000000006e69 < t Initial program 34.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites57.6%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6412.3
Applied rewrites12.3%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.2
Applied rewrites83.2%
Taylor expanded in t around inf
associate--l+N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f64N/A
*-lft-identityN/A
Applied rewrites85.6%
if -1.8499999999999998e122 < t < 8.8000000000000006e69Initial program 86.0%
Final simplification85.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.85e+122) (not (<= t 1e+66))) (- y (* (/ (- y x) t) (- z a))) (+ x (/ (* (- y x) (- z t)) (- a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.85e+122) || !(t <= 1e+66)) {
tmp = y - (((y - x) / t) * (z - a));
} else {
tmp = x + (((y - x) * (z - t)) / (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 ((t <= (-1.85d+122)) .or. (.not. (t <= 1d+66))) then
tmp = y - (((y - x) / t) * (z - a))
else
tmp = x + (((y - x) * (z - t)) / (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 ((t <= -1.85e+122) || !(t <= 1e+66)) {
tmp = y - (((y - x) / t) * (z - a));
} else {
tmp = x + (((y - x) * (z - t)) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.85e+122) or not (t <= 1e+66): tmp = y - (((y - x) / t) * (z - a)) else: tmp = x + (((y - x) * (z - t)) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.85e+122) || !(t <= 1e+66)) tmp = Float64(y - Float64(Float64(Float64(y - x) / t) * Float64(z - a))); else tmp = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.85e+122) || ~((t <= 1e+66))) tmp = y - (((y - x) / t) * (z - a)); else tmp = x + (((y - x) * (z - t)) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.85e+122], N[Not[LessEqual[t, 1e+66]], $MachinePrecision]], N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.85 \cdot 10^{+122} \lor \neg \left(t \leq 10^{+66}\right):\\
\;\;\;\;y - \frac{y - x}{t} \cdot \left(z - a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\end{array}
\end{array}
if t < -1.8499999999999998e122 or 9.99999999999999945e65 < t Initial program 34.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites57.6%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6412.3
Applied rewrites12.3%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.2
Applied rewrites83.2%
if -1.8499999999999998e122 < t < 9.99999999999999945e65Initial program 86.0%
Final simplification85.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.12e+14) (not (<= t 2.8e+65))) (- y (* (/ (- y x) t) (- z a))) (fma (- y x) (/ (- z t) a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.12e+14) || !(t <= 2.8e+65)) {
tmp = y - (((y - x) / t) * (z - a));
} else {
tmp = fma((y - x), ((z - t) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.12e+14) || !(t <= 2.8e+65)) tmp = Float64(y - Float64(Float64(Float64(y - x) / t) * Float64(z - a))); else tmp = fma(Float64(y - x), Float64(Float64(z - t) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.12e+14], N[Not[LessEqual[t, 2.8e+65]], $MachinePrecision]], N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.12 \cdot 10^{+14} \lor \neg \left(t \leq 2.8 \cdot 10^{+65}\right):\\
\;\;\;\;y - \frac{y - x}{t} \cdot \left(z - a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a}, x\right)\\
\end{array}
\end{array}
if t < -1.12e14 or 2.7999999999999999e65 < t Initial program 43.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites59.6%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6420.5
Applied rewrites20.5%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6477.1
Applied rewrites77.1%
if -1.12e14 < t < 2.7999999999999999e65Initial program 89.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites88.2%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6479.2
Applied rewrites79.2%
Final simplification78.3%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.12e+14)
(fma (/ (- x y) t) z y)
(if (<= t 4.3e+65)
(fma (- y x) (/ (- z t) a) x)
(- y (* (- x) (/ (- z a) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.12e+14) {
tmp = fma(((x - y) / t), z, y);
} else if (t <= 4.3e+65) {
tmp = fma((y - x), ((z - t) / a), x);
} else {
tmp = y - (-x * ((z - a) / t));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.12e+14) tmp = fma(Float64(Float64(x - y) / t), z, y); elseif (t <= 4.3e+65) tmp = fma(Float64(y - x), Float64(Float64(z - t) / a), x); else tmp = Float64(y - Float64(Float64(-x) * Float64(Float64(z - a) / t))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.12e+14], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * z + y), $MachinePrecision], If[LessEqual[t, 4.3e+65], N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(y - N[((-x) * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.12 \cdot 10^{+14}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, z, y\right)\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{+65}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y - \left(-x\right) \cdot \frac{z - a}{t}\\
\end{array}
\end{array}
if t < -1.12e14Initial program 49.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites59.9%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6426.0
Applied rewrites26.0%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6470.9
Applied rewrites70.9%
Taylor expanded in a around 0
Applied rewrites70.4%
if -1.12e14 < t < 4.30000000000000046e65Initial program 89.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites88.2%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6479.2
Applied rewrites79.2%
if 4.30000000000000046e65 < t Initial program 35.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites59.3%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6413.8
Applied rewrites13.8%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.7
Applied rewrites84.7%
Taylor expanded in x around inf
Applied rewrites82.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.5e-63) (not (<= a 3.4))) (fma (- y x) (/ (- z t) a) x) (fma (/ (- x y) t) z y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.5e-63) || !(a <= 3.4)) {
tmp = fma((y - x), ((z - t) / a), x);
} else {
tmp = fma(((x - y) / t), z, y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.5e-63) || !(a <= 3.4)) tmp = fma(Float64(y - x), Float64(Float64(z - t) / a), x); else tmp = fma(Float64(Float64(x - y) / t), z, y); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.5e-63], N[Not[LessEqual[a, 3.4]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * z + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{-63} \lor \neg \left(a \leq 3.4\right):\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, z, y\right)\\
\end{array}
\end{array}
if a < -4.5e-63 or 3.39999999999999991 < a Initial program 73.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites84.7%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6475.2
Applied rewrites75.2%
if -4.5e-63 < a < 3.39999999999999991Initial program 62.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.9%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6425.7
Applied rewrites25.7%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.2
Applied rewrites80.2%
Taylor expanded in a around 0
Applied rewrites77.4%
Final simplification76.2%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.3e+33)
y
(if (<= t 1.28e-288)
(fma (- x) (/ z a) x)
(if (<= t 3.1e+86) (fma (/ y a) z x) y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.3e+33) {
tmp = y;
} else if (t <= 1.28e-288) {
tmp = fma(-x, (z / a), x);
} else if (t <= 3.1e+86) {
tmp = fma((y / a), z, x);
} else {
tmp = y;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.3e+33) tmp = y; elseif (t <= 1.28e-288) tmp = fma(Float64(-x), Float64(z / a), x); elseif (t <= 3.1e+86) tmp = fma(Float64(y / a), z, x); else tmp = y; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.3e+33], y, If[LessEqual[t, 1.28e-288], N[((-x) * N[(z / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 3.1e+86], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], y]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{+33}:\\
\;\;\;\;y\\
\mathbf{elif}\;t \leq 1.28 \cdot 10^{-288}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{z}{a}, x\right)\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+86}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if t < -2.30000000000000011e33 or 3.1000000000000002e86 < t Initial program 39.7%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
distribute-neg-inN/A
mul-1-negN/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f6449.3
Applied rewrites49.3%
Taylor expanded in z around 0
Applied rewrites33.6%
Taylor expanded in z around 0
Applied rewrites33.6%
Applied rewrites48.7%
if -2.30000000000000011e33 < t < 1.2800000000000001e-288Initial program 92.3%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6476.2
Applied rewrites76.2%
Taylor expanded in y around 0
Applied rewrites62.0%
if 1.2800000000000001e-288 < t < 3.1000000000000002e86Initial program 84.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6462.6
Applied rewrites62.6%
Taylor expanded in x around 0
Applied rewrites53.7%
Final simplification54.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.5e-63) (fma (- y x) (/ (- z t) a) x) (if (<= a 3.4) (fma (/ (- x y) t) z y) (fma (- z t) (/ (- y x) a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.5e-63) {
tmp = fma((y - x), ((z - t) / a), x);
} else if (a <= 3.4) {
tmp = fma(((x - y) / t), z, y);
} else {
tmp = fma((z - t), ((y - x) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.5e-63) tmp = fma(Float64(y - x), Float64(Float64(z - t) / a), x); elseif (a <= 3.4) tmp = fma(Float64(Float64(x - y) / t), z, y); else tmp = fma(Float64(z - t), Float64(Float64(y - x) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.5e-63], N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 3.4], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * z + y), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{-63}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a}, x\right)\\
\mathbf{elif}\;a \leq 3.4:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, z, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y - x}{a}, x\right)\\
\end{array}
\end{array}
if a < -4.5e-63Initial program 74.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites85.4%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6478.1
Applied rewrites78.1%
if -4.5e-63 < a < 3.39999999999999991Initial program 62.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.9%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6425.7
Applied rewrites25.7%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.2
Applied rewrites80.2%
Taylor expanded in a around 0
Applied rewrites77.4%
if 3.39999999999999991 < a Initial program 72.0%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6472.8
Applied rewrites72.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z a))))
(if (<= z -1.15e+42)
t_1
(if (<= z -1.35e-60) y (if (<= z 3.6e+187) (- x (- y)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / a);
double tmp;
if (z <= -1.15e+42) {
tmp = t_1;
} else if (z <= -1.35e-60) {
tmp = y;
} else if (z <= 3.6e+187) {
tmp = x - -y;
} 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 = y * (z / a)
if (z <= (-1.15d+42)) then
tmp = t_1
else if (z <= (-1.35d-60)) then
tmp = y
else if (z <= 3.6d+187) then
tmp = x - -y
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 = y * (z / a);
double tmp;
if (z <= -1.15e+42) {
tmp = t_1;
} else if (z <= -1.35e-60) {
tmp = y;
} else if (z <= 3.6e+187) {
tmp = x - -y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / a) tmp = 0 if z <= -1.15e+42: tmp = t_1 elif z <= -1.35e-60: tmp = y elif z <= 3.6e+187: tmp = x - -y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / a)) tmp = 0.0 if (z <= -1.15e+42) tmp = t_1; elseif (z <= -1.35e-60) tmp = y; elseif (z <= 3.6e+187) tmp = Float64(x - Float64(-y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / a); tmp = 0.0; if (z <= -1.15e+42) tmp = t_1; elseif (z <= -1.35e-60) tmp = y; elseif (z <= 3.6e+187) tmp = x - -y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e+42], t$95$1, If[LessEqual[z, -1.35e-60], y, If[LessEqual[z, 3.6e+187], N[(x - (-y)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{a}\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-60}:\\
\;\;\;\;y\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+187}:\\
\;\;\;\;x - \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.15e42 or 3.60000000000000036e187 < z Initial program 73.3%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6462.3
Applied rewrites62.3%
Taylor expanded in y around 0
Applied rewrites41.1%
Taylor expanded in z around inf
Applied rewrites33.7%
Taylor expanded in x around 0
Applied rewrites35.8%
if -1.15e42 < z < -1.35e-60Initial program 51.4%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
distribute-neg-inN/A
mul-1-negN/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f6454.4
Applied rewrites54.4%
Taylor expanded in z around 0
Applied rewrites39.4%
Taylor expanded in z around 0
Applied rewrites39.4%
Applied rewrites60.4%
if -1.35e-60 < z < 3.60000000000000036e187Initial program 67.7%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
distribute-neg-inN/A
mul-1-negN/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f6433.5
Applied rewrites33.5%
Taylor expanded in z around 0
Applied rewrites23.0%
Taylor expanded in z around 0
Applied rewrites23.0%
Taylor expanded in x around 0
Applied rewrites41.4%
Final simplification41.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.12e+14) (not (<= t 2.8e+65))) (fma (/ (- x y) t) z y) (fma (/ z a) (- y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.12e+14) || !(t <= 2.8e+65)) {
tmp = fma(((x - y) / t), z, y);
} else {
tmp = fma((z / a), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.12e+14) || !(t <= 2.8e+65)) tmp = fma(Float64(Float64(x - y) / t), z, y); else tmp = fma(Float64(z / a), Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.12e+14], N[Not[LessEqual[t, 2.8e+65]], $MachinePrecision]], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * z + y), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.12 \cdot 10^{+14} \lor \neg \left(t \leq 2.8 \cdot 10^{+65}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, z, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\end{array}
\end{array}
if t < -1.12e14 or 2.7999999999999999e65 < t Initial program 43.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites59.6%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6420.5
Applied rewrites20.5%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6477.1
Applied rewrites77.1%
Taylor expanded in a around 0
Applied rewrites72.3%
if -1.12e14 < t < 2.7999999999999999e65Initial program 89.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6473.6
Applied rewrites73.6%
Applied rewrites74.4%
Final simplification73.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.1e-27) (not (<= a 4.7e+129))) (fma (/ y a) z x) (fma (/ (- x y) t) z y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.1e-27) || !(a <= 4.7e+129)) {
tmp = fma((y / a), z, x);
} else {
tmp = fma(((x - y) / t), z, y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.1e-27) || !(a <= 4.7e+129)) tmp = fma(Float64(y / a), z, x); else tmp = fma(Float64(Float64(x - y) / t), z, y); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.1e-27], N[Not[LessEqual[a, 4.7e+129]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * z + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.1 \cdot 10^{-27} \lor \neg \left(a \leq 4.7 \cdot 10^{+129}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, z, y\right)\\
\end{array}
\end{array}
if a < -2.10000000000000015e-27 or 4.70000000000000008e129 < a Initial program 75.4%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6472.4
Applied rewrites72.4%
Taylor expanded in x around 0
Applied rewrites61.2%
if -2.10000000000000015e-27 < a < 4.70000000000000008e129Initial program 63.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites66.8%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6431.8
Applied rewrites31.8%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6474.5
Applied rewrites74.5%
Taylor expanded in a around 0
Applied rewrites71.8%
Final simplification67.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.3e-30) (not (<= a 4.7e+129))) (fma (/ y a) z x) (* (- 1.0 (/ z t)) y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.3e-30) || !(a <= 4.7e+129)) {
tmp = fma((y / a), z, x);
} else {
tmp = (1.0 - (z / t)) * y;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.3e-30) || !(a <= 4.7e+129)) tmp = fma(Float64(y / a), z, x); else tmp = Float64(Float64(1.0 - Float64(z / t)) * y); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.3e-30], N[Not[LessEqual[a, 4.7e+129]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], N[(N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{-30} \lor \neg \left(a \leq 4.7 \cdot 10^{+129}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{z}{t}\right) \cdot y\\
\end{array}
\end{array}
if a < -2.29999999999999984e-30 or 4.70000000000000008e129 < a Initial program 75.4%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6472.4
Applied rewrites72.4%
Taylor expanded in x around 0
Applied rewrites61.2%
if -2.29999999999999984e-30 < a < 4.70000000000000008e129Initial program 63.1%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
distribute-neg-inN/A
mul-1-negN/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f6454.8
Applied rewrites54.8%
Taylor expanded in z around 0
Applied rewrites24.0%
Taylor expanded in x around 0
Applied rewrites54.6%
Final simplification57.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.35e+122) (not (<= t 3.1e+86))) y (fma (/ y a) z x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.35e+122) || !(t <= 3.1e+86)) {
tmp = y;
} else {
tmp = fma((y / a), z, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.35e+122) || !(t <= 3.1e+86)) tmp = y; else tmp = fma(Float64(y / a), z, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.35e+122], N[Not[LessEqual[t, 3.1e+86]], $MachinePrecision]], y, N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.35 \cdot 10^{+122} \lor \neg \left(t \leq 3.1 \cdot 10^{+86}\right):\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\end{array}
\end{array}
if t < -2.35000000000000012e122 or 3.1000000000000002e86 < t Initial program 34.5%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
distribute-neg-inN/A
mul-1-negN/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f6449.4
Applied rewrites49.4%
Taylor expanded in z around 0
Applied rewrites35.4%
Taylor expanded in z around 0
Applied rewrites35.4%
Applied rewrites53.1%
if -2.35000000000000012e122 < t < 3.1000000000000002e86Initial program 84.7%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6465.8
Applied rewrites65.8%
Taylor expanded in x around 0
Applied rewrites51.6%
Final simplification52.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.52e-30) (not (<= a 8.5e-48))) (- x (- y)) y))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.52e-30) || !(a <= 8.5e-48)) {
tmp = x - -y;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.52d-30)) .or. (.not. (a <= 8.5d-48))) then
tmp = x - -y
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.52e-30) || !(a <= 8.5e-48)) {
tmp = x - -y;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.52e-30) or not (a <= 8.5e-48): tmp = x - -y else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.52e-30) || !(a <= 8.5e-48)) tmp = Float64(x - Float64(-y)); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.52e-30) || ~((a <= 8.5e-48))) tmp = x - -y; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.52e-30], N[Not[LessEqual[a, 8.5e-48]], $MachinePrecision]], N[(x - (-y)), $MachinePrecision], y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.52 \cdot 10^{-30} \lor \neg \left(a \leq 8.5 \cdot 10^{-48}\right):\\
\;\;\;\;x - \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if a < -1.52e-30 or 8.5000000000000004e-48 < a Initial program 72.8%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
distribute-neg-inN/A
mul-1-negN/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f6424.3
Applied rewrites24.3%
Taylor expanded in z around 0
Applied rewrites15.5%
Taylor expanded in z around 0
Applied rewrites15.5%
Taylor expanded in x around 0
Applied rewrites40.1%
if -1.52e-30 < a < 8.5000000000000004e-48Initial program 62.5%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
distribute-neg-inN/A
mul-1-negN/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f6455.7
Applied rewrites55.7%
Taylor expanded in z around 0
Applied rewrites22.0%
Taylor expanded in z around 0
Applied rewrites22.0%
Applied rewrites34.8%
Final simplification37.8%
(FPCore (x y z t a) :precision binary64 y)
double code(double x, double y, double z, double t, double a) {
return y;
}
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 = y
end function
public static double code(double x, double y, double z, double t, double a) {
return y;
}
def code(x, y, z, t, a): return y
function code(x, y, z, t, a) return y end
function tmp = code(x, y, z, t, a) tmp = y; end
code[x_, y_, z_, t_, a_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 68.2%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
distribute-neg-inN/A
mul-1-negN/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-lft-identityN/A
lower-fma.f6438.3
Applied rewrites38.3%
Taylor expanded in z around 0
Applied rewrites18.4%
Taylor expanded in z around 0
Applied rewrites18.4%
Applied rewrites25.1%
Final simplification25.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t))))))
(if (< a -1.6153062845442575e-142)
t_1
(if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
double tmp;
if (a < -1.6153062845442575e-142) {
tmp = t_1;
} else if (a < 3.774403170083174e-182) {
tmp = y - ((z / t) * (y - 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 = x + (((y - x) / 1.0d0) * ((z - t) / (a - t)))
if (a < (-1.6153062845442575d-142)) then
tmp = t_1
else if (a < 3.774403170083174d-182) then
tmp = y - ((z / t) * (y - 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 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
double tmp;
if (a < -1.6153062845442575e-142) {
tmp = t_1;
} else if (a < 3.774403170083174e-182) {
tmp = y - ((z / t) * (y - x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t))) tmp = 0 if a < -1.6153062845442575e-142: tmp = t_1 elif a < 3.774403170083174e-182: tmp = y - ((z / t) * (y - x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - x) / 1.0) * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (a < -1.6153062845442575e-142) tmp = t_1; elseif (a < 3.774403170083174e-182) tmp = Float64(y - Float64(Float64(z / t) * Float64(y - x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t))); tmp = 0.0; if (a < -1.6153062845442575e-142) tmp = t_1; elseif (a < 3.774403170083174e-182) tmp = y - ((z / t) * (y - x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] / 1.0), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[a, -1.6153062845442575e-142], t$95$1, If[Less[a, 3.774403170083174e-182], N[(y - N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;a < -1.6153062845442575 \cdot 10^{-142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a < 3.774403170083174 \cdot 10^{-182}:\\
\;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024338
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (if (< a -646122513817703/4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 1887201585041587/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))))))
(+ x (/ (* (- y x) (- z t)) (- a t))))