
(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 19 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 (fma (/ (- t z) (- t a)) (- y x) x))
(t_2 (- x (/ (* (- t z) (- y x)) (- a t)))))
(if (<= t_2 -5e-297)
t_1
(if (<= t_2 0.0)
(- y (/ (* (- x) (fma a (/ (- z a) t) (- z a))) t))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - z) / (t - a)), (y - x), x);
double t_2 = x - (((t - z) * (y - x)) / (a - t));
double tmp;
if (t_2 <= -5e-297) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = y - ((-x * fma(a, ((z - a) / t), (z - a))) / t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - z) / Float64(t - a)), Float64(y - x), x) t_2 = Float64(x - Float64(Float64(Float64(t - z) * Float64(y - x)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -5e-297) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(y - Float64(Float64(Float64(-x) * fma(a, Float64(Float64(z - a) / t), Float64(z - a))) / t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(N[(t - z), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-297], t$95$1, If[LessEqual[t$95$2, 0.0], N[(y - N[(N[((-x) * N[(a * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - z}{t - a}, y - x, x\right)\\
t_2 := x - \frac{\left(t - z\right) \cdot \left(y - x\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-297}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;y - \frac{\left(-x\right) \cdot \mathsf{fma}\left(a, \frac{z - a}{t}, z - a\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -5e-297 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 74.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6489.6
Applied rewrites89.6%
if -5e-297 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 3.9%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites99.8%
Final simplification90.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y) -1.0 x)) (t_2 (- x (/ (* (- t z) (- y x)) (- a t)))))
(if (<= t_2 -4e-47)
t_1
(if (<= t_2 4e-57) y (if (<= t_2 1e+301) t_1 (fma (/ y t) a y))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-y, -1.0, x);
double t_2 = x - (((t - z) * (y - x)) / (a - t));
double tmp;
if (t_2 <= -4e-47) {
tmp = t_1;
} else if (t_2 <= 4e-57) {
tmp = y;
} else if (t_2 <= 1e+301) {
tmp = t_1;
} else {
tmp = fma((y / t), a, y);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-y), -1.0, x) t_2 = Float64(x - Float64(Float64(Float64(t - z) * Float64(y - x)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -4e-47) tmp = t_1; elseif (t_2 <= 4e-57) tmp = y; elseif (t_2 <= 1e+301) tmp = t_1; else tmp = fma(Float64(y / t), a, y); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-y) * -1.0 + x), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(N[(t - z), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-47], t$95$1, If[LessEqual[t$95$2, 4e-57], y, If[LessEqual[t$95$2, 1e+301], t$95$1, N[(N[(y / t), $MachinePrecision] * a + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, -1, x\right)\\
t_2 := x - \frac{\left(t - z\right) \cdot \left(y - x\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-57}:\\
\;\;\;\;y\\
\mathbf{elif}\;t\_2 \leq 10^{+301}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t}, a, y\right)\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -3.9999999999999999e-47 or 3.99999999999999982e-57 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 1.00000000000000005e301Initial program 83.3%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6449.4
Applied rewrites49.4%
Taylor expanded in y around inf
Applied rewrites49.1%
Taylor expanded in a around 0
Applied rewrites39.5%
if -3.9999999999999999e-47 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 3.99999999999999982e-57Initial program 63.1%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6436.8
Applied rewrites36.8%
Taylor expanded in a around 0
Applied rewrites32.1%
if 1.00000000000000005e301 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 39.8%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6424.3
Applied rewrites24.3%
Taylor expanded in a around 0
Applied rewrites47.8%
Taylor expanded in y around inf
Applied rewrites33.4%
Final simplification36.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t z) (- t a)) (- y x) x))
(t_2 (- x (/ (* (- t z) (- y x)) (- a t)))))
(if (<= t_2 -5e-297)
t_1
(if (<= t_2 0.0) (fma (- x y) (/ (- z a) t) y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - z) / (t - a)), (y - x), x);
double t_2 = x - (((t - z) * (y - x)) / (a - t));
double tmp;
if (t_2 <= -5e-297) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = fma((x - y), ((z - a) / t), y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - z) / Float64(t - a)), Float64(y - x), x) t_2 = Float64(x - Float64(Float64(Float64(t - z) * Float64(y - x)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -5e-297) tmp = t_1; elseif (t_2 <= 0.0) tmp = fma(Float64(x - y), Float64(Float64(z - a) / t), y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(N[(t - z), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-297], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(x - y), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - z}{t - a}, y - x, x\right)\\
t_2 := x - \frac{\left(t - z\right) \cdot \left(y - x\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-297}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -5e-297 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 74.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6489.6
Applied rewrites89.6%
if -5e-297 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 3.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f643.9
Applied rewrites3.9%
Taylor expanded in t around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
div-subN/A
distribute-lft-out--N/A
distribute-rgt-out--N/A
associate-*r/N/A
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites99.8%
Final simplification90.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -6.4e+48)
(fma (/ (- x y) t) (- z a) y)
(if (<= t 1.1e+62)
(- x (/ (* z (- y x)) (- t a)))
(fma (- x y) (/ (- z a) t) y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.4e+48) {
tmp = fma(((x - y) / t), (z - a), y);
} else if (t <= 1.1e+62) {
tmp = x - ((z * (y - x)) / (t - a));
} else {
tmp = fma((x - y), ((z - a) / t), y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.4e+48) tmp = fma(Float64(Float64(x - y) / t), Float64(z - a), y); elseif (t <= 1.1e+62) tmp = Float64(x - Float64(Float64(z * Float64(y - x)) / Float64(t - a))); else tmp = fma(Float64(x - y), Float64(Float64(z - a) / t), y); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.4e+48], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[t, 1.1e+62], N[(x - N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.4 \cdot 10^{+48}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, z - a, y\right)\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+62}:\\
\;\;\;\;x - \frac{z \cdot \left(y - x\right)}{t - a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\
\end{array}
\end{array}
if t < -6.4000000000000003e48Initial program 29.2%
Taylor expanded in t 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 rewrites87.5%
if -6.4000000000000003e48 < t < 1.10000000000000007e62Initial program 90.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower--.f6479.7
Applied rewrites79.7%
if 1.10000000000000007e62 < t Initial program 40.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6465.9
Applied rewrites65.9%
Taylor expanded in t around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
div-subN/A
distribute-lft-out--N/A
distribute-rgt-out--N/A
associate-*r/N/A
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites79.6%
Final simplification81.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -6e+48)
(fma (/ (- x y) t) (- z a) y)
(if (<= t 1.04e+62)
(fma (/ (- z t) a) (- y x) x)
(fma (- x y) (/ (- z a) t) y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6e+48) {
tmp = fma(((x - y) / t), (z - a), y);
} else if (t <= 1.04e+62) {
tmp = fma(((z - t) / a), (y - x), x);
} else {
tmp = fma((x - y), ((z - a) / t), y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6e+48) tmp = fma(Float64(Float64(x - y) / t), Float64(z - a), y); elseif (t <= 1.04e+62) tmp = fma(Float64(Float64(z - t) / a), Float64(y - x), x); else tmp = fma(Float64(x - y), Float64(Float64(z - a) / t), y); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6e+48], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[t, 1.04e+62], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{+48}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, z - a, y\right)\\
\mathbf{elif}\;t \leq 1.04 \cdot 10^{+62}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\
\end{array}
\end{array}
if t < -5.9999999999999999e48Initial program 29.2%
Taylor expanded in t 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 rewrites87.5%
if -5.9999999999999999e48 < t < 1.03999999999999989e62Initial program 90.8%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6479.2
Applied rewrites79.2%
if 1.03999999999999989e62 < t Initial program 40.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6465.9
Applied rewrites65.9%
Taylor expanded in t around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
div-subN/A
distribute-lft-out--N/A
distribute-rgt-out--N/A
associate-*r/N/A
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites79.6%
Final simplification80.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- x y) t) (- z a) y)))
(if (<= t -6e+48)
t_1
(if (<= t 1.04e+62) (fma (/ (- z t) a) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((x - y) / t), (z - a), y);
double tmp;
if (t <= -6e+48) {
tmp = t_1;
} else if (t <= 1.04e+62) {
tmp = fma(((z - t) / a), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(x - y) / t), Float64(z - a), y) tmp = 0.0 if (t <= -6e+48) tmp = t_1; elseif (t <= 1.04e+62) tmp = fma(Float64(Float64(z - t) / a), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -6e+48], t$95$1, If[LessEqual[t, 1.04e+62], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x - y}{t}, z - a, y\right)\\
\mathbf{if}\;t \leq -6 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.04 \cdot 10^{+62}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.9999999999999999e48 or 1.03999999999999989e62 < t Initial program 35.3%
Taylor expanded in t 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 rewrites83.1%
if -5.9999999999999999e48 < t < 1.03999999999999989e62Initial program 90.8%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6479.2
Applied rewrites79.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ (- x y) t) (- z a) y))) (if (<= t -6.9e+47) t_1 (if (<= t 1.04e+62) (fma (/ z a) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((x - y) / t), (z - a), y);
double tmp;
if (t <= -6.9e+47) {
tmp = t_1;
} else if (t <= 1.04e+62) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(x - y) / t), Float64(z - a), y) tmp = 0.0 if (t <= -6.9e+47) tmp = t_1; elseif (t <= 1.04e+62) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -6.9e+47], t$95$1, If[LessEqual[t, 1.04e+62], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x - y}{t}, z - a, y\right)\\
\mathbf{if}\;t \leq -6.9 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.04 \cdot 10^{+62}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.9000000000000004e47 or 1.03999999999999989e62 < t Initial program 35.3%
Taylor expanded in t 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 rewrites83.1%
if -6.9000000000000004e47 < t < 1.03999999999999989e62Initial program 90.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.4
Applied rewrites93.4%
Taylor expanded in t around 0
lower-/.f6474.1
Applied rewrites74.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.05e+41) (- y (* (/ (- y x) t) z)) (if (<= t 3.7e+66) (fma (/ z a) (- y x) x) (- y (* (/ z t) (- y x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.05e+41) {
tmp = y - (((y - x) / t) * z);
} else if (t <= 3.7e+66) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = y - ((z / t) * (y - x));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.05e+41) tmp = Float64(y - Float64(Float64(Float64(y - x) / t) * z)); elseif (t <= 3.7e+66) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = Float64(y - Float64(Float64(z / t) * Float64(y - x))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.05e+41], N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e+66], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(y - N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+41}:\\
\;\;\;\;y - \frac{y - x}{t} \cdot z\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{+66}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\
\end{array}
\end{array}
if t < -1.05e41Initial program 32.1%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites59.6%
Taylor expanded in a around 0
Applied rewrites72.3%
if -1.05e41 < t < 3.7e66Initial program 90.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.3
Applied rewrites93.3%
Taylor expanded in t around 0
lower-/.f6474.4
Applied rewrites74.4%
if 3.7e66 < t Initial program 40.7%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites64.4%
Taylor expanded in a around 0
Applied rewrites70.2%
Applied rewrites71.9%
Final simplification73.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- y (* (/ z t) (- y x))))) (if (<= t -1.05e+41) t_1 (if (<= t 3.7e+66) (fma (/ z a) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y - ((z / t) * (y - x));
double tmp;
if (t <= -1.05e+41) {
tmp = t_1;
} else if (t <= 3.7e+66) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y - Float64(Float64(z / t) * Float64(y - x))) tmp = 0.0 if (t <= -1.05e+41) tmp = t_1; elseif (t <= 3.7e+66) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y - N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.05e+41], t$95$1, If[LessEqual[t, 3.7e+66], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - \frac{z}{t} \cdot \left(y - x\right)\\
\mathbf{if}\;t \leq -1.05 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{+66}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.05e41 or 3.7e66 < t Initial program 36.6%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites62.1%
Taylor expanded in a around 0
Applied rewrites71.2%
Applied rewrites71.2%
if -1.05e41 < t < 3.7e66Initial program 90.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.3
Applied rewrites93.3%
Taylor expanded in t around 0
lower-/.f6474.4
Applied rewrites74.4%
Final simplification73.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -7e+48) (- y (* (/ z t) y)) (if (<= t 4.2e+66) (fma (/ z a) (- y x) x) (- y (* (/ (- z) t) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7e+48) {
tmp = y - ((z / t) * y);
} else if (t <= 4.2e+66) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = y - ((-z / t) * x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7e+48) tmp = Float64(y - Float64(Float64(z / t) * y)); elseif (t <= 4.2e+66) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = Float64(y - Float64(Float64(Float64(-z) / t) * x)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7e+48], N[(y - N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e+66], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(y - N[(N[((-z) / t), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+48}:\\
\;\;\;\;y - \frac{z}{t} \cdot y\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+66}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;y - \frac{-z}{t} \cdot x\\
\end{array}
\end{array}
if t < -6.9999999999999995e48Initial program 29.2%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites60.0%
Taylor expanded in a around 0
Applied rewrites73.1%
Taylor expanded in y around inf
Applied rewrites57.8%
if -6.9999999999999995e48 < t < 4.20000000000000011e66Initial program 90.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.4
Applied rewrites93.4%
Taylor expanded in t around 0
lower-/.f6474.1
Applied rewrites74.1%
if 4.20000000000000011e66 < t Initial program 40.7%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites64.4%
Taylor expanded in a around 0
Applied rewrites70.2%
Taylor expanded in y around 0
Applied rewrites68.3%
Final simplification70.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -7e+48) (- y (* (/ z t) y)) (if (<= t 1.35e+90) (fma (/ z a) (- y x) x) (fma (/ (- y x) t) a y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7e+48) {
tmp = y - ((z / t) * y);
} else if (t <= 1.35e+90) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = fma(((y - x) / t), a, y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7e+48) tmp = Float64(y - Float64(Float64(z / t) * y)); elseif (t <= 1.35e+90) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = fma(Float64(Float64(y - x) / t), a, y); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7e+48], N[(y - N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+90], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * a + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+48}:\\
\;\;\;\;y - \frac{z}{t} \cdot y\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+90}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{t}, a, y\right)\\
\end{array}
\end{array}
if t < -6.9999999999999995e48Initial program 29.2%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites60.0%
Taylor expanded in a around 0
Applied rewrites73.1%
Taylor expanded in y around inf
Applied rewrites57.8%
if -6.9999999999999995e48 < t < 1.35e90Initial program 90.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.0
Applied rewrites93.0%
Taylor expanded in t around 0
lower-/.f6472.9
Applied rewrites72.9%
if 1.35e90 < t Initial program 36.6%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6445.3
Applied rewrites45.3%
Taylor expanded in a around 0
Applied rewrites55.1%
Final simplification66.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -7e+48) (- y (* (/ z t) y)) (if (<= t 1.35e+90) (fma (/ (- y x) a) z x) (fma (/ (- y x) t) a y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7e+48) {
tmp = y - ((z / t) * y);
} else if (t <= 1.35e+90) {
tmp = fma(((y - x) / a), z, x);
} else {
tmp = fma(((y - x) / t), a, y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7e+48) tmp = Float64(y - Float64(Float64(z / t) * y)); elseif (t <= 1.35e+90) tmp = fma(Float64(Float64(y - x) / a), z, x); else tmp = fma(Float64(Float64(y - x) / t), a, y); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7e+48], N[(y - N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+90], N[(N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * a + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+48}:\\
\;\;\;\;y - \frac{z}{t} \cdot y\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+90}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{t}, a, y\right)\\
\end{array}
\end{array}
if t < -6.9999999999999995e48Initial program 29.2%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites60.0%
Taylor expanded in a around 0
Applied rewrites73.1%
Taylor expanded in y around inf
Applied rewrites57.8%
if -6.9999999999999995e48 < t < 1.35e90Initial program 90.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6469.5
Applied rewrites69.5%
if 1.35e90 < t Initial program 36.6%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6445.3
Applied rewrites45.3%
Taylor expanded in a around 0
Applied rewrites55.1%
Final simplification64.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.36e+48) (- y (* (/ z t) y)) (if (<= t 1.35e+90) (fma (/ z a) (- x) x) (fma (/ (- y x) t) a y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.36e+48) {
tmp = y - ((z / t) * y);
} else if (t <= 1.35e+90) {
tmp = fma((z / a), -x, x);
} else {
tmp = fma(((y - x) / t), a, y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.36e+48) tmp = Float64(y - Float64(Float64(z / t) * y)); elseif (t <= 1.35e+90) tmp = fma(Float64(z / a), Float64(-x), x); else tmp = fma(Float64(Float64(y - x) / t), a, y); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.36e+48], N[(y - N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+90], N[(N[(z / a), $MachinePrecision] * (-x) + x), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * a + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.36 \cdot 10^{+48}:\\
\;\;\;\;y - \frac{z}{t} \cdot y\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+90}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, -x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{t}, a, y\right)\\
\end{array}
\end{array}
if t < -1.3599999999999999e48Initial program 29.2%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites60.0%
Taylor expanded in a around 0
Applied rewrites73.1%
Taylor expanded in y around inf
Applied rewrites57.8%
if -1.3599999999999999e48 < t < 1.35e90Initial program 90.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.0
Applied rewrites93.0%
Taylor expanded in t around 0
lower-/.f6472.9
Applied rewrites72.9%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6449.0
Applied rewrites49.0%
if 1.35e90 < t Initial program 36.6%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6445.3
Applied rewrites45.3%
Taylor expanded in a around 0
Applied rewrites55.1%
Final simplification51.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.36e+48) (- y (* (/ z t) y)) (if (<= t 1.35e+90) (fma (/ z a) (- x) x) (fma (/ (- x) t) a y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.36e+48) {
tmp = y - ((z / t) * y);
} else if (t <= 1.35e+90) {
tmp = fma((z / a), -x, x);
} else {
tmp = fma((-x / t), a, y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.36e+48) tmp = Float64(y - Float64(Float64(z / t) * y)); elseif (t <= 1.35e+90) tmp = fma(Float64(z / a), Float64(-x), x); else tmp = fma(Float64(Float64(-x) / t), a, y); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.36e+48], N[(y - N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+90], N[(N[(z / a), $MachinePrecision] * (-x) + x), $MachinePrecision], N[(N[((-x) / t), $MachinePrecision] * a + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.36 \cdot 10^{+48}:\\
\;\;\;\;y - \frac{z}{t} \cdot y\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+90}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, -x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-x}{t}, a, y\right)\\
\end{array}
\end{array}
if t < -1.3599999999999999e48Initial program 29.2%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites60.0%
Taylor expanded in a around 0
Applied rewrites73.1%
Taylor expanded in y around inf
Applied rewrites57.8%
if -1.3599999999999999e48 < t < 1.35e90Initial program 90.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.0
Applied rewrites93.0%
Taylor expanded in t around 0
lower-/.f6472.9
Applied rewrites72.9%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6449.0
Applied rewrites49.0%
if 1.35e90 < t Initial program 36.6%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6445.3
Applied rewrites45.3%
Taylor expanded in a around 0
Applied rewrites55.1%
Taylor expanded in y around 0
Applied rewrites55.1%
Final simplification51.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- y) (/ t a) x))) (if (<= a -1.8e+139) t_1 (if (<= a 1.7e+77) (- y (* (/ z t) y)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-y, (t / a), x);
double tmp;
if (a <= -1.8e+139) {
tmp = t_1;
} else if (a <= 1.7e+77) {
tmp = y - ((z / t) * y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-y), Float64(t / a), x) tmp = 0.0 if (a <= -1.8e+139) tmp = t_1; elseif (a <= 1.7e+77) tmp = Float64(y - Float64(Float64(z / t) * y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-y) * N[(t / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -1.8e+139], t$95$1, If[LessEqual[a, 1.7e+77], N[(y - N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, \frac{t}{a}, x\right)\\
\mathbf{if}\;a \leq -1.8 \cdot 10^{+139}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{+77}:\\
\;\;\;\;y - \frac{z}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.79999999999999993e139 or 1.69999999999999998e77 < a Initial program 71.5%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6459.3
Applied rewrites59.3%
Taylor expanded in y around inf
Applied rewrites59.6%
Taylor expanded in a around inf
Applied rewrites55.2%
if -1.79999999999999993e139 < a < 1.69999999999999998e77Initial program 68.4%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites49.9%
Taylor expanded in a around 0
Applied rewrites60.8%
Taylor expanded in y around inf
Applied rewrites44.5%
Final simplification47.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- y) -1.0 x))) (if (<= a -1.6e+91) t_1 (if (<= a 2.4e+60) (- y (* (/ z t) y)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-y, -1.0, x);
double tmp;
if (a <= -1.6e+91) {
tmp = t_1;
} else if (a <= 2.4e+60) {
tmp = y - ((z / t) * y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-y), -1.0, x) tmp = 0.0 if (a <= -1.6e+91) tmp = t_1; elseif (a <= 2.4e+60) tmp = Float64(y - Float64(Float64(z / t) * y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-y) * -1.0 + x), $MachinePrecision]}, If[LessEqual[a, -1.6e+91], t$95$1, If[LessEqual[a, 2.4e+60], N[(y - N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, -1, x\right)\\
\mathbf{if}\;a \leq -1.6 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{+60}:\\
\;\;\;\;y - \frac{z}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.59999999999999995e91 or 2.4e60 < a Initial program 69.0%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6457.4
Applied rewrites57.4%
Taylor expanded in y around inf
Applied rewrites57.2%
Taylor expanded in a around 0
Applied rewrites37.7%
if -1.59999999999999995e91 < a < 2.4e60Initial program 69.6%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites50.4%
Taylor expanded in a around 0
Applied rewrites62.5%
Taylor expanded in y around inf
Applied rewrites45.6%
Final simplification42.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- y) -1.0 x))) (if (<= a -1.9e-25) t_1 (if (<= a 1e+102) (fma (/ (- x) t) a y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-y, -1.0, x);
double tmp;
if (a <= -1.9e-25) {
tmp = t_1;
} else if (a <= 1e+102) {
tmp = fma((-x / t), a, y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-y), -1.0, x) tmp = 0.0 if (a <= -1.9e-25) tmp = t_1; elseif (a <= 1e+102) tmp = fma(Float64(Float64(-x) / t), a, y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-y) * -1.0 + x), $MachinePrecision]}, If[LessEqual[a, -1.9e-25], t$95$1, If[LessEqual[a, 1e+102], N[(N[((-x) / t), $MachinePrecision] * a + y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, -1, x\right)\\
\mathbf{if}\;a \leq -1.9 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 10^{+102}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-x}{t}, a, y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.8999999999999999e-25 or 9.99999999999999977e101 < a Initial program 70.9%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6455.3
Applied rewrites55.3%
Taylor expanded in y around inf
Applied rewrites55.1%
Taylor expanded in a around 0
Applied rewrites38.6%
if -1.8999999999999999e-25 < a < 9.99999999999999977e101Initial program 68.1%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6428.6
Applied rewrites28.6%
Taylor expanded in a around 0
Applied rewrites41.7%
Taylor expanded in y around 0
Applied rewrites42.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- y) -1.0 x))) (if (<= a -2.9e-73) t_1 (if (<= a 1.55e+71) y t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-y, -1.0, x);
double tmp;
if (a <= -2.9e-73) {
tmp = t_1;
} else if (a <= 1.55e+71) {
tmp = y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-y), -1.0, x) tmp = 0.0 if (a <= -2.9e-73) tmp = t_1; elseif (a <= 1.55e+71) tmp = y; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-y) * -1.0 + x), $MachinePrecision]}, If[LessEqual[a, -2.9e-73], t$95$1, If[LessEqual[a, 1.55e+71], y, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, -1, x\right)\\
\mathbf{if}\;a \leq -2.9 \cdot 10^{-73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{+71}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.9e-73 or 1.55000000000000009e71 < a Initial program 72.0%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6453.5
Applied rewrites53.5%
Taylor expanded in y around inf
Applied rewrites53.4%
Taylor expanded in a around 0
Applied rewrites36.2%
if -2.9e-73 < a < 1.55000000000000009e71Initial program 66.6%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6428.0
Applied rewrites28.0%
Taylor expanded in a around 0
Applied rewrites32.6%
(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 69.4%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6441.1
Applied rewrites41.1%
Taylor expanded in a around 0
Applied rewrites22.0%
(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 2024278
(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))))