
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x y) t)))
(if (<= t -2e+145)
(+ (+ y (* a (/ (- y x) t))) (* z t_1))
(if (<= t 4.1e+118)
(+ x (/ (- x y) (/ (- a t) (- t z))))
(+ y (* t_1 (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - y) / t;
double tmp;
if (t <= -2e+145) {
tmp = (y + (a * ((y - x) / t))) + (z * t_1);
} else if (t <= 4.1e+118) {
tmp = x + ((x - y) / ((a - t) / (t - z)));
} else {
tmp = y + (t_1 * (z - a));
}
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) / t
if (t <= (-2d+145)) then
tmp = (y + (a * ((y - x) / t))) + (z * t_1)
else if (t <= 4.1d+118) then
tmp = x + ((x - y) / ((a - t) / (t - z)))
else
tmp = y + (t_1 * (z - a))
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) / t;
double tmp;
if (t <= -2e+145) {
tmp = (y + (a * ((y - x) / t))) + (z * t_1);
} else if (t <= 4.1e+118) {
tmp = x + ((x - y) / ((a - t) / (t - z)));
} else {
tmp = y + (t_1 * (z - a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - y) / t tmp = 0 if t <= -2e+145: tmp = (y + (a * ((y - x) / t))) + (z * t_1) elif t <= 4.1e+118: tmp = x + ((x - y) / ((a - t) / (t - z))) else: tmp = y + (t_1 * (z - a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - y) / t) tmp = 0.0 if (t <= -2e+145) tmp = Float64(Float64(y + Float64(a * Float64(Float64(y - x) / t))) + Float64(z * t_1)); elseif (t <= 4.1e+118) tmp = Float64(x + Float64(Float64(x - y) / Float64(Float64(a - t) / Float64(t - z)))); else tmp = Float64(y + Float64(t_1 * Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - y) / t; tmp = 0.0; if (t <= -2e+145) tmp = (y + (a * ((y - x) / t))) + (z * t_1); elseif (t <= 4.1e+118) tmp = x + ((x - y) / ((a - t) / (t - z))); else tmp = y + (t_1 * (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[t, -2e+145], N[(N[(y + N[(a * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.1e+118], N[(x + N[(N[(x - y), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(t$95$1 * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y}{t}\\
\mathbf{if}\;t \leq -2 \cdot 10^{+145}:\\
\;\;\;\;\left(y + a \cdot \frac{y - x}{t}\right) + z \cdot t\_1\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{+118}:\\
\;\;\;\;x + \frac{x - y}{\frac{a - t}{t - z}}\\
\mathbf{else}:\\
\;\;\;\;y + t\_1 \cdot \left(z - a\right)\\
\end{array}
\end{array}
if t < -2e145Initial program 15.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
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites89.5%
Taylor expanded in z around 0
Applied rewrites93.0%
if -2e145 < t < 4.0999999999999997e118Initial program 81.9%
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
+-commutativeN/A
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
sqr-negN/A
difference-of-squaresN/A
sub-negN/A
lift--.f64N/A
sub-negN/A
remove-double-negN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6412.9
Applied rewrites12.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--.f6490.8
Applied rewrites90.8%
Final simplification91.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ y (* (/ (- x y) t) (- z a)))))
(if (<= t -2e+145)
t_1
(if (<= t 4.1e+118) (+ x (/ (- x y) (/ (- a t) (- t z)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y + (((x - y) / t) * (z - a));
double tmp;
if (t <= -2e+145) {
tmp = t_1;
} else if (t <= 4.1e+118) {
tmp = x + ((x - y) / ((a - t) / (t - z)));
} 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 - y) / t) * (z - a))
if (t <= (-2d+145)) then
tmp = t_1
else if (t <= 4.1d+118) then
tmp = x + ((x - y) / ((a - t) / (t - z)))
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 - y) / t) * (z - a));
double tmp;
if (t <= -2e+145) {
tmp = t_1;
} else if (t <= 4.1e+118) {
tmp = x + ((x - y) / ((a - t) / (t - z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y + (((x - y) / t) * (z - a)) tmp = 0 if t <= -2e+145: tmp = t_1 elif t <= 4.1e+118: tmp = x + ((x - y) / ((a - t) / (t - z))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y + Float64(Float64(Float64(x - y) / t) * Float64(z - a))) tmp = 0.0 if (t <= -2e+145) tmp = t_1; elseif (t <= 4.1e+118) tmp = Float64(x + Float64(Float64(x - y) / Float64(Float64(a - t) / Float64(t - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y + (((x - y) / t) * (z - a)); tmp = 0.0; if (t <= -2e+145) tmp = t_1; elseif (t <= 4.1e+118) tmp = x + ((x - y) / ((a - t) / (t - z))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y + N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2e+145], t$95$1, If[LessEqual[t, 4.1e+118], N[(x + N[(N[(x - y), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \frac{x - y}{t} \cdot \left(z - a\right)\\
\mathbf{if}\;t \leq -2 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{+118}:\\
\;\;\;\;x + \frac{x - y}{\frac{a - t}{t - z}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2e145 or 4.0999999999999997e118 < t Initial program 23.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
sqr-negN/A
difference-of-squaresN/A
sub-negN/A
lift--.f64N/A
sub-negN/A
remove-double-negN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f648.9
Applied rewrites8.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--.f6491.7
Applied rewrites91.7%
if -2e145 < t < 4.0999999999999997e118Initial program 81.9%
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%
Final simplification91.9%
(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 2.4e-161)
(fma z (/ (- y x) a) x)
(if (<= t 1.15e+46) (+ x (* (- z t) (/ y 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 <= -5.8e+72) {
tmp = t_1;
} else if (t <= 2.4e-161) {
tmp = fma(z, ((y - x) / a), x);
} else if (t <= 1.15e+46) {
tmp = x + ((z - t) * (y / 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 <= -5.8e+72) tmp = t_1; elseif (t <= 2.4e-161) tmp = fma(z, Float64(Float64(y - x) / a), x); elseif (t <= 1.15e+46) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / 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, -5.8e+72], t$95$1, If[LessEqual[t, 2.4e-161], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 1.15e+46], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / 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 -5.8 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-161}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+46}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\
\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 < 2.39999999999999999e-161Initial program 85.8%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6475.7
Applied rewrites75.7%
if 2.39999999999999999e-161 < t < 1.15e46Initial program 86.3%
Taylor expanded in a around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6477.4
Applied rewrites77.4%
Taylor expanded in y around inf
Applied rewrites75.4%
(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 2.4e-161)
(fma z (/ (- y x) a) x)
(if (<= t 1.15e+46) (+ x (* (- z t) (/ y a))) 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 <= 2.4e-161) {
tmp = fma(z, ((y - x) / a), x);
} else if (t <= 1.15e+46) {
tmp = x + ((z - t) * (y / a));
} 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 <= 2.4e-161) tmp = fma(z, Float64(Float64(y - x) / a), x); elseif (t <= 1.15e+46) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / 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[(z / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -5.8e+72], t$95$1, If[LessEqual[t, 2.4e-161], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 1.15e+46], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $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 2.4 \cdot 10^{-161}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+46}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\
\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%
Taylor expanded in z around inf
Applied rewrites72.3%
if -5.80000000000000034e72 < t < 2.39999999999999999e-161Initial program 85.8%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6475.7
Applied rewrites75.7%
if 2.39999999999999999e-161 < t < 1.15e46Initial program 86.3%
Taylor expanded in a around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6477.4
Applied rewrites77.4%
Taylor expanded in y around inf
Applied rewrites75.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ y (* (/ (- x y) t) (- z a)))))
(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 + (((x - y) / t) * (z - a));
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(x - y) / t) * Float64(z - a))) 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[(x - y), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $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{x - y}{t} \cdot \left(z - a\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
+-commutativeN/A
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
sqr-negN/A
difference-of-squaresN/A
sub-negN/A
lift--.f64N/A
sub-negN/A
remove-double-negN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6414.1
Applied rewrites14.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--.f6488.2
Applied rewrites88.2%
if -3.00000000000000013e89 < t < 4.0999999999999997e118Initial program 84.5%
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 (* (/ (- x y) t) (- z a)))))
(if (<= t -2.1e+73)
t_1
(if (<= t 1.15e+46) (fma (- y x) (/ (- z t) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y + (((x - y) / t) * (z - a));
double tmp;
if (t <= -2.1e+73) {
tmp = t_1;
} else if (t <= 1.15e+46) {
tmp = fma((y - x), ((z - t) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y + Float64(Float64(Float64(x - y) / t) * Float64(z - a))) tmp = 0.0 if (t <= -2.1e+73) tmp = t_1; elseif (t <= 1.15e+46) tmp = fma(Float64(y - x), 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[(y + N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.1e+73], t$95$1, If[LessEqual[t, 1.15e+46], N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \frac{x - y}{t} \cdot \left(z - a\right)\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+46}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.1000000000000001e73 or 1.15e46 < t Initial program 33.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
sqr-negN/A
difference-of-squaresN/A
sub-negN/A
lift--.f64N/A
sub-negN/A
remove-double-negN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6421.5
Applied rewrites21.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--.f6484.8
Applied rewrites84.8%
if -2.1000000000000001e73 < t < 1.15e46Initial program 85.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
sqr-negN/A
difference-of-squaresN/A
sub-negN/A
lift--.f64N/A
sub-negN/A
remove-double-negN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6468.6
Applied rewrites68.6%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6479.1
Applied rewrites79.1%
Final simplification81.2%
(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 (- y x) (/ (- 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 <= -2.1e+73) {
tmp = t_1;
} else if (t <= 1.15e+46) {
tmp = fma((y - x), ((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 <= -2.1e+73) tmp = t_1; elseif (t <= 1.15e+46) tmp = fma(Float64(y - x), 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, -2.1e+73], t$95$1, If[LessEqual[t, 1.15e+46], N[(N[(y - x), $MachinePrecision] * 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 -2.1 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+46}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{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%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
sqr-negN/A
difference-of-squaresN/A
sub-negN/A
lift--.f64N/A
sub-negN/A
remove-double-negN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6468.6
Applied rewrites68.6%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6479.1
Applied rewrites79.1%
(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 (- x y) (/ z t) y))) (if (<= t -5.8e+72) t_1 (if (<= t 1.1e+46) (fma z (/ (- 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 / t), y);
double tmp;
if (t <= -5.8e+72) {
tmp = t_1;
} else if (t <= 1.1e+46) {
tmp = fma(z, ((y - x) / 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.1e+46) tmp = fma(z, 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[(z / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -5.8e+72], t$95$1, If[LessEqual[t, 1.1e+46], N[(z * 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}{t}, y\right)\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+46}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.80000000000000034e72 or 1.1e46 < 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%
Taylor expanded in z around inf
Applied rewrites72.3%
if -5.80000000000000034e72 < t < 1.1e46Initial program 85.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6472.6
Applied rewrites72.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- y) (/ z t) y))) (if (<= t -1.6e+75) t_1 (if (<= t 9.6e+117) (fma z (/ (- y x) a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-y, (z / t), y);
double tmp;
if (t <= -1.6e+75) {
tmp = t_1;
} else if (t <= 9.6e+117) {
tmp = fma(z, ((y - x) / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-y), Float64(z / t), y) tmp = 0.0 if (t <= -1.6e+75) tmp = t_1; elseif (t <= 9.6e+117) tmp = fma(z, 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[((-y) * N[(z / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -1.6e+75], t$95$1, If[LessEqual[t, 9.6e+117], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, \frac{z}{t}, y\right)\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.6 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.59999999999999992e75 or 9.5999999999999996e117 < t Initial program 28.4%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites83.1%
Taylor expanded in z around inf
Applied rewrites74.5%
Taylor expanded in x around 0
Applied rewrites61.8%
if -1.59999999999999992e75 < 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%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- y) (/ z t) y))) (if (<= t -8.5e+74) t_1 (if (<= t 2.2e+46) (+ x (/ (* y z) a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-y, (z / t), y);
double tmp;
if (t <= -8.5e+74) {
tmp = t_1;
} else if (t <= 2.2e+46) {
tmp = x + ((y * z) / a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-y), Float64(z / t), y) tmp = 0.0 if (t <= -8.5e+74) tmp = t_1; elseif (t <= 2.2e+46) tmp = Float64(x + Float64(Float64(y * z) / a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-y) * N[(z / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -8.5e+74], t$95$1, If[LessEqual[t, 2.2e+46], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, \frac{z}{t}, y\right)\\
\mathbf{if}\;t \leq -8.5 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{+46}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -8.50000000000000028e74 or 2.2e46 < 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%
Taylor expanded in z around inf
Applied rewrites72.3%
Taylor expanded in x around 0
Applied rewrites59.4%
if -8.50000000000000028e74 < t < 2.2e46Initial program 85.9%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6465.2
Applied rewrites65.2%
Taylor expanded in y around inf
Applied rewrites55.5%
Final simplification56.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- y) (/ z t) y))) (if (<= t -5.8e+72) t_1 (if (<= t 2e+46) (* y (/ (- z t) a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-y, (z / t), y);
double tmp;
if (t <= -5.8e+72) {
tmp = t_1;
} else if (t <= 2e+46) {
tmp = y * ((z - t) / a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(-y), Float64(z / t), y) tmp = 0.0 if (t <= -5.8e+72) tmp = t_1; elseif (t <= 2e+46) tmp = Float64(y * Float64(Float64(z - t) / a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-y) * N[(z / t), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -5.8e+72], t$95$1, If[LessEqual[t, 2e+46], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, \frac{z}{t}, y\right)\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+46}:\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.80000000000000034e72 or 2e46 < 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%
Taylor expanded in z around inf
Applied rewrites72.3%
Taylor expanded in x around 0
Applied rewrites59.4%
if -5.80000000000000034e72 < t < 2e46Initial program 85.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
sqr-negN/A
difference-of-squaresN/A
sub-negN/A
lift--.f64N/A
sub-negN/A
remove-double-negN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6468.6
Applied rewrites68.6%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6440.6
Applied rewrites40.6%
Taylor expanded in a around inf
Applied rewrites34.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* x (- z a)) t))) (if (<= x -7.8e+182) t_1 (if (<= x 7e+43) (fma (- y) (/ z t) y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * (z - a)) / t;
double tmp;
if (x <= -7.8e+182) {
tmp = t_1;
} else if (x <= 7e+43) {
tmp = fma(-y, (z / t), y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x * Float64(z - a)) / t) tmp = 0.0 if (x <= -7.8e+182) tmp = t_1; elseif (x <= 7e+43) tmp = fma(Float64(-y), Float64(z / t), y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[x, -7.8e+182], t$95$1, If[LessEqual[x, 7e+43], N[((-y) * N[(z / t), $MachinePrecision] + y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \left(z - a\right)}{t}\\
\mathbf{if}\;x \leq -7.8 \cdot 10^{+182}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+43}:\\
\;\;\;\;\mathsf{fma}\left(-y, \frac{z}{t}, y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.7999999999999998e182 or 7.0000000000000002e43 < x Initial program 55.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
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites48.0%
Taylor expanded in x around inf
Applied rewrites38.6%
if -7.7999999999999998e182 < x < 7.0000000000000002e43Initial program 71.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
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites49.7%
Taylor expanded in z around inf
Applied rewrites47.0%
Taylor expanded in x around 0
Applied rewrites43.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* z (/ (- x y) t)))) (if (<= z -1.32e+101) t_1 (if (<= z 5.5e-118) (+ x (- y x)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * ((x - y) / t);
double tmp;
if (z <= -1.32e+101) {
tmp = t_1;
} else if (z <= 5.5e-118) {
tmp = x + (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 = z * ((x - y) / t)
if (z <= (-1.32d+101)) then
tmp = t_1
else if (z <= 5.5d-118) then
tmp = x + (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 = z * ((x - y) / t);
double tmp;
if (z <= -1.32e+101) {
tmp = t_1;
} else if (z <= 5.5e-118) {
tmp = x + (y - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * ((x - y) / t) tmp = 0 if z <= -1.32e+101: tmp = t_1 elif z <= 5.5e-118: tmp = x + (y - x) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(Float64(x - y) / t)) tmp = 0.0 if (z <= -1.32e+101) tmp = t_1; elseif (z <= 5.5e-118) tmp = Float64(x + Float64(y - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * ((x - y) / t); tmp = 0.0; if (z <= -1.32e+101) tmp = t_1; elseif (z <= 5.5e-118) tmp = x + (y - x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.32e+101], t$95$1, If[LessEqual[z, 5.5e-118], N[(x + N[(y - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{x - y}{t}\\
\mathbf{if}\;z \leq -1.32 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-118}:\\
\;\;\;\;x + \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.32e101 or 5.5000000000000003e-118 < z Initial program 67.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
distribute-rgt-out--N/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites49.6%
Taylor expanded in z around inf
Applied rewrites41.7%
if -1.32e101 < z < 5.5000000000000003e-118Initial program 65.2%
Taylor expanded in t around inf
lower--.f6427.0
Applied rewrites27.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.3e+93) (* y (/ z a)) (if (<= z 6.5e+68) (+ x (- y x)) (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e+93) {
tmp = y * (z / a);
} else if (z <= 6.5e+68) {
tmp = x + (y - x);
} else {
tmp = z * (y / a);
}
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 (z <= (-1.3d+93)) then
tmp = y * (z / a)
else if (z <= 6.5d+68) then
tmp = x + (y - x)
else
tmp = z * (y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e+93) {
tmp = y * (z / a);
} else if (z <= 6.5e+68) {
tmp = x + (y - x);
} else {
tmp = z * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.3e+93: tmp = y * (z / a) elif z <= 6.5e+68: tmp = x + (y - x) else: tmp = z * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.3e+93) tmp = Float64(y * Float64(z / a)); elseif (z <= 6.5e+68) tmp = Float64(x + Float64(y - x)); else tmp = Float64(z * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.3e+93) tmp = y * (z / a); elseif (z <= 6.5e+68) tmp = x + (y - x); else tmp = z * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.3e+93], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e+68], N[(x + N[(y - x), $MachinePrecision]), $MachinePrecision], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+93}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+68}:\\
\;\;\;\;x + \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.3e93Initial program 63.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
sqr-negN/A
difference-of-squaresN/A
sub-negN/A
lift--.f64N/A
sub-negN/A
remove-double-negN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6449.5
Applied rewrites49.5%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6435.3
Applied rewrites35.3%
Taylor expanded in t around 0
Applied rewrites29.2%
Applied rewrites40.3%
if -1.3e93 < z < 6.5000000000000005e68Initial program 64.3%
Taylor expanded in t around inf
lower--.f6424.9
Applied rewrites24.9%
if 6.5000000000000005e68 < z Initial program 75.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
sqr-negN/A
difference-of-squaresN/A
sub-negN/A
lift--.f64N/A
sub-negN/A
remove-double-negN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6451.6
Applied rewrites51.6%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6448.4
Applied rewrites48.4%
Taylor expanded in t around 0
Applied rewrites32.2%
Applied rewrites37.9%
Final simplification30.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* z (/ y a)))) (if (<= z -1.05e+93) t_1 (if (<= z 6.5e+68) (+ x (- y x)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / a);
double tmp;
if (z <= -1.05e+93) {
tmp = t_1;
} else if (z <= 6.5e+68) {
tmp = x + (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 = z * (y / a)
if (z <= (-1.05d+93)) then
tmp = t_1
else if (z <= 6.5d+68) then
tmp = x + (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 = z * (y / a);
double tmp;
if (z <= -1.05e+93) {
tmp = t_1;
} else if (z <= 6.5e+68) {
tmp = x + (y - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (y / a) tmp = 0 if z <= -1.05e+93: tmp = t_1 elif z <= 6.5e+68: tmp = x + (y - x) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / a)) tmp = 0.0 if (z <= -1.05e+93) tmp = t_1; elseif (z <= 6.5e+68) tmp = Float64(x + Float64(y - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (y / a); tmp = 0.0; if (z <= -1.05e+93) tmp = t_1; elseif (z <= 6.5e+68) tmp = x + (y - x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e+93], t$95$1, If[LessEqual[z, 6.5e+68], N[(x + N[(y - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{a}\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+68}:\\
\;\;\;\;x + \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.0499999999999999e93 or 6.5000000000000005e68 < z Initial program 69.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
sqr-negN/A
difference-of-squaresN/A
sub-negN/A
lift--.f64N/A
sub-negN/A
remove-double-negN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6450.5
Applied rewrites50.5%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6441.7
Applied rewrites41.7%
Taylor expanded in t around 0
Applied rewrites30.6%
Applied rewrites38.4%
if -1.0499999999999999e93 < z < 6.5000000000000005e68Initial program 64.3%
Taylor expanded in t around inf
lower--.f6424.9
Applied rewrites24.9%
(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 (+ x (- x)))
double code(double x, double y, double z, double t, double a) {
return 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 = x + -x
end function
public static double code(double x, double y, double z, double t, double a) {
return x + -x;
}
def code(x, y, z, t, a): return x + -x
function code(x, y, z, t, a) return Float64(x + Float64(-x)) end
function tmp = code(x, y, z, t, a) tmp = x + -x; end
code[x_, y_, z_, t_, a_] := N[(x + (-x)), $MachinePrecision]
\begin{array}{l}
\\
x + \left(-x\right)
\end{array}
Initial program 66.2%
Taylor expanded in t around inf
lower--.f6417.4
Applied rewrites17.4%
Taylor expanded in y around 0
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))))