
(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 -5e-295) (not (<= t_1 0.0)))
(fma (/ (- z t) (- a t)) (- y x) x)
(fma (- x y) (/ (- z a) t) y))))
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 <= -5e-295) || !(t_1 <= 0.0)) {
tmp = fma(((z - t) / (a - t)), (y - x), x);
} else {
tmp = fma((x - y), ((z - a) / t), y);
}
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 <= -5e-295) || !(t_1 <= 0.0)) tmp = fma(Float64(Float64(z - t) / Float64(a - t)), 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_] := 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, -5e-295], 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[(N[(x - y), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + y), $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 -5 \cdot 10^{-295} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -5.00000000000000008e-295 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) 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-/.f6489.9
Applied rewrites89.9%
if -5.00000000000000008e-295 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 4.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 rewrites76.7%
Taylor expanded in t around inf
Applied rewrites99.5%
Final simplification90.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- x y) z) t)) (t_2 (fma (/ x t) (- a) y)))
(if (<= t -2.6e+126)
t_2
(if (<= t -2.25e-37)
t_1
(if (<= t 3.55e-116)
(* (- 1.0 (/ z a)) x)
(if (<= t 6e+40) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) * z) / t;
double t_2 = fma((x / t), -a, y);
double tmp;
if (t <= -2.6e+126) {
tmp = t_2;
} else if (t <= -2.25e-37) {
tmp = t_1;
} else if (t <= 3.55e-116) {
tmp = (1.0 - (z / a)) * x;
} else if (t <= 6e+40) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x - y) * z) / t) t_2 = fma(Float64(x / t), Float64(-a), y) tmp = 0.0 if (t <= -2.6e+126) tmp = t_2; elseif (t <= -2.25e-37) tmp = t_1; elseif (t <= 3.55e-116) tmp = Float64(Float64(1.0 - Float64(z / a)) * x); elseif (t <= 6e+40) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - y), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t), $MachinePrecision] * (-a) + y), $MachinePrecision]}, If[LessEqual[t, -2.6e+126], t$95$2, If[LessEqual[t, -2.25e-37], t$95$1, If[LessEqual[t, 3.55e-116], N[(N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 6e+40], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(x - y\right) \cdot z}{t}\\
t_2 := \mathsf{fma}\left(\frac{x}{t}, -a, y\right)\\
\mathbf{if}\;t \leq -2.6 \cdot 10^{+126}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -2.25 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.55 \cdot 10^{-116}:\\
\;\;\;\;\left(1 - \frac{z}{a}\right) \cdot x\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -2.6e126 or 6.0000000000000004e40 < t Initial program 40.9%
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 rewrites80.1%
Taylor expanded in x around inf
Applied rewrites74.1%
Taylor expanded in z around 0
Applied rewrites60.9%
if -2.6e126 < t < -2.2500000000000002e-37 or 3.5499999999999998e-116 < t < 6.0000000000000004e40Initial program 76.8%
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 rewrites59.1%
Taylor expanded in z around inf
Applied rewrites49.8%
if -2.2500000000000002e-37 < t < 3.5499999999999998e-116Initial program 88.6%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6478.1
Applied rewrites78.1%
Taylor expanded in x around inf
Applied rewrites60.4%
Final simplification57.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- x y) t) z y)))
(if (<= t -1.9e-37)
t_1
(if (<= t 1.2e-200)
(fma (/ z a) (- y x) x)
(if (<= t 3.8e-5) (/ (* (- y x) z) (- a t)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((x - y) / t), z, y);
double tmp;
if (t <= -1.9e-37) {
tmp = t_1;
} else if (t <= 1.2e-200) {
tmp = fma((z / a), (y - x), x);
} else if (t <= 3.8e-5) {
tmp = ((y - x) * z) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(x - y) / t), z, y) tmp = 0.0 if (t <= -1.9e-37) tmp = t_1; elseif (t <= 1.2e-200) tmp = fma(Float64(z / a), Float64(y - x), x); elseif (t <= 3.8e-5) tmp = 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[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * z + y), $MachinePrecision]}, If[LessEqual[t, -1.9e-37], t$95$1, If[LessEqual[t, 1.2e-200], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 3.8e-5], N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x - y}{t}, z, y\right)\\
\mathbf{if}\;t \leq -1.9 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-200}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-5}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.9000000000000002e-37 or 3.8000000000000002e-5 < t Initial program 51.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 rewrites73.9%
Taylor expanded in a around 0
Applied rewrites69.2%
if -1.9000000000000002e-37 < t < 1.20000000000000001e-200Initial program 87.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6495.7
Applied rewrites95.7%
Taylor expanded in t around 0
lower-/.f6488.9
Applied rewrites88.9%
if 1.20000000000000001e-200 < t < 3.8000000000000002e-5Initial program 88.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6487.9
Applied rewrites87.9%
Taylor expanded in z around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6464.2
Applied rewrites64.2%
Final simplification73.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- x y) t) z y)))
(if (<= t -1.9e-37)
t_1
(if (<= t 9e-119)
(fma (/ z a) (- y x) x)
(if (<= t 3.8e-5) (* (- y x) (/ z (- a t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((x - y) / t), z, y);
double tmp;
if (t <= -1.9e-37) {
tmp = t_1;
} else if (t <= 9e-119) {
tmp = fma((z / a), (y - x), x);
} else if (t <= 3.8e-5) {
tmp = (y - x) * (z / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(x - y) / t), z, y) tmp = 0.0 if (t <= -1.9e-37) tmp = t_1; elseif (t <= 9e-119) tmp = fma(Float64(z / a), Float64(y - x), x); elseif (t <= 3.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[(x - y), $MachinePrecision] / t), $MachinePrecision] * z + y), $MachinePrecision]}, If[LessEqual[t, -1.9e-37], t$95$1, If[LessEqual[t, 9e-119], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 3.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 := \mathsf{fma}\left(\frac{x - y}{t}, z, y\right)\\
\mathbf{if}\;t \leq -1.9 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-119}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-5}:\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.9000000000000002e-37 or 3.8000000000000002e-5 < t Initial program 51.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 rewrites73.9%
Taylor expanded in a around 0
Applied rewrites69.2%
if -1.9000000000000002e-37 < t < 9.0000000000000005e-119Initial program 89.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6495.6
Applied rewrites95.6%
Taylor expanded in t around 0
lower-/.f6482.9
Applied rewrites82.9%
if 9.0000000000000005e-119 < t < 3.8000000000000002e-5Initial program 82.9%
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--.f6465.8
Applied rewrites65.8%
Final simplification73.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.12e+49) (not (<= t 0.00175))) (fma (- x y) (/ (- z a) t) y) (+ x (/ (* (- y x) z) (- a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.12e+49) || !(t <= 0.00175)) {
tmp = fma((x - y), ((z - a) / t), y);
} else {
tmp = x + (((y - x) * z) / (a - t));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.12e+49) || !(t <= 0.00175)) tmp = fma(Float64(x - y), Float64(Float64(z - a) / t), y); else tmp = Float64(x + Float64(Float64(Float64(y - x) * z) / Float64(a - t))); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.12e+49], N[Not[LessEqual[t, 0.00175]], $MachinePrecision]], N[(N[(x - y), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision], N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.12 \cdot 10^{+49} \lor \neg \left(t \leq 0.00175\right):\\
\;\;\;\;\mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{a - t}\\
\end{array}
\end{array}
if t < -1.12000000000000005e49 or 0.00175000000000000004 < t Initial program 44.6%
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 rewrites78.2%
Taylor expanded in t around inf
Applied rewrites80.9%
if -1.12000000000000005e49 < t < 0.00175000000000000004Initial program 87.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6478.8
Applied rewrites78.8%
Final simplification79.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ y a) z x)))
(if (<= a -2.9e+49)
t_1
(if (<= a -3.3e-118)
(* y (/ z (- a t)))
(if (<= a 2.3e-57) (* (/ (- z a) t) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y / a), z, x);
double tmp;
if (a <= -2.9e+49) {
tmp = t_1;
} else if (a <= -3.3e-118) {
tmp = y * (z / (a - t));
} else if (a <= 2.3e-57) {
tmp = ((z - a) / t) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y / a), z, x) tmp = 0.0 if (a <= -2.9e+49) tmp = t_1; elseif (a <= -3.3e-118) tmp = Float64(y * Float64(z / Float64(a - t))); elseif (a <= 2.3e-57) tmp = Float64(Float64(Float64(z - a) / t) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision]}, If[LessEqual[a, -2.9e+49], t$95$1, If[LessEqual[a, -3.3e-118], N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.3e-57], N[(N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{if}\;a \leq -2.9 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -3.3 \cdot 10^{-118}:\\
\;\;\;\;y \cdot \frac{z}{a - t}\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-57}:\\
\;\;\;\;\frac{z - a}{t} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.9e49 or 2.3e-57 < a Initial program 68.4%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6466.3
Applied rewrites66.3%
Taylor expanded in x around 0
Applied rewrites54.1%
if -2.9e49 < a < -3.3e-118Initial program 72.7%
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--.f6454.5
Applied rewrites54.5%
Taylor expanded in x around 0
Applied rewrites41.4%
if -3.3e-118 < a < 2.3e-57Initial program 66.8%
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 rewrites80.1%
Taylor expanded in x around inf
Applied rewrites65.9%
Taylor expanded in x around inf
Applied rewrites43.6%
Final simplification48.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.95e+49) (not (<= a 3.5e-17))) (fma (- z t) (/ (- y x) a) x) (fma (- x y) (/ (- z a) t) y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.95e+49) || !(a <= 3.5e-17)) {
tmp = fma((z - t), ((y - x) / a), x);
} else {
tmp = fma((x - y), ((z - a) / t), y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.95e+49) || !(a <= 3.5e-17)) tmp = fma(Float64(z - t), Float64(Float64(y - x) / a), x); else tmp = fma(Float64(x - y), Float64(Float64(z - a) / t), y); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.95e+49], N[Not[LessEqual[a, 3.5e-17]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] / a), $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}\;a \leq -2.95 \cdot 10^{+49} \lor \neg \left(a \leq 3.5 \cdot 10^{-17}\right):\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\
\end{array}
\end{array}
if a < -2.9500000000000001e49 or 3.5000000000000002e-17 < a Initial program 68.2%
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--.f6475.5
Applied rewrites75.5%
if -2.9500000000000001e49 < a < 3.5000000000000002e-17Initial program 68.4%
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 rewrites76.5%
Taylor expanded in t around inf
Applied rewrites83.3%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.25e-37) (not (<= t 9e-119))) (fma (- x y) (/ (- z a) t) y) (fma (/ z a) (- y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.25e-37) || !(t <= 9e-119)) {
tmp = fma((x - y), ((z - a) / t), y);
} else {
tmp = fma((z / a), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.25e-37) || !(t <= 9e-119)) tmp = fma(Float64(x - y), Float64(Float64(z - a) / 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, -2.25e-37], N[Not[LessEqual[t, 9e-119]], $MachinePrecision]], N[(N[(x - y), $MachinePrecision] * N[(N[(z - a), $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 -2.25 \cdot 10^{-37} \lor \neg \left(t \leq 9 \cdot 10^{-119}\right):\\
\;\;\;\;\mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\end{array}
\end{array}
if t < -2.2500000000000002e-37 or 9.0000000000000005e-119 < t Initial program 56.7%
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 rewrites70.0%
Taylor expanded in t around inf
Applied rewrites74.1%
if -2.2500000000000002e-37 < t < 9.0000000000000005e-119Initial program 89.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6495.6
Applied rewrites95.6%
Taylor expanded in t around 0
lower-/.f6482.9
Applied rewrites82.9%
Final simplification77.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma 1.0 (- y x) x)))
(if (<= t -1.2e+167)
t_1
(if (<= t -1.65e-31)
(* y (/ z (- a t)))
(if (<= t 0.0092) (fma (/ y 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 <= -1.2e+167) {
tmp = t_1;
} else if (t <= -1.65e-31) {
tmp = y * (z / (a - t));
} else if (t <= 0.0092) {
tmp = fma((y / 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 <= -1.2e+167) tmp = t_1; elseif (t <= -1.65e-31) tmp = Float64(y * Float64(z / Float64(a - t))); elseif (t <= 0.0092) tmp = fma(Float64(y / 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, -1.2e+167], t$95$1, If[LessEqual[t, -1.65e-31], N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.0092], N[(N[(y / 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 -1.2 \cdot 10^{+167}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.65 \cdot 10^{-31}:\\
\;\;\;\;y \cdot \frac{z}{a - t}\\
\mathbf{elif}\;t \leq 0.0092:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.19999999999999999e167 or 0.0091999999999999998 < t Initial program 44.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6472.8
Applied rewrites72.8%
Taylor expanded in t around inf
Applied rewrites42.0%
if -1.19999999999999999e167 < t < -1.65e-31Initial program 60.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--.f6456.1
Applied rewrites56.1%
Taylor expanded in x around 0
Applied rewrites34.0%
if -1.65e-31 < t < 0.0091999999999999998Initial program 88.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6472.1
Applied rewrites72.1%
Taylor expanded in x around 0
Applied rewrites53.3%
Final simplification45.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.9e-37) (not (<= t 5.1e-116))) (fma (/ (- x y) t) z y) (fma (/ z a) (- y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.9e-37) || !(t <= 5.1e-116)) {
tmp = fma(((x - y) / t), z, y);
} else {
tmp = fma((z / a), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.9e-37) || !(t <= 5.1e-116)) tmp = fma(Float64(Float64(x - y) / t), z, y); else tmp = fma(Float64(z / a), Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.9e-37], N[Not[LessEqual[t, 5.1e-116]], $MachinePrecision]], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * z + y), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-37} \lor \neg \left(t \leq 5.1 \cdot 10^{-116}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, z, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\end{array}
\end{array}
if t < -1.9000000000000002e-37 or 5.1000000000000002e-116 < t Initial program 56.8%
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 rewrites70.8%
Taylor expanded in a around 0
Applied rewrites66.5%
if -1.9000000000000002e-37 < t < 5.1000000000000002e-116Initial program 88.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.6
Applied rewrites93.6%
Taylor expanded in t around 0
lower-/.f6481.1
Applied rewrites81.1%
Final simplification71.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.35e-31) (not (<= t 5.1e-116))) (fma (/ (- x y) t) z y) (fma (/ (- y x) a) z x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.35e-31) || !(t <= 5.1e-116)) {
tmp = fma(((x - y) / t), z, y);
} else {
tmp = fma(((y - x) / a), z, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.35e-31) || !(t <= 5.1e-116)) tmp = fma(Float64(Float64(x - y) / t), z, 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, -1.35e-31], N[Not[LessEqual[t, 5.1e-116]], $MachinePrecision]], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * z + y), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-31} \lor \neg \left(t \leq 5.1 \cdot 10^{-116}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, z, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{a}, z, x\right)\\
\end{array}
\end{array}
if t < -1.35000000000000007e-31 or 5.1000000000000002e-116 < t Initial program 56.5%
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 rewrites71.2%
Taylor expanded in a around 0
Applied rewrites66.8%
if -1.35000000000000007e-31 < t < 5.1000000000000002e-116Initial program 88.7%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6478.3
Applied rewrites78.3%
Final simplification71.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6e+49) (not (<= a 7.8e+65))) (fma (- z t) (/ y a) x) (fma (/ (- x y) t) z y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6e+49) || !(a <= 7.8e+65)) {
tmp = fma((z - t), (y / a), x);
} else {
tmp = fma(((x - y) / t), z, y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6e+49) || !(a <= 7.8e+65)) tmp = fma(Float64(z - t), Float64(y / a), x); else tmp = fma(Float64(Float64(x - y) / t), z, y); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6e+49], N[Not[LessEqual[a, 7.8e+65]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * z + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{+49} \lor \neg \left(a \leq 7.8 \cdot 10^{+65}\right):\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, z, y\right)\\
\end{array}
\end{array}
if a < -6.0000000000000005e49 or 7.7999999999999996e65 < a Initial program 68.2%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6476.4
Applied rewrites76.4%
Taylor expanded in x around 0
Applied rewrites66.0%
if -6.0000000000000005e49 < a < 7.7999999999999996e65Initial program 68.4%
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 rewrites75.1%
Taylor expanded in a around 0
Applied rewrites71.4%
Final simplification69.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6e+49) (not (<= a 7.8e+65))) (fma (/ y a) z x) (fma (/ (- x y) t) z y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6e+49) || !(a <= 7.8e+65)) {
tmp = fma((y / a), z, x);
} else {
tmp = fma(((x - y) / t), z, y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6e+49) || !(a <= 7.8e+65)) tmp = fma(Float64(y / a), z, x); else tmp = fma(Float64(Float64(x - y) / t), z, y); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6e+49], N[Not[LessEqual[a, 7.8e+65]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * z + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{+49} \lor \neg \left(a \leq 7.8 \cdot 10^{+65}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, z, y\right)\\
\end{array}
\end{array}
if a < -6.0000000000000005e49 or 7.7999999999999996e65 < a Initial program 68.2%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6468.5
Applied rewrites68.5%
Taylor expanded in x around 0
Applied rewrites58.4%
if -6.0000000000000005e49 < a < 7.7999999999999996e65Initial program 68.4%
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 rewrites75.1%
Taylor expanded in a around 0
Applied rewrites71.4%
Final simplification65.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.9e+49) (not (<= a 2.06e-50))) (fma (/ y a) z x) (/ (* (- x y) z) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.9e+49) || !(a <= 2.06e-50)) {
tmp = fma((y / a), z, x);
} else {
tmp = ((x - y) * z) / t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.9e+49) || !(a <= 2.06e-50)) tmp = fma(Float64(y / a), z, x); else tmp = Float64(Float64(Float64(x - y) * z) / t); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.9e+49], N[Not[LessEqual[a, 2.06e-50]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], N[(N[(N[(x - y), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.9 \cdot 10^{+49} \lor \neg \left(a \leq 2.06 \cdot 10^{-50}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot z}{t}\\
\end{array}
\end{array}
if a < -2.9e49 or 2.06e-50 < a Initial program 68.7%
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.9%
if -2.9e49 < a < 2.06e-50Initial program 68.0%
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 rewrites77.1%
Taylor expanded in z around inf
Applied rewrites47.1%
Final simplification50.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.9e+49) (fma (/ y a) z x) (if (<= a 4.6e-51) (/ (* (- x y) z) t) (* (- 1.0 (/ z a)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.9e+49) {
tmp = fma((y / a), z, x);
} else if (a <= 4.6e-51) {
tmp = ((x - y) * z) / t;
} else {
tmp = (1.0 - (z / a)) * x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.9e+49) tmp = fma(Float64(y / a), z, x); elseif (a <= 4.6e-51) tmp = Float64(Float64(Float64(x - y) * z) / t); else tmp = Float64(Float64(1.0 - Float64(z / a)) * x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.9e+49], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[a, 4.6e-51], N[(N[(N[(x - y), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision], N[(N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.9 \cdot 10^{+49}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{elif}\;a \leq 4.6 \cdot 10^{-51}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{z}{a}\right) \cdot x\\
\end{array}
\end{array}
if a < -2.9e49Initial program 68.8%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6468.4
Applied rewrites68.4%
Taylor expanded in x around 0
Applied rewrites56.0%
if -2.9e49 < a < 4.60000000000000004e-51Initial program 68.0%
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 rewrites77.1%
Taylor expanded in z around inf
Applied rewrites47.1%
if 4.60000000000000004e-51 < a Initial program 68.7%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6466.4
Applied rewrites66.4%
Taylor expanded in x around inf
Applied rewrites54.8%
Final simplification51.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.65e+168) (not (<= t 0.0092))) (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 <= -1.65e+168) || !(t <= 0.0092)) {
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 <= -1.65e+168) || !(t <= 0.0092)) 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, -1.65e+168], N[Not[LessEqual[t, 0.0092]], $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 -1.65 \cdot 10^{+168} \lor \neg \left(t \leq 0.0092\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 < -1.6499999999999999e168 or 0.0091999999999999998 < t Initial program 44.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6472.8
Applied rewrites72.8%
Taylor expanded in t around inf
Applied rewrites42.0%
if -1.6499999999999999e168 < t < 0.0091999999999999998Initial program 79.8%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6458.8
Applied rewrites58.8%
Taylor expanded in x around 0
Applied rewrites44.1%
Final simplification43.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.15e+34) (not (<= t 3.25e-12))) (fma 1.0 (- y x) x) (* y (/ z a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.15e+34) || !(t <= 3.25e-12)) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = y * (z / a);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.15e+34) || !(t <= 3.25e-12)) tmp = fma(1.0, Float64(y - x), x); else tmp = Float64(y * Float64(z / a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.15e+34], N[Not[LessEqual[t, 3.25e-12]], $MachinePrecision]], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{+34} \lor \neg \left(t \leq 3.25 \cdot 10^{-12}\right):\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.1499999999999999e34 or 3.2500000000000001e-12 < t Initial program 46.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6473.1
Applied rewrites73.1%
Taylor expanded in t around inf
Applied rewrites32.6%
if -1.1499999999999999e34 < t < 3.2500000000000001e-12Initial program 87.4%
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--.f6471.7
Applied rewrites71.7%
Taylor expanded in x around 0
Applied rewrites26.1%
Taylor expanded in z around inf
Applied rewrites25.4%
Final simplification28.7%
(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 68.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6483.3
Applied rewrites83.3%
Taylor expanded in t around inf
Applied rewrites18.1%
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
return 0.0;
}
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 = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return 0.0;
}
def code(x, y, z, t, a): return 0.0
function code(x, y, z, t, a) return 0.0 end
function tmp = code(x, y, z, t, a) tmp = 0.0; end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 68.3%
Taylor expanded in x around inf
+-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6442.4
Applied rewrites42.4%
Taylor expanded in t around inf
Applied rewrites2.8%
Final simplification2.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 2024329
(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))))