
(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 21 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 (if (or (<= t -2.6e+117) (not (<= t 2.5e+135))) (fma (/ (fma -1.0 y x) t) (- z a) y) (fma (/ (- z t) (- a t)) (- y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.6e+117) || !(t <= 2.5e+135)) {
tmp = fma((fma(-1.0, y, x) / t), (z - a), y);
} else {
tmp = fma(((z - t) / (a - t)), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.6e+117) || !(t <= 2.5e+135)) tmp = fma(Float64(fma(-1.0, y, x) / t), Float64(z - a), y); else tmp = fma(Float64(Float64(z - t) / Float64(a - t)), Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.6e+117], N[Not[LessEqual[t, 2.5e+135]], $MachinePrecision]], N[(N[(N[(-1.0 * y + x), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+117} \lor \neg \left(t \leq 2.5 \cdot 10^{+135}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(-1, y, x\right)}{t}, z - a, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)\\
\end{array}
\end{array}
if t < -2.5999999999999999e117 or 2.50000000000000015e135 < t Initial program 26.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 rewrites88.9%
if -2.5999999999999999e117 < t < 2.50000000000000015e135Initial program 84.8%
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%
Final simplification93.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (fma -1.0 y x) t) (- z a) y)))
(if (<= t -5.5e+112)
t_1
(if (<= t -2.8e-48)
(+ x (/ (* (- z t) y) (- a t)))
(if (<= t 1.95e+87) (fma (- z t) (/ (- y x) a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((fma(-1.0, y, x) / t), (z - a), y);
double tmp;
if (t <= -5.5e+112) {
tmp = t_1;
} else if (t <= -2.8e-48) {
tmp = x + (((z - t) * y) / (a - t));
} else if (t <= 1.95e+87) {
tmp = fma((z - t), ((y - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(fma(-1.0, y, x) / t), Float64(z - a), y) tmp = 0.0 if (t <= -5.5e+112) tmp = t_1; elseif (t <= -2.8e-48) tmp = Float64(x + Float64(Float64(Float64(z - t) * y) / Float64(a - t))); elseif (t <= 1.95e+87) tmp = fma(Float64(z - t), Float64(Float64(y - x) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(-1.0 * y + x), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -5.5e+112], t$95$1, If[LessEqual[t, -2.8e-48], N[(x + N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.95e+87], N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{\mathsf{fma}\left(-1, y, x\right)}{t}, z - a, y\right)\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.8 \cdot 10^{-48}:\\
\;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+87}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.50000000000000026e112 or 1.9500000000000001e87 < t Initial program 34.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 rewrites84.4%
if -5.50000000000000026e112 < t < -2.80000000000000005e-48Initial program 83.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f6475.5
Applied rewrites75.5%
if -2.80000000000000005e-48 < t < 1.9500000000000001e87Initial program 86.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--.f6478.8
Applied rewrites78.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ x t) (- z a) y)))
(if (<= t -4.2e+113)
t_1
(if (<= t -2.8e-48)
(+ x (/ (* (- z t) y) (- a t)))
(if (<= t 1.95e+87) (fma (- z t) (/ (- y x) a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x / t), (z - a), y);
double tmp;
if (t <= -4.2e+113) {
tmp = t_1;
} else if (t <= -2.8e-48) {
tmp = x + (((z - t) * y) / (a - t));
} else if (t <= 1.95e+87) {
tmp = fma((z - t), ((y - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x / t), Float64(z - a), y) tmp = 0.0 if (t <= -4.2e+113) tmp = t_1; elseif (t <= -2.8e-48) tmp = Float64(x + Float64(Float64(Float64(z - t) * y) / Float64(a - t))); elseif (t <= 1.95e+87) tmp = fma(Float64(z - t), Float64(Float64(y - x) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -4.2e+113], t$95$1, If[LessEqual[t, -2.8e-48], N[(x + N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.95e+87], N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x}{t}, z - a, y\right)\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.8 \cdot 10^{-48}:\\
\;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+87}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.1999999999999998e113 or 1.9500000000000001e87 < t Initial program 34.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 rewrites84.4%
Taylor expanded in x around inf
Applied rewrites78.2%
if -4.1999999999999998e113 < t < -2.80000000000000005e-48Initial program 83.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f6475.5
Applied rewrites75.5%
if -2.80000000000000005e-48 < t < 1.9500000000000001e87Initial program 86.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--.f6478.8
Applied rewrites78.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ x t) (- z a) y)))
(if (<= t -6e+155)
t_1
(if (<= t -2600000.0)
(* (- z t) (/ y (- a t)))
(if (<= t 1.95e+87) (fma (- z t) (/ (- y x) a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x / t), (z - a), y);
double tmp;
if (t <= -6e+155) {
tmp = t_1;
} else if (t <= -2600000.0) {
tmp = (z - t) * (y / (a - t));
} else if (t <= 1.95e+87) {
tmp = fma((z - t), ((y - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x / t), Float64(z - a), y) tmp = 0.0 if (t <= -6e+155) tmp = t_1; elseif (t <= -2600000.0) tmp = Float64(Float64(z - t) * Float64(y / Float64(a - t))); elseif (t <= 1.95e+87) tmp = fma(Float64(z - t), Float64(Float64(y - x) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -6e+155], t$95$1, If[LessEqual[t, -2600000.0], N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.95e+87], N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x}{t}, z - a, y\right)\\
\mathbf{if}\;t \leq -6 \cdot 10^{+155}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2600000:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+87}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.0000000000000003e155 or 1.9500000000000001e87 < t Initial program 29.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 rewrites82.0%
Taylor expanded in x around inf
Applied rewrites79.3%
if -6.0000000000000003e155 < t < -2.6e6Initial program 72.8%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6466.5
Applied rewrites66.5%
if -2.6e6 < t < 1.9500000000000001e87Initial program 87.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--.f6477.8
Applied rewrites77.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.75e+130) (not (<= t 9e+133))) (fma (/ (fma -1.0 y x) t) (- z a) y) (fma (/ (- y x) (- a t)) (- z t) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.75e+130) || !(t <= 9e+133)) {
tmp = fma((fma(-1.0, y, x) / t), (z - a), y);
} else {
tmp = fma(((y - x) / (a - t)), (z - t), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.75e+130) || !(t <= 9e+133)) tmp = fma(Float64(fma(-1.0, y, x) / t), Float64(z - a), y); else tmp = fma(Float64(Float64(y - x) / Float64(a - t)), Float64(z - t), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.75e+130], N[Not[LessEqual[t, 9e+133]], $MachinePrecision]], N[(N[(N[(-1.0 * y + x), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.75 \cdot 10^{+130} \lor \neg \left(t \leq 9 \cdot 10^{+133}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(-1, y, x\right)}{t}, z - a, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{a - t}, z - t, x\right)\\
\end{array}
\end{array}
if t < -1.75e130 or 8.9999999999999997e133 < t Initial program 24.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 rewrites88.1%
if -1.75e130 < t < 8.9999999999999997e133Initial program 84.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.6
Applied rewrites93.6%
Final simplification92.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ x t) (- z a) y)))
(if (<= t -6e+155)
t_1
(if (<= t -1950000.0)
(* (- z t) (/ y (- a t)))
(if (<= t 1.95e+87) (fma (/ (- y x) a) z x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x / t), (z - a), y);
double tmp;
if (t <= -6e+155) {
tmp = t_1;
} else if (t <= -1950000.0) {
tmp = (z - t) * (y / (a - t));
} else if (t <= 1.95e+87) {
tmp = fma(((y - x) / a), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x / t), Float64(z - a), y) tmp = 0.0 if (t <= -6e+155) tmp = t_1; elseif (t <= -1950000.0) tmp = Float64(Float64(z - t) * Float64(y / Float64(a - t))); elseif (t <= 1.95e+87) tmp = fma(Float64(Float64(y - x) / a), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -6e+155], t$95$1, If[LessEqual[t, -1950000.0], N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.95e+87], N[(N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x}{t}, z - a, y\right)\\
\mathbf{if}\;t \leq -6 \cdot 10^{+155}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1950000:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+87}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.0000000000000003e155 or 1.9500000000000001e87 < t Initial program 29.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 rewrites82.0%
Taylor expanded in x around inf
Applied rewrites79.3%
if -6.0000000000000003e155 < t < -1.95e6Initial program 72.8%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6466.5
Applied rewrites66.5%
if -1.95e6 < t < 1.9500000000000001e87Initial program 87.2%
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%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- z t) (/ y a) x)))
(if (<= a -1.7e-65)
t_1
(if (<= a 5.5e-249)
(fma (/ (- a z) t) y y)
(if (<= a 1.35e+82) (fma (/ x t) (- z a) y) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((z - t), (y / a), x);
double tmp;
if (a <= -1.7e-65) {
tmp = t_1;
} else if (a <= 5.5e-249) {
tmp = fma(((a - z) / t), y, y);
} else if (a <= 1.35e+82) {
tmp = fma((x / t), (z - a), y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(z - t), Float64(y / a), x) tmp = 0.0 if (a <= -1.7e-65) tmp = t_1; elseif (a <= 5.5e-249) tmp = fma(Float64(Float64(a - z) / t), y, y); elseif (a <= 1.35e+82) tmp = fma(Float64(x / t), Float64(z - a), y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -1.7e-65], t$95$1, If[LessEqual[a, 5.5e-249], N[(N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision] * y + y), $MachinePrecision], If[LessEqual[a, 1.35e+82], N[(N[(x / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z - t, \frac{y}{a}, x\right)\\
\mathbf{if}\;a \leq -1.7 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{-249}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a - z}{t}, y, y\right)\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{+82}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z - a, y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.69999999999999993e-65 or 1.35e82 < a Initial program 72.0%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6480.6
Applied rewrites80.6%
Taylor expanded in x around 0
Applied rewrites73.9%
if -1.69999999999999993e-65 < a < 5.49999999999999999e-249Initial program 70.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 rewrites76.5%
Taylor expanded in x around 0
Applied rewrites73.0%
if 5.49999999999999999e-249 < a < 1.35e82Initial program 68.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 rewrites68.2%
Taylor expanded in x around inf
Applied rewrites59.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ y a) z x)))
(if (<= a -1.05e-19)
t_1
(if (<= a -4.5e-174)
(/ (* z (- y x)) a)
(if (<= a 7.5e-14) (/ (* (- x y) z) t) 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 <= -1.05e-19) {
tmp = t_1;
} else if (a <= -4.5e-174) {
tmp = (z * (y - x)) / a;
} else if (a <= 7.5e-14) {
tmp = ((x - y) * z) / t;
} 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 <= -1.05e-19) tmp = t_1; elseif (a <= -4.5e-174) tmp = Float64(Float64(z * Float64(y - x)) / a); elseif (a <= 7.5e-14) tmp = Float64(Float64(Float64(x - y) * z) / t); 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, -1.05e-19], t$95$1, If[LessEqual[a, -4.5e-174], N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[a, 7.5e-14], N[(N[(N[(x - y), $MachinePrecision] * z), $MachinePrecision] / t), $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 -1.05 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -4.5 \cdot 10^{-174}:\\
\;\;\;\;\frac{z \cdot \left(y - x\right)}{a}\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{-14}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.0499999999999999e-19 or 7.4999999999999996e-14 < a Initial program 68.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6466.7
Applied rewrites66.7%
Taylor expanded in x around 0
Applied rewrites60.8%
if -1.0499999999999999e-19 < a < -4.49999999999999964e-174Initial program 84.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6447.8
Applied rewrites47.8%
Taylor expanded in z around inf
Applied rewrites43.6%
Applied rewrites48.1%
if -4.49999999999999964e-174 < a < 7.4999999999999996e-14Initial program 71.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 rewrites78.2%
Taylor expanded in z around inf
Applied rewrites40.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ y a) z x)))
(if (<= a -1.05e-19)
t_1
(if (<= a -4.5e-174)
(* (/ z a) (- y x))
(if (<= a 7.5e-14) (/ (* (- x y) z) t) 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 <= -1.05e-19) {
tmp = t_1;
} else if (a <= -4.5e-174) {
tmp = (z / a) * (y - x);
} else if (a <= 7.5e-14) {
tmp = ((x - y) * z) / t;
} 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 <= -1.05e-19) tmp = t_1; elseif (a <= -4.5e-174) tmp = Float64(Float64(z / a) * Float64(y - x)); elseif (a <= 7.5e-14) tmp = Float64(Float64(Float64(x - y) * z) / t); 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, -1.05e-19], t$95$1, If[LessEqual[a, -4.5e-174], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.5e-14], N[(N[(N[(x - y), $MachinePrecision] * z), $MachinePrecision] / t), $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 -1.05 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -4.5 \cdot 10^{-174}:\\
\;\;\;\;\frac{z}{a} \cdot \left(y - x\right)\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{-14}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.0499999999999999e-19 or 7.4999999999999996e-14 < a Initial program 68.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6466.7
Applied rewrites66.7%
Taylor expanded in x around 0
Applied rewrites60.8%
if -1.0499999999999999e-19 < a < -4.49999999999999964e-174Initial program 84.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6447.8
Applied rewrites47.8%
Taylor expanded in z around inf
Applied rewrites43.6%
Applied rewrites48.0%
if -4.49999999999999964e-174 < a < 7.4999999999999996e-14Initial program 71.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 rewrites78.2%
Taylor expanded in z around inf
Applied rewrites40.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2500000.0) (not (<= t 1.95e+87))) (fma (/ x t) (- z a) y) (fma (/ (- y x) a) z x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2500000.0) || !(t <= 1.95e+87)) {
tmp = fma((x / t), (z - a), y);
} else {
tmp = fma(((y - x) / a), z, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2500000.0) || !(t <= 1.95e+87)) tmp = fma(Float64(x / t), Float64(z - a), 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, -2500000.0], N[Not[LessEqual[t, 1.95e+87]], $MachinePrecision]], N[(N[(x / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2500000 \lor \neg \left(t \leq 1.95 \cdot 10^{+87}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z - a, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{a}, z, x\right)\\
\end{array}
\end{array}
if t < -2.5e6 or 1.9500000000000001e87 < t Initial program 44.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 rewrites77.2%
Taylor expanded in x around inf
Applied rewrites70.3%
if -2.5e6 < t < 1.9500000000000001e87Initial program 87.2%
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%
Final simplification71.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2500000.0) (not (<= t 5.2e+76))) (fma (/ x t) (- z a) y) (fma (/ y a) z x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2500000.0) || !(t <= 5.2e+76)) {
tmp = fma((x / t), (z - a), y);
} else {
tmp = fma((y / a), z, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2500000.0) || !(t <= 5.2e+76)) tmp = fma(Float64(x / t), Float64(z - a), y); else tmp = fma(Float64(y / a), z, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2500000.0], N[Not[LessEqual[t, 5.2e+76]], $MachinePrecision]], N[(N[(x / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2500000 \lor \neg \left(t \leq 5.2 \cdot 10^{+76}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z - a, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\end{array}
\end{array}
if t < -2.5e6 or 5.1999999999999999e76 < t Initial program 45.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 rewrites75.5%
Taylor expanded in x around inf
Applied rewrites68.9%
if -2.5e6 < t < 5.1999999999999999e76Initial program 88.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6473.4
Applied rewrites73.4%
Taylor expanded in x around 0
Applied rewrites60.2%
Final simplification63.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.4e-29) (not (<= a 1.9e+72))) (fma (/ y a) z x) (fma (/ (- a z) t) y y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.4e-29) || !(a <= 1.9e+72)) {
tmp = fma((y / a), z, x);
} else {
tmp = fma(((a - z) / t), y, y);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.4e-29) || !(a <= 1.9e+72)) tmp = fma(Float64(y / a), z, x); else tmp = fma(Float64(Float64(a - z) / t), y, y); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.4e-29], N[Not[LessEqual[a, 1.9e+72]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], N[(N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision] * y + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.4 \cdot 10^{-29} \lor \neg \left(a \leq 1.9 \cdot 10^{+72}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a - z}{t}, y, y\right)\\
\end{array}
\end{array}
if a < -2.39999999999999992e-29 or 1.90000000000000003e72 < a Initial program 69.3%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6470.8
Applied rewrites70.8%
Taylor expanded in x around 0
Applied rewrites65.1%
if -2.39999999999999992e-29 < a < 1.90000000000000003e72Initial program 72.1%
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.4%
Taylor expanded in x around 0
Applied rewrites54.1%
Final simplification59.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.15e-41) (not (<= a 7.5e-14))) (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 <= -1.15e-41) || !(a <= 7.5e-14)) {
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 <= -1.15e-41) || !(a <= 7.5e-14)) 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, -1.15e-41], N[Not[LessEqual[a, 7.5e-14]], $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 -1.15 \cdot 10^{-41} \lor \neg \left(a \leq 7.5 \cdot 10^{-14}\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 < -1.15000000000000005e-41 or 7.4999999999999996e-14 < a Initial program 68.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6466.6
Applied rewrites66.6%
Taylor expanded in x around 0
Applied rewrites60.2%
if -1.15000000000000005e-41 < a < 7.4999999999999996e-14Initial program 73.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 rewrites73.7%
Taylor expanded in z around inf
Applied rewrites38.0%
Final simplification51.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.4e+129) (not (<= t 2.05e+89))) (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 <= -5.4e+129) || !(t <= 2.05e+89)) {
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 <= -5.4e+129) || !(t <= 2.05e+89)) 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, -5.4e+129], N[Not[LessEqual[t, 2.05e+89]], $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 -5.4 \cdot 10^{+129} \lor \neg \left(t \leq 2.05 \cdot 10^{+89}\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 < -5.4000000000000002e129 or 2.04999999999999993e89 < t Initial program 32.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6466.8
Applied rewrites66.8%
Taylor expanded in t around inf
Applied rewrites38.6%
if -5.4000000000000002e129 < t < 2.04999999999999993e89Initial program 85.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6465.6
Applied rewrites65.6%
Taylor expanded in x around 0
Applied rewrites54.3%
Final simplification49.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -6.8e+155) (* x (/ (- z a) t)) (if (<= t 2.05e+89) (fma (/ y a) z x) (fma 1.0 (- y x) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.8e+155) {
tmp = x * ((z - a) / t);
} else if (t <= 2.05e+89) {
tmp = fma((y / a), z, x);
} else {
tmp = fma(1.0, (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.8e+155) tmp = Float64(x * Float64(Float64(z - a) / t)); elseif (t <= 2.05e+89) tmp = fma(Float64(y / a), z, x); else tmp = fma(1.0, Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.8e+155], N[(x * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.05e+89], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{+155}:\\
\;\;\;\;x \cdot \frac{z - a}{t}\\
\mathbf{elif}\;t \leq 2.05 \cdot 10^{+89}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\end{array}
\end{array}
if t < -6.8000000000000002e155Initial program 14.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 rewrites86.7%
Taylor expanded in x around inf
Applied rewrites29.2%
Applied rewrites46.7%
if -6.8000000000000002e155 < t < 2.04999999999999993e89Initial program 84.6%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6463.8
Applied rewrites63.8%
Taylor expanded in x around 0
Applied rewrites52.9%
if 2.04999999999999993e89 < t Initial program 38.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6466.3
Applied rewrites66.3%
Taylor expanded in t around inf
Applied rewrites40.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.1e-26) (not (<= t 5.2e+76))) (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 <= -2.1e-26) || !(t <= 5.2e+76)) {
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 <= -2.1e-26) || !(t <= 5.2e+76)) 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, -2.1e-26], N[Not[LessEqual[t, 5.2e+76]], $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 -2.1 \cdot 10^{-26} \lor \neg \left(t \leq 5.2 \cdot 10^{+76}\right):\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -2.10000000000000008e-26 or 5.1999999999999999e76 < t Initial program 48.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6476.5
Applied rewrites76.5%
Taylor expanded in t around inf
Applied rewrites33.1%
if -2.10000000000000008e-26 < t < 5.1999999999999999e76Initial program 87.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6473.4
Applied rewrites73.4%
Taylor expanded in z around inf
Applied rewrites38.5%
Applied rewrites36.5%
Taylor expanded in x around 0
Applied rewrites25.0%
Final simplification28.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.4e-6) (not (<= z 2.4e+117))) (* x (/ z t)) (fma 1.0 (- y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.4e-6) || !(z <= 2.4e+117)) {
tmp = x * (z / t);
} else {
tmp = fma(1.0, (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.4e-6) || !(z <= 2.4e+117)) tmp = Float64(x * Float64(z / t)); else tmp = fma(1.0, Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.4e-6], N[Not[LessEqual[z, 2.4e+117]], $MachinePrecision]], N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{-6} \lor \neg \left(z \leq 2.4 \cdot 10^{+117}\right):\\
\;\;\;\;x \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\end{array}
\end{array}
if z < -4.4000000000000002e-6 or 2.3999999999999999e117 < z Initial program 68.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 rewrites54.1%
Taylor expanded in x around inf
Applied rewrites28.3%
Taylor expanded in z around inf
Applied rewrites31.2%
if -4.4000000000000002e-6 < z < 2.3999999999999999e117Initial program 71.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6486.2
Applied rewrites86.2%
Taylor expanded in t around inf
Applied rewrites24.6%
Final simplification27.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.4e-6) (* x (/ z t)) (if (<= z 3.4e+117) (fma 1.0 (- y x) x) (/ (* z x) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.4e-6) {
tmp = x * (z / t);
} else if (z <= 3.4e+117) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = (z * x) / t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.4e-6) tmp = Float64(x * Float64(z / t)); elseif (z <= 3.4e+117) tmp = fma(1.0, Float64(y - x), x); else tmp = Float64(Float64(z * x) / t); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.4e-6], N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e+117], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(z * x), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \frac{z}{t}\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot x}{t}\\
\end{array}
\end{array}
if z < -4.4000000000000002e-6Initial program 66.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 rewrites56.8%
Taylor expanded in x around inf
Applied rewrites25.1%
Taylor expanded in z around inf
Applied rewrites32.9%
if -4.4000000000000002e-6 < z < 3.4000000000000001e117Initial program 71.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6486.2
Applied rewrites86.2%
Taylor expanded in t around inf
Applied rewrites24.6%
if 3.4000000000000001e117 < z Initial program 72.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 rewrites49.6%
Taylor expanded in x around inf
Applied rewrites33.6%
Taylor expanded in z around inf
Applied rewrites30.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.35e+195) (* t (/ x a)) (fma 1.0 (- y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.35e+195) {
tmp = t * (x / a);
} else {
tmp = fma(1.0, (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.35e+195) tmp = Float64(t * Float64(x / a)); else tmp = fma(1.0, Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.35e+195], N[(t * N[(x / a), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+195}:\\
\;\;\;\;t \cdot \frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\end{array}
\end{array}
if x < -1.3500000000000001e195Initial program 48.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--.f6459.4
Applied rewrites59.4%
Taylor expanded in x around inf
Applied rewrites54.6%
Taylor expanded in t around inf
Applied rewrites26.8%
if -1.3500000000000001e195 < x Initial program 73.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
Taylor expanded in t around inf
Applied rewrites19.0%
(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 70.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6487.1
Applied rewrites87.1%
Taylor expanded in t around inf
Applied rewrites17.9%
(FPCore (x y z t a) :precision binary64 (fma 1.0 (- x) x))
double code(double x, double y, double z, double t, double a) {
return fma(1.0, -x, x);
}
function code(x, y, z, t, a) return fma(1.0, Float64(-x), x) end
code[x_, y_, z_, t_, a_] := N[(1.0 * (-x) + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(1, -x, x\right)
\end{array}
Initial program 70.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6487.1
Applied rewrites87.1%
Taylor expanded in t around inf
Applied rewrites17.9%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f642.8
Applied rewrites2.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 2024339
(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))))