
(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 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (or (<= t_1 -1e-293) (not (<= t_1 0.0)))
(fma (/ (- z t) (- a t)) (- y x) x)
(- y (* (- x) (/ (- z a) t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if ((t_1 <= -1e-293) || !(t_1 <= 0.0)) {
tmp = fma(((z - t) / (a - t)), (y - x), x);
} else {
tmp = y - (-x * ((z - a) / t));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -1e-293) || !(t_1 <= 0.0)) tmp = fma(Float64(Float64(z - t) / Float64(a - t)), Float64(y - x), x); else tmp = Float64(y - Float64(Float64(-x) * Float64(Float64(z - a) / t))); 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]}, If[Or[LessEqual[t$95$1, -1e-293], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(y - N[((-x) * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-293} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;y - \left(-x\right) \cdot \frac{z - a}{t}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -1.0000000000000001e-293 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 80.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6494.0
Applied rewrites94.0%
if -1.0000000000000001e-293 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 4.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f644.4
Applied rewrites4.4%
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.8
Applied rewrites80.8%
Taylor expanded in x around inf
Applied rewrites99.6%
Final simplification94.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -8.2e+108)
(- y (* (/ (- y x) t) (- z a)))
(if (<= t -5.5e-91)
(+ x (/ (* (- z t) y) (- a t)))
(if (<= t 9.5e+55)
(+ x (/ (* (- y x) z) (- a t)))
(fma (/ (fma -1.0 y x) t) (- z a) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.2e+108) {
tmp = y - (((y - x) / t) * (z - a));
} else if (t <= -5.5e-91) {
tmp = x + (((z - t) * y) / (a - t));
} else if (t <= 9.5e+55) {
tmp = x + (((y - x) * z) / (a - t));
} else {
tmp = fma((fma(-1.0, y, x) / t), (z - a), y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.2e+108) tmp = Float64(y - Float64(Float64(Float64(y - x) / t) * Float64(z - a))); elseif (t <= -5.5e-91) tmp = Float64(x + Float64(Float64(Float64(z - t) * y) / Float64(a - t))); elseif (t <= 9.5e+55) tmp = Float64(x + Float64(Float64(Float64(y - x) * z) / Float64(a - t))); else tmp = fma(Float64(fma(-1.0, y, x) / t), Float64(z - a), y); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.2e+108], N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -5.5e-91], N[(x + N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e+55], N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-1.0 * y + x), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{+108}:\\
\;\;\;\;y - \frac{y - x}{t} \cdot \left(z - a\right)\\
\mathbf{elif}\;t \leq -5.5 \cdot 10^{-91}:\\
\;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+55}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(-1, y, x\right)}{t}, z - a, y\right)\\
\end{array}
\end{array}
if t < -8.1999999999999998e108Initial program 40.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6476.9
Applied rewrites76.9%
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--.f6478.5
Applied rewrites78.5%
if -8.1999999999999998e108 < t < -5.49999999999999965e-91Initial program 80.4%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f6469.7
Applied rewrites69.7%
if -5.49999999999999965e-91 < t < 9.49999999999999989e55Initial program 93.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6486.5
Applied rewrites86.5%
if 9.49999999999999989e55 < t Initial program 39.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 rewrites84.4%
Final simplification82.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- y (* (/ (- y x) t) (- z a)))))
(if (<= t -8.2e+108)
t_1
(if (<= t -5.5e-91)
(+ x (/ (* (- z t) y) (- a t)))
(if (<= t 9.5e+55) (+ x (/ (* (- y x) z) (- a t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y - (((y - x) / t) * (z - a));
double tmp;
if (t <= -8.2e+108) {
tmp = t_1;
} else if (t <= -5.5e-91) {
tmp = x + (((z - t) * y) / (a - t));
} else if (t <= 9.5e+55) {
tmp = x + (((y - x) * z) / (a - t));
} 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 - (((y - x) / t) * (z - a))
if (t <= (-8.2d+108)) then
tmp = t_1
else if (t <= (-5.5d-91)) then
tmp = x + (((z - t) * y) / (a - t))
else if (t <= 9.5d+55) then
tmp = x + (((y - x) * z) / (a - t))
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 - (((y - x) / t) * (z - a));
double tmp;
if (t <= -8.2e+108) {
tmp = t_1;
} else if (t <= -5.5e-91) {
tmp = x + (((z - t) * y) / (a - t));
} else if (t <= 9.5e+55) {
tmp = x + (((y - x) * z) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y - (((y - x) / t) * (z - a)) tmp = 0 if t <= -8.2e+108: tmp = t_1 elif t <= -5.5e-91: tmp = x + (((z - t) * y) / (a - t)) elif t <= 9.5e+55: tmp = x + (((y - x) * z) / (a - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y - Float64(Float64(Float64(y - x) / t) * Float64(z - a))) tmp = 0.0 if (t <= -8.2e+108) tmp = t_1; elseif (t <= -5.5e-91) tmp = Float64(x + Float64(Float64(Float64(z - t) * y) / Float64(a - t))); elseif (t <= 9.5e+55) tmp = Float64(x + Float64(Float64(Float64(y - x) * z) / Float64(a - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y - (((y - x) / t) * (z - a)); tmp = 0.0; if (t <= -8.2e+108) tmp = t_1; elseif (t <= -5.5e-91) tmp = x + (((z - t) * y) / (a - t)); elseif (t <= 9.5e+55) tmp = x + (((y - x) * z) / (a - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8.2e+108], t$95$1, If[LessEqual[t, -5.5e-91], N[(x + N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e+55], N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - \frac{y - x}{t} \cdot \left(z - a\right)\\
\mathbf{if}\;t \leq -8.2 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -5.5 \cdot 10^{-91}:\\
\;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+55}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -8.1999999999999998e108 or 9.49999999999999989e55 < t Initial program 39.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6471.8
Applied rewrites71.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--.f6481.9
Applied rewrites81.9%
if -8.1999999999999998e108 < t < -5.49999999999999965e-91Initial program 80.4%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f6469.7
Applied rewrites69.7%
if -5.49999999999999965e-91 < t < 9.49999999999999989e55Initial program 93.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6486.5
Applied rewrites86.5%
Final simplification82.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- y (* (/ (- y x) t) (- z a)))))
(if (<= t -115000.0)
t_1
(if (<= t 1.55e-247)
(fma (/ (- z t) a) (- y x) x)
(if (<= t 9.5e+55) (+ x (/ (* (- y x) z) (- a t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y - (((y - x) / t) * (z - a));
double tmp;
if (t <= -115000.0) {
tmp = t_1;
} else if (t <= 1.55e-247) {
tmp = fma(((z - t) / a), (y - x), x);
} else if (t <= 9.5e+55) {
tmp = x + (((y - x) * z) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y - Float64(Float64(Float64(y - x) / t) * Float64(z - a))) tmp = 0.0 if (t <= -115000.0) tmp = t_1; elseif (t <= 1.55e-247) tmp = fma(Float64(Float64(z - t) / a), Float64(y - x), x); elseif (t <= 9.5e+55) tmp = Float64(x + Float64(Float64(Float64(y - x) * z) / Float64(a - t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -115000.0], t$95$1, If[LessEqual[t, 1.55e-247], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 9.5e+55], N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - \frac{y - x}{t} \cdot \left(z - a\right)\\
\mathbf{if}\;t \leq -115000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-247}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y - x, x\right)\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+55}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -115000 or 9.49999999999999989e55 < t Initial program 47.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6476.1
Applied rewrites76.1%
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.8
Applied rewrites77.8%
if -115000 < t < 1.55000000000000008e-247Initial program 89.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6494.6
Applied rewrites94.6%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6486.3
Applied rewrites86.3%
if 1.55000000000000008e-247 < t < 9.49999999999999989e55Initial program 94.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6484.7
Applied rewrites84.7%
Final simplification82.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- z t) (- a t)) y)))
(if (<= t -8.5e-25)
t_1
(if (<= t 4.2e-93)
(fma (/ z a) (- y x) x)
(if (<= t 1.8e-5) (* (- y x) (/ z (- a t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) / (a - t)) * y;
double tmp;
if (t <= -8.5e-25) {
tmp = t_1;
} else if (t <= 4.2e-93) {
tmp = fma((z / a), (y - x), x);
} else if (t <= 1.8e-5) {
tmp = (y - x) * (z / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - t) / Float64(a - t)) * y) tmp = 0.0 if (t <= -8.5e-25) tmp = t_1; elseif (t <= 4.2e-93) tmp = fma(Float64(z / a), Float64(y - x), x); elseif (t <= 1.8e-5) tmp = Float64(Float64(y - x) * Float64(z / Float64(a - t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t, -8.5e-25], t$95$1, If[LessEqual[t, 4.2e-93], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 1.8e-5], N[(N[(y - x), $MachinePrecision] * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t} \cdot y\\
\mathbf{if}\;t \leq -8.5 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-93}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-5}:\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -8.49999999999999981e-25 or 1.80000000000000005e-5 < t Initial program 51.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6478.1
Applied rewrites78.1%
Taylor expanded in y around inf
*-commutativeN/A
Applied rewrites82.5%
Taylor expanded in x around 0
Applied rewrites62.9%
if -8.49999999999999981e-25 < t < 4.2000000000000002e-93Initial program 91.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.7
Applied rewrites93.7%
Taylor expanded in t around 0
lower-/.f6483.6
Applied rewrites83.6%
if 4.2000000000000002e-93 < t < 1.80000000000000005e-5Initial program 99.8%
Taylor expanded in z 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--.f6477.6
Applied rewrites77.6%
Final simplification73.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma 1.0 (- y x) x)))
(if (<= t -2.6e+132)
t_1
(if (<= t 4.3e-75)
(fma (/ y a) z x)
(if (<= t 5.5e+132) (fma (/ (- x) a) z x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(1.0, (y - x), x);
double tmp;
if (t <= -2.6e+132) {
tmp = t_1;
} else if (t <= 4.3e-75) {
tmp = fma((y / a), z, x);
} else if (t <= 5.5e+132) {
tmp = fma((-x / a), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(1.0, Float64(y - x), x) tmp = 0.0 if (t <= -2.6e+132) tmp = t_1; elseif (t <= 4.3e-75) tmp = fma(Float64(y / a), z, x); elseif (t <= 5.5e+132) tmp = fma(Float64(Float64(-x) / a), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -2.6e+132], t$95$1, If[LessEqual[t, 4.3e-75], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[t, 5.5e+132], N[(N[((-x) / a), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{if}\;t \leq -2.6 \cdot 10^{+132}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{-75}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+132}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-x}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.6e132 or 5.5e132 < t Initial program 32.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6473.0
Applied rewrites73.0%
Taylor expanded in t around inf
Applied rewrites54.8%
if -2.6e132 < t < 4.2999999999999999e-75Initial program 87.4%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6472.8
Applied rewrites72.8%
Taylor expanded in x around 0
Applied rewrites60.0%
if 4.2999999999999999e-75 < t < 5.5e132Initial program 79.7%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6447.1
Applied rewrites47.1%
Taylor expanded in x around inf
Applied rewrites43.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3.5e+31)
(fma (- z t) (/ (- y x) a) x)
(if (<= a 1.55e-60)
(- y (* (/ (- y x) t) (- z a)))
(fma (/ (- z t) a) (- y x) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.5e+31) {
tmp = fma((z - t), ((y - x) / a), x);
} else if (a <= 1.55e-60) {
tmp = y - (((y - x) / t) * (z - a));
} else {
tmp = fma(((z - t) / a), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.5e+31) tmp = fma(Float64(z - t), Float64(Float64(y - x) / a), x); elseif (a <= 1.55e-60) tmp = Float64(y - Float64(Float64(Float64(y - x) / t) * Float64(z - a))); else tmp = fma(Float64(Float64(z - t) / a), Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.5e+31], N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 1.55e-60], N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{+31}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y - x}{a}, x\right)\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{-60}:\\
\;\;\;\;y - \frac{y - x}{t} \cdot \left(z - a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y - x, x\right)\\
\end{array}
\end{array}
if a < -3.5e31Initial program 75.7%
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--.f6483.6
Applied rewrites83.6%
if -3.5e31 < a < 1.54999999999999994e-60Initial program 68.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6477.7
Applied rewrites77.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--.f6478.5
Applied rewrites78.5%
if 1.54999999999999994e-60 < a Initial program 80.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6494.9
Applied rewrites94.9%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6480.9
Applied rewrites80.9%
Final simplification80.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -19000.0) (not (<= a 1.15e-60))) (fma (- z t) (/ (- y x) a) x) (- y (/ (* (- y x) z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -19000.0) || !(a <= 1.15e-60)) {
tmp = fma((z - t), ((y - x) / a), x);
} else {
tmp = y - (((y - x) * z) / t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -19000.0) || !(a <= 1.15e-60)) tmp = fma(Float64(z - t), Float64(Float64(y - x) / a), x); else tmp = Float64(y - Float64(Float64(Float64(y - x) * z) / t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -19000.0], N[Not[LessEqual[a, 1.15e-60]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(y - N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -19000 \lor \neg \left(a \leq 1.15 \cdot 10^{-60}\right):\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y - \frac{\left(y - x\right) \cdot z}{t}\\
\end{array}
\end{array}
if a < -19000 or 1.1500000000000001e-60 < a Initial program 77.5%
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--.f6478.7
Applied rewrites78.7%
if -19000 < a < 1.1500000000000001e-60Initial program 69.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6478.2
Applied rewrites78.2%
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--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around inf
Applied rewrites78.5%
Final simplification78.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -19000.0)
(fma (- z t) (/ (- y x) a) x)
(if (<= a 3.5e-61)
(- y (/ (* (- y x) z) t))
(fma (/ (- z t) a) (- y x) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -19000.0) {
tmp = fma((z - t), ((y - x) / a), x);
} else if (a <= 3.5e-61) {
tmp = y - (((y - x) * z) / t);
} else {
tmp = fma(((z - t) / a), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -19000.0) tmp = fma(Float64(z - t), Float64(Float64(y - x) / a), x); elseif (a <= 3.5e-61) tmp = Float64(y - Float64(Float64(Float64(y - x) * z) / t)); else tmp = fma(Float64(Float64(z - t) / a), Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -19000.0], N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 3.5e-61], N[(y - N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -19000:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y - x}{a}, x\right)\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-61}:\\
\;\;\;\;y - \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y - x, x\right)\\
\end{array}
\end{array}
if a < -19000Initial program 73.3%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6480.2
Applied rewrites80.2%
if -19000 < a < 3.5000000000000003e-61Initial program 69.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6478.2
Applied rewrites78.2%
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--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around inf
Applied rewrites78.5%
if 3.5000000000000003e-61 < a Initial program 80.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6494.9
Applied rewrites94.9%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6480.9
Applied rewrites80.9%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.7e-32) (fma (/ (- y x) a) z x) (if (<= a 1.45e-60) (- y (/ (* (- y x) z) t)) (fma (/ z a) (- y x) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.7e-32) {
tmp = fma(((y - x) / a), z, x);
} else if (a <= 1.45e-60) {
tmp = y - (((y - x) * z) / t);
} else {
tmp = fma((z / a), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.7e-32) tmp = fma(Float64(Float64(y - x) / a), z, x); elseif (a <= 1.45e-60) tmp = Float64(y - Float64(Float64(Float64(y - x) * z) / t)); else tmp = fma(Float64(z / a), Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.7e-32], N[(N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[a, 1.45e-60], N[(y - N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{-32}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{a}, z, x\right)\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{-60}:\\
\;\;\;\;y - \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\end{array}
\end{array}
if a < -2.69999999999999981e-32Initial program 73.6%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6475.2
Applied rewrites75.2%
if -2.69999999999999981e-32 < a < 1.45e-60Initial program 69.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6477.5
Applied rewrites77.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--.f6481.2
Applied rewrites81.2%
Taylor expanded in z around inf
Applied rewrites80.5%
if 1.45e-60 < a Initial program 80.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6494.9
Applied rewrites94.9%
Taylor expanded in t around 0
lower-/.f6475.5
Applied rewrites75.5%
Final simplification77.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.4e+107) (not (<= t 4.5e+132))) (fma a (/ (- y x) t) y) (fma (/ z a) (- y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.4e+107) || !(t <= 4.5e+132)) {
tmp = fma(a, ((y - x) / t), y);
} else {
tmp = fma((z / a), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.4e+107) || !(t <= 4.5e+132)) tmp = fma(a, Float64(Float64(y - x) / t), 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, -3.4e+107], N[Not[LessEqual[t, 4.5e+132]], $MachinePrecision]], N[(a * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+107} \lor \neg \left(t \leq 4.5 \cdot 10^{+132}\right):\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y - x}{t}, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\end{array}
\end{array}
if t < -3.3999999999999997e107 or 4.49999999999999972e132 < t Initial program 35.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6471.9
Applied rewrites71.9%
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--.f6486.8
Applied rewrites86.8%
Taylor expanded in z around 0
Applied rewrites63.2%
if -3.3999999999999997e107 < t < 4.49999999999999972e132Initial program 87.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6491.9
Applied rewrites91.9%
Taylor expanded in t around 0
lower-/.f6470.9
Applied rewrites70.9%
Final simplification68.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.4e+107) (not (<= t 4.5e+132))) (fma a (/ (- y x) t) y) (fma (/ (- y x) a) z x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.4e+107) || !(t <= 4.5e+132)) {
tmp = fma(a, ((y - x) / t), y);
} else {
tmp = fma(((y - x) / a), z, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.4e+107) || !(t <= 4.5e+132)) tmp = fma(a, Float64(Float64(y - x) / t), y); else tmp = fma(Float64(Float64(y - x) / a), z, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.4e+107], N[Not[LessEqual[t, 4.5e+132]], $MachinePrecision]], N[(a * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+107} \lor \neg \left(t \leq 4.5 \cdot 10^{+132}\right):\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y - x}{t}, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{a}, z, x\right)\\
\end{array}
\end{array}
if t < -3.3999999999999997e107 or 4.49999999999999972e132 < t Initial program 35.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6471.9
Applied rewrites71.9%
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--.f6486.8
Applied rewrites86.8%
Taylor expanded in z around 0
Applied rewrites63.2%
if -3.3999999999999997e107 < t < 4.49999999999999972e132Initial program 87.4%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6470.4
Applied rewrites70.4%
Final simplification68.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.7e+132) (not (<= t 5.8e+132))) (fma 1.0 (- y x) x) (fma (/ (- y x) a) z x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.7e+132) || !(t <= 5.8e+132)) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = fma(((y - x) / a), z, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.7e+132) || !(t <= 5.8e+132)) tmp = fma(1.0, Float64(y - x), x); else tmp = fma(Float64(Float64(y - x) / a), z, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.7e+132], N[Not[LessEqual[t, 5.8e+132]], $MachinePrecision]], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{+132} \lor \neg \left(t \leq 5.8 \cdot 10^{+132}\right):\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{a}, z, x\right)\\
\end{array}
\end{array}
if t < -2.7e132 or 5.7999999999999997e132 < t Initial program 32.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6473.0
Applied rewrites73.0%
Taylor expanded in t around inf
Applied rewrites54.8%
if -2.7e132 < t < 5.7999999999999997e132Initial program 85.8%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6467.3
Applied rewrites67.3%
Final simplification64.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.3e-15) (* (- z t) (/ y (- a t))) (if (<= t 4.5e+132) (fma (/ z a) (- y x) x) (fma a (/ (- y x) t) y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.3e-15) {
tmp = (z - t) * (y / (a - t));
} else if (t <= 4.5e+132) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = fma(a, ((y - x) / t), y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.3e-15) tmp = Float64(Float64(z - t) * Float64(y / Float64(a - t))); elseif (t <= 4.5e+132) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = fma(a, Float64(Float64(y - x) / t), y); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.3e-15], N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e+132], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(a * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{-15}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+132}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y - x}{t}, y\right)\\
\end{array}
\end{array}
if t < -4.2999999999999997e-15Initial program 56.4%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6458.1
Applied rewrites58.1%
if -4.2999999999999997e-15 < t < 4.49999999999999972e132Initial program 88.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6491.3
Applied rewrites91.3%
Taylor expanded in t around 0
lower-/.f6473.5
Applied rewrites73.5%
if 4.49999999999999972e132 < t Initial program 28.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6464.9
Applied rewrites64.9%
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--.f6496.3
Applied rewrites96.3%
Taylor expanded in z around 0
Applied rewrites75.3%
Final simplification70.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.6e+132) (not (<= t 4.3e+132))) (fma 1.0 (- y x) x) (fma (/ y a) z x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.6e+132) || !(t <= 4.3e+132)) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = fma((y / a), z, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.6e+132) || !(t <= 4.3e+132)) tmp = fma(1.0, Float64(y - x), x); else tmp = fma(Float64(y / a), z, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.6e+132], N[Not[LessEqual[t, 4.3e+132]], $MachinePrecision]], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+132} \lor \neg \left(t \leq 4.3 \cdot 10^{+132}\right):\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\end{array}
\end{array}
if t < -2.6e132 or 4.29999999999999982e132 < t Initial program 32.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6473.0
Applied rewrites73.0%
Taylor expanded in t around inf
Applied rewrites54.8%
if -2.6e132 < t < 4.29999999999999982e132Initial program 85.8%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6467.3
Applied rewrites67.3%
Taylor expanded in x around 0
Applied rewrites54.5%
Final simplification54.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.6e+132) (not (<= t 4e+132))) (fma 1.0 (- y x) x) (* (/ x y) y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.6e+132) || !(t <= 4e+132)) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = (x / y) * y;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.6e+132) || !(t <= 4e+132)) tmp = fma(1.0, Float64(y - x), x); else tmp = Float64(Float64(x / y) * y); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.6e+132], N[Not[LessEqual[t, 4e+132]], $MachinePrecision]], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+132} \lor \neg \left(t \leq 4 \cdot 10^{+132}\right):\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot y\\
\end{array}
\end{array}
if t < -2.6e132 or 3.99999999999999996e132 < t Initial program 32.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6473.0
Applied rewrites73.0%
Taylor expanded in t around inf
Applied rewrites54.8%
if -2.6e132 < t < 3.99999999999999996e132Initial program 85.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6490.5
Applied rewrites90.5%
Taylor expanded in y around inf
*-commutativeN/A
Applied rewrites80.2%
Taylor expanded in a around inf
Applied rewrites31.9%
Final simplification37.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1650000000000.0) (not (<= t 1.1e+21))) (fma 1.0 (- y x) x) (* z (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1650000000000.0) || !(t <= 1.1e+21)) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = z * (y / a);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1650000000000.0) || !(t <= 1.1e+21)) tmp = fma(1.0, Float64(y - x), x); else tmp = Float64(z * Float64(y / a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1650000000000.0], N[Not[LessEqual[t, 1.1e+21]], $MachinePrecision]], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1650000000000 \lor \neg \left(t \leq 1.1 \cdot 10^{+21}\right):\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -1.65e12 or 1.1e21 < t Initial program 48.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6476.1
Applied rewrites76.1%
Taylor expanded in t around inf
Applied rewrites37.8%
if -1.65e12 < t < 1.1e21Initial program 91.2%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6475.2
Applied rewrites75.2%
Taylor expanded in x around 0
Applied rewrites26.4%
Applied rewrites26.7%
Final simplification31.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.8e-26) (* z (/ y a)) (if (<= z 3.2e+69) (fma 1.0 (- y x) x) (* (/ z a) y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e-26) {
tmp = z * (y / a);
} else if (z <= 3.2e+69) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = (z / a) * y;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.8e-26) tmp = Float64(z * Float64(y / a)); elseif (z <= 3.2e+69) tmp = fma(1.0, Float64(y - x), x); else tmp = Float64(Float64(z / a) * y); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.8e-26], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+69], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-26}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+69}:\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{a} \cdot y\\
\end{array}
\end{array}
if z < -2.8000000000000001e-26Initial program 75.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6460.8
Applied rewrites60.8%
Taylor expanded in x around 0
Applied rewrites26.9%
Applied rewrites28.2%
if -2.8000000000000001e-26 < z < 3.19999999999999985e69Initial program 72.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6484.5
Applied rewrites84.5%
Taylor expanded in t around inf
Applied rewrites31.3%
if 3.19999999999999985e69 < z Initial program 76.2%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6464.7
Applied rewrites64.7%
Taylor expanded in x around 0
Applied rewrites35.2%
Applied rewrites38.9%
(FPCore (x y z t a) :precision binary64 (fma 1.0 (- y x) x))
double code(double x, double y, double z, double t, double a) {
return fma(1.0, (y - x), x);
}
function code(x, y, z, t, a) return fma(1.0, Float64(y - x), x) end
code[x_, y_, z_, t_, a_] := N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(1, y - x, x\right)
\end{array}
Initial program 73.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6486.6
Applied rewrites86.6%
Taylor expanded in t around inf
Applied rewrites20.8%
(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 2024326
(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))))