
(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 17 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 (<= t -2e+145)
(+ y (* (/ (- y x) t) (- a z)))
(if (<= t 4.1e+118)
(+ x (/ (- y x) (/ (- a t) (- z t))))
(+ y (/ (- z a) (/ t (- x y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2e+145) {
tmp = y + (((y - x) / t) * (a - z));
} else if (t <= 4.1e+118) {
tmp = x + ((y - x) / ((a - t) / (z - t)));
} else {
tmp = y + ((z - a) / (t / (x - y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-2d+145)) then
tmp = y + (((y - x) / t) * (a - z))
else if (t <= 4.1d+118) then
tmp = x + ((y - x) / ((a - t) / (z - t)))
else
tmp = y + ((z - a) / (t / (x - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2e+145) {
tmp = y + (((y - x) / t) * (a - z));
} else if (t <= 4.1e+118) {
tmp = x + ((y - x) / ((a - t) / (z - t)));
} else {
tmp = y + ((z - a) / (t / (x - y)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2e+145: tmp = y + (((y - x) / t) * (a - z)) elif t <= 4.1e+118: tmp = x + ((y - x) / ((a - t) / (z - t))) else: tmp = y + ((z - a) / (t / (x - y))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2e+145) tmp = Float64(y + Float64(Float64(Float64(y - x) / t) * Float64(a - z))); elseif (t <= 4.1e+118) tmp = Float64(x + Float64(Float64(y - x) / Float64(Float64(a - t) / Float64(z - t)))); else tmp = Float64(y + Float64(Float64(z - a) / Float64(t / Float64(x - y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2e+145) tmp = y + (((y - x) / t) * (a - z)); elseif (t <= 4.1e+118) tmp = x + ((y - x) / ((a - t) / (z - t))); else tmp = y + ((z - a) / (t / (x - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2e+145], N[(y + N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.1e+118], N[(x + N[(N[(y - x), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(N[(z - a), $MachinePrecision] / N[(t / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+145}:\\
\;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{+118}:\\
\;\;\;\;x + \frac{y - x}{\frac{a - t}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;y + \frac{z - a}{\frac{t}{x - y}}\\
\end{array}
\end{array}
if t < -2e145Initial program 15.1%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites25.9%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/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--.f6493.0
Applied rewrites93.0%
if -2e145 < t < 4.0999999999999997e118Initial program 81.9%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6492.0
Applied rewrites92.0%
if 4.0999999999999997e118 < t Initial program 29.1%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites31.0%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/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--.f6490.8
Applied rewrites90.8%
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6490.9
Applied rewrites90.9%
Final simplification91.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ (- z t) a) x)) (t_2 (fma a (/ (- y x) t) y)))
(if (<= t -4.5e+75)
t_2
(if (<= t 6.5e-303)
t_1
(if (<= t 1.15e-215)
(fma (/ z a) (- x) x)
(if (<= t 1e+118) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, ((z - t) / a), x);
double t_2 = fma(a, ((y - x) / t), y);
double tmp;
if (t <= -4.5e+75) {
tmp = t_2;
} else if (t <= 6.5e-303) {
tmp = t_1;
} else if (t <= 1.15e-215) {
tmp = fma((z / a), -x, x);
} else if (t <= 1e+118) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(Float64(z - t) / a), x) t_2 = fma(a, Float64(Float64(y - x) / t), y) tmp = 0.0 if (t <= -4.5e+75) tmp = t_2; elseif (t <= 6.5e-303) tmp = t_1; elseif (t <= 1.15e-215) tmp = fma(Float64(z / a), Float64(-x), x); elseif (t <= 1e+118) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -4.5e+75], t$95$2, If[LessEqual[t, 6.5e-303], t$95$1, If[LessEqual[t, 1.15e-215], N[(N[(z / a), $MachinePrecision] * (-x) + x), $MachinePrecision], If[LessEqual[t, 1e+118], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
t_2 := \mathsf{fma}\left(a, \frac{y - x}{t}, y\right)\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+75}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-303}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-215}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, -x, x\right)\\
\mathbf{elif}\;t \leq 10^{+118}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -4.5000000000000004e75 or 9.99999999999999967e117 < t Initial program 28.4%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites30.5%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/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--.f6488.5
Applied rewrites88.5%
Taylor expanded in z around 0
sub-negN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6463.1
Applied rewrites63.1%
if -4.5000000000000004e75 < t < 6.50000000000000028e-303 or 1.15e-215 < t < 9.99999999999999967e117Initial program 83.5%
Taylor expanded in a around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6475.1
Applied rewrites75.1%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6462.6
Applied rewrites62.6%
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6468.3
Applied rewrites68.3%
if 6.50000000000000028e-303 < t < 1.15e-215Initial program 88.2%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6483.0
Applied rewrites83.0%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-rgt-identityN/A
distribute-lft-inN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
mul-1-negN/A
*-lft-identityN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-neg.f6473.2
Applied rewrites73.2%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3e+89)
(+ y (* (/ (- y x) t) (- a z)))
(if (<= t 4.1e+118)
(fma (/ (- z t) (- a t)) (- y x) x)
(+ y (/ (- z a) (/ t (- x y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3e+89) {
tmp = y + (((y - x) / t) * (a - z));
} else if (t <= 4.1e+118) {
tmp = fma(((z - t) / (a - t)), (y - x), x);
} else {
tmp = y + ((z - a) / (t / (x - y)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3e+89) tmp = Float64(y + Float64(Float64(Float64(y - x) / t) * Float64(a - z))); elseif (t <= 4.1e+118) tmp = fma(Float64(Float64(z - t) / Float64(a - t)), Float64(y - x), x); else tmp = Float64(y + Float64(Float64(z - a) / Float64(t / Float64(x - y)))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3e+89], N[(y + N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.1e+118], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(y + N[(N[(z - a), $MachinePrecision] / N[(t / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{+89}:\\
\;\;\;\;y + \frac{y - x}{t} \cdot \left(a - z\right)\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{+118}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + \frac{z - a}{\frac{t}{x - y}}\\
\end{array}
\end{array}
if t < -3.00000000000000013e89Initial program 24.0%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites26.5%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/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--.f6485.3
Applied rewrites85.3%
if -3.00000000000000013e89 < t < 4.0999999999999997e118Initial program 84.5%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
remove-double-negN/A
lift--.f64N/A
remove-double-negN/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.4
Applied rewrites93.4%
if 4.0999999999999997e118 < t Initial program 29.1%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites31.0%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/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--.f6490.8
Applied rewrites90.8%
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6490.9
Applied rewrites90.9%
Final simplification91.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- x y) (/ (- z a) t) y)))
(if (<= t -5.8e+72)
t_1
(if (<= t 1.5e-215)
(+ x (* z (/ (- y x) a)))
(if (<= t 1.15e+46) (fma y (/ (- z t) a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x - y), ((z - a) / t), y);
double tmp;
if (t <= -5.8e+72) {
tmp = t_1;
} else if (t <= 1.5e-215) {
tmp = x + (z * ((y - x) / a));
} else if (t <= 1.15e+46) {
tmp = fma(y, ((z - t) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x - y), Float64(Float64(z - a) / t), y) tmp = 0.0 if (t <= -5.8e+72) tmp = t_1; elseif (t <= 1.5e-215) tmp = Float64(x + Float64(z * Float64(Float64(y - x) / a))); elseif (t <= 1.15e+46) tmp = fma(y, Float64(Float64(z - t) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -5.8e+72], t$95$1, If[LessEqual[t, 1.5e-215], N[(x + N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e+46], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-215}:\\
\;\;\;\;x + z \cdot \frac{y - x}{a}\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+46}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.80000000000000034e72 or 1.15e46 < t Initial program 33.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
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites80.2%
if -5.80000000000000034e72 < t < 1.50000000000000013e-215Initial program 85.0%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6493.1
Applied rewrites93.1%
Taylor expanded in t around 0
associate-/l*N/A
div-subN/A
lower-*.f64N/A
div-subN/A
lower-/.f64N/A
lower--.f6476.1
Applied rewrites76.1%
if 1.50000000000000013e-215 < t < 1.15e46Initial program 87.8%
Taylor expanded in a around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6476.4
Applied rewrites76.4%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6469.5
Applied rewrites69.5%
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6478.2
Applied rewrites78.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- x y) (/ z t) y)))
(if (<= t -5.8e+72)
t_1
(if (<= t 1.5e-215)
(+ x (* z (/ (- y x) a)))
(if (<= t 1.15e+46) (fma y (/ (- z t) a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x - y), (z / t), y);
double tmp;
if (t <= -5.8e+72) {
tmp = t_1;
} else if (t <= 1.5e-215) {
tmp = x + (z * ((y - x) / a));
} else if (t <= 1.15e+46) {
tmp = fma(y, ((z - t) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x - y), Float64(z / t), y) tmp = 0.0 if (t <= -5.8e+72) tmp = t_1; elseif (t <= 1.5e-215) tmp = Float64(x + Float64(z * Float64(Float64(y - x) / a))); elseif (t <= 1.15e+46) tmp = fma(y, Float64(Float64(z - t) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] * N[(z / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -5.8e+72], t$95$1, If[LessEqual[t, 1.5e-215], N[(x + N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e+46], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x - y, \frac{z}{t}, y\right)\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-215}:\\
\;\;\;\;x + z \cdot \frac{y - x}{a}\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+46}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.80000000000000034e72 or 1.15e46 < t Initial program 33.2%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites34.1%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.8
Applied rewrites84.8%
Taylor expanded in a around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-fma.f64N/A
neg-mul-1N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
mul-1-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f6472.3
Applied rewrites72.3%
if -5.80000000000000034e72 < t < 1.50000000000000013e-215Initial program 85.0%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6493.1
Applied rewrites93.1%
Taylor expanded in t around 0
associate-/l*N/A
div-subN/A
lower-*.f64N/A
div-subN/A
lower-/.f64N/A
lower--.f6476.1
Applied rewrites76.1%
if 1.50000000000000013e-215 < t < 1.15e46Initial program 87.8%
Taylor expanded in a around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6476.4
Applied rewrites76.4%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6469.5
Applied rewrites69.5%
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6478.2
Applied rewrites78.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- x y) (/ z t) y)))
(if (<= t -5.8e+72)
t_1
(if (<= t 1.5e-215)
(fma z (/ (- y x) a) x)
(if (<= t 1.15e+46) (fma y (/ (- z t) a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x - y), (z / t), y);
double tmp;
if (t <= -5.8e+72) {
tmp = t_1;
} else if (t <= 1.5e-215) {
tmp = fma(z, ((y - x) / a), x);
} else if (t <= 1.15e+46) {
tmp = fma(y, ((z - t) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x - y), Float64(z / t), y) tmp = 0.0 if (t <= -5.8e+72) tmp = t_1; elseif (t <= 1.5e-215) tmp = fma(z, Float64(Float64(y - x) / a), x); elseif (t <= 1.15e+46) tmp = fma(y, Float64(Float64(z - t) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] * N[(z / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -5.8e+72], t$95$1, If[LessEqual[t, 1.5e-215], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 1.15e+46], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x - y, \frac{z}{t}, y\right)\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-215}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+46}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.80000000000000034e72 or 1.15e46 < t Initial program 33.2%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites34.1%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.8
Applied rewrites84.8%
Taylor expanded in a around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-fma.f64N/A
neg-mul-1N/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
mul-1-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f6472.3
Applied rewrites72.3%
if -5.80000000000000034e72 < t < 1.50000000000000013e-215Initial program 85.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6476.1
Applied rewrites76.1%
if 1.50000000000000013e-215 < t < 1.15e46Initial program 87.8%
Taylor expanded in a around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6476.4
Applied rewrites76.4%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6469.5
Applied rewrites69.5%
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6478.2
Applied rewrites78.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a (/ (- y x) t) y)))
(if (<= t -4.5e+75)
t_1
(if (<= t 1.5e-215)
(fma z (/ (- y x) a) x)
(if (<= t 1e+118) (fma y (/ (- z t) a) x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, ((y - x) / t), y);
double tmp;
if (t <= -4.5e+75) {
tmp = t_1;
} else if (t <= 1.5e-215) {
tmp = fma(z, ((y - x) / a), x);
} else if (t <= 1e+118) {
tmp = fma(y, ((z - t) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, Float64(Float64(y - x) / t), y) tmp = 0.0 if (t <= -4.5e+75) tmp = t_1; elseif (t <= 1.5e-215) tmp = fma(z, Float64(Float64(y - x) / a), x); elseif (t <= 1e+118) tmp = fma(y, Float64(Float64(z - t) / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -4.5e+75], t$95$1, If[LessEqual[t, 1.5e-215], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 1e+118], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, \frac{y - x}{t}, y\right)\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-215}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{elif}\;t \leq 10^{+118}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.5000000000000004e75 or 9.99999999999999967e117 < t Initial program 28.4%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites30.5%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/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--.f6488.5
Applied rewrites88.5%
Taylor expanded in z around 0
sub-negN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6463.1
Applied rewrites63.1%
if -4.5000000000000004e75 < t < 1.50000000000000013e-215Initial program 85.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6476.1
Applied rewrites76.1%
if 1.50000000000000013e-215 < t < 9.99999999999999967e117Initial program 83.2%
Taylor expanded in a around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6471.2
Applied rewrites71.2%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6462.7
Applied rewrites62.7%
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6469.8
Applied rewrites69.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ y (* (/ (- y x) t) (- a z)))))
(if (<= t -3e+89)
t_1
(if (<= t 4.1e+118) (fma (/ (- z t) (- a t)) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y + (((y - x) / t) * (a - z));
double tmp;
if (t <= -3e+89) {
tmp = t_1;
} else if (t <= 4.1e+118) {
tmp = fma(((z - t) / (a - t)), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y + Float64(Float64(Float64(y - x) / t) * Float64(a - z))) tmp = 0.0 if (t <= -3e+89) tmp = t_1; elseif (t <= 4.1e+118) tmp = fma(Float64(Float64(z - t) / Float64(a - t)), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y + N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3e+89], t$95$1, If[LessEqual[t, 4.1e+118], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \frac{y - x}{t} \cdot \left(a - z\right)\\
\mathbf{if}\;t \leq -3 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{+118}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.00000000000000013e89 or 4.0999999999999997e118 < t Initial program 26.6%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites28.8%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/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--.f6488.2
Applied rewrites88.2%
if -3.00000000000000013e89 < t < 4.0999999999999997e118Initial program 84.5%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
remove-double-negN/A
lift--.f64N/A
remove-double-negN/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.4
Applied rewrites93.4%
Final simplification91.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ y (* (/ (- y x) t) (- a z)))))
(if (<= t -2.1e+73)
t_1
(if (<= t 1.15e+46) (+ x (* (- z t) (/ (- y x) a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y + (((y - x) / t) * (a - z));
double tmp;
if (t <= -2.1e+73) {
tmp = t_1;
} else if (t <= 1.15e+46) {
tmp = x + ((z - t) * ((y - x) / a));
} 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) * (a - z))
if (t <= (-2.1d+73)) then
tmp = t_1
else if (t <= 1.15d+46) then
tmp = x + ((z - t) * ((y - x) / a))
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) * (a - z));
double tmp;
if (t <= -2.1e+73) {
tmp = t_1;
} else if (t <= 1.15e+46) {
tmp = x + ((z - t) * ((y - x) / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y + (((y - x) / t) * (a - z)) tmp = 0 if t <= -2.1e+73: tmp = t_1 elif t <= 1.15e+46: tmp = x + ((z - t) * ((y - x) / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y + Float64(Float64(Float64(y - x) / t) * Float64(a - z))) tmp = 0.0 if (t <= -2.1e+73) tmp = t_1; elseif (t <= 1.15e+46) tmp = Float64(x + Float64(Float64(z - t) * Float64(Float64(y - x) / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y + (((y - x) / t) * (a - z)); tmp = 0.0; if (t <= -2.1e+73) tmp = t_1; elseif (t <= 1.15e+46) tmp = x + ((z - t) * ((y - x) / a)); 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[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.1e+73], t$95$1, If[LessEqual[t, 1.15e+46], N[(x + N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \frac{y - x}{t} \cdot \left(a - z\right)\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+46}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y - x}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.1000000000000001e73 or 1.15e46 < t Initial program 33.2%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites34.1%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.8
Applied rewrites84.8%
if -2.1000000000000001e73 < t < 1.15e46Initial program 85.9%
Taylor expanded in a around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6478.6
Applied rewrites78.6%
Final simplification80.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- x y) (/ (- z a) t) y)))
(if (<= t -2.1e+73)
t_1
(if (<= t 1.15e+46) (+ x (* (- z t) (/ (- y x) a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x - y), ((z - a) / t), y);
double tmp;
if (t <= -2.1e+73) {
tmp = t_1;
} else if (t <= 1.15e+46) {
tmp = x + ((z - t) * ((y - x) / a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x - y), Float64(Float64(z - a) / t), y) tmp = 0.0 if (t <= -2.1e+73) tmp = t_1; elseif (t <= 1.15e+46) tmp = Float64(x + Float64(Float64(z - t) * Float64(Float64(y - x) / a))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -2.1e+73], t$95$1, If[LessEqual[t, 1.15e+46], N[(x + N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x - y, \frac{z - a}{t}, y\right)\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+46}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y - x}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.1000000000000001e73 or 1.15e46 < t Initial program 33.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
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites80.2%
if -2.1000000000000001e73 < t < 1.15e46Initial program 85.9%
Taylor expanded in a around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6478.6
Applied rewrites78.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- x y) (/ (- z a) t) y)))
(if (<= t -2.1e+73)
t_1
(if (<= t 1.15e+46) (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 - y), ((z - a) / t), y);
double tmp;
if (t <= -2.1e+73) {
tmp = t_1;
} else if (t <= 1.15e+46) {
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 - y), Float64(Float64(z - a) / t), y) tmp = 0.0 if (t <= -2.1e+73) tmp = t_1; elseif (t <= 1.15e+46) 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 - y), $MachinePrecision] * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -2.1e+73], t$95$1, If[LessEqual[t, 1.15e+46], 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(x - y, \frac{z - a}{t}, y\right)\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+46}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.1000000000000001e73 or 1.15e46 < t Initial program 33.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
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites80.2%
if -2.1000000000000001e73 < t < 1.15e46Initial program 85.9%
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.6
Applied rewrites78.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma a (/ (- y x) t) y))) (if (<= t -4e+75) t_1 (if (<= t 9.6e+117) (fma z (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, ((y - x) / t), y);
double tmp;
if (t <= -4e+75) {
tmp = t_1;
} else if (t <= 9.6e+117) {
tmp = fma(z, (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, Float64(Float64(y - x) / t), y) tmp = 0.0 if (t <= -4e+75) tmp = t_1; elseif (t <= 9.6e+117) tmp = fma(z, Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -4e+75], t$95$1, If[LessEqual[t, 9.6e+117], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, \frac{y - x}{t}, y\right)\\
\mathbf{if}\;t \leq -4 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.6 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.99999999999999971e75 or 9.5999999999999996e117 < t Initial program 28.4%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift--.f64N/A
flip--N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites30.5%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/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--.f6488.5
Applied rewrites88.5%
Taylor expanded in z around 0
sub-negN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6463.1
Applied rewrites63.1%
if -3.99999999999999971e75 < t < 9.5999999999999996e117Initial program 84.3%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6470.7
Applied rewrites70.7%
Taylor expanded in y around inf
lower-/.f6457.4
Applied rewrites57.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ y (- x x)))) (if (<= t -2.8e+143) t_1 (if (<= t 9.6e+117) (fma z (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y + (x - x);
double tmp;
if (t <= -2.8e+143) {
tmp = t_1;
} else if (t <= 9.6e+117) {
tmp = fma(z, (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y + Float64(x - x)) tmp = 0.0 if (t <= -2.8e+143) tmp = t_1; elseif (t <= 9.6e+117) tmp = fma(z, Float64(y / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y + N[(x - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.8e+143], t$95$1, If[LessEqual[t, 9.6e+117], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x - x\right)\\
\mathbf{if}\;t \leq -2.8 \cdot 10^{+143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.6 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.79999999999999998e143 or 9.5999999999999996e117 < t Initial program 23.3%
Taylor expanded in t around inf
lower--.f6435.8
Applied rewrites35.8%
lift--.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f6456.5
Applied rewrites56.5%
if -2.79999999999999998e143 < t < 9.5999999999999996e117Initial program 82.3%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6468.1
Applied rewrites68.1%
Taylor expanded in y around inf
lower-/.f6455.8
Applied rewrites55.8%
Final simplification55.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ y (- x x)))) (if (<= t -2.1e+79) t_1 (if (<= t 1.45e+48) (* y (/ z a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y + (x - x);
double tmp;
if (t <= -2.1e+79) {
tmp = t_1;
} else if (t <= 1.45e+48) {
tmp = y * (z / a);
} 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 + (x - x)
if (t <= (-2.1d+79)) then
tmp = t_1
else if (t <= 1.45d+48) then
tmp = y * (z / a)
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 + (x - x);
double tmp;
if (t <= -2.1e+79) {
tmp = t_1;
} else if (t <= 1.45e+48) {
tmp = y * (z / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y + (x - x) tmp = 0 if t <= -2.1e+79: tmp = t_1 elif t <= 1.45e+48: tmp = y * (z / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y + Float64(x - x)) tmp = 0.0 if (t <= -2.1e+79) tmp = t_1; elseif (t <= 1.45e+48) tmp = Float64(y * Float64(z / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y + (x - x); tmp = 0.0; if (t <= -2.1e+79) tmp = t_1; elseif (t <= 1.45e+48) tmp = y * (z / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y + N[(x - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.1e+79], t$95$1, If[LessEqual[t, 1.45e+48], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x - x\right)\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{+48}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.10000000000000008e79 or 1.4499999999999999e48 < t Initial program 31.1%
Taylor expanded in t around inf
lower--.f6432.4
Applied rewrites32.4%
lift--.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f6450.0
Applied rewrites50.0%
if -2.10000000000000008e79 < t < 1.4499999999999999e48Initial program 86.2%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6471.9
Applied rewrites71.9%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6428.7
Applied rewrites28.7%
Final simplification36.4%
(FPCore (x y z t a) :precision binary64 (+ y (- x x)))
double code(double x, double y, double z, double t, double a) {
return y + (x - x);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = y + (x - x)
end function
public static double code(double x, double y, double z, double t, double a) {
return y + (x - x);
}
def code(x, y, z, t, a): return y + (x - x)
function code(x, y, z, t, a) return Float64(y + Float64(x - x)) end
function tmp = code(x, y, z, t, a) tmp = y + (x - x); end
code[x_, y_, z_, t_, a_] := N[(y + N[(x - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y + \left(x - x\right)
\end{array}
Initial program 66.2%
Taylor expanded in t around inf
lower--.f6417.4
Applied rewrites17.4%
lift--.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f6424.1
Applied rewrites24.1%
Final simplification24.1%
(FPCore (x y z t a) :precision binary64 (+ x (- y x)))
double code(double x, double y, double z, double t, double a) {
return x + (y - x);
}
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)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y - x);
}
def code(x, y, z, t, a): return x + (y - x)
function code(x, y, z, t, a) return Float64(x + Float64(y - x)) end
function tmp = code(x, y, z, t, a) tmp = x + (y - x); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right)
\end{array}
Initial program 66.2%
Taylor expanded in t around inf
lower--.f6417.4
Applied rewrites17.4%
(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 66.2%
Taylor expanded in t around inf
lower--.f6417.4
Applied rewrites17.4%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f642.8
Applied rewrites2.8%
unsub-negN/A
+-inverses2.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 2024219
(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))))