
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((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 * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((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 * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (- x (/ y (/ (- a t) (- t z)))))
double code(double x, double y, double z, double t, double a) {
return x - (y / ((a - t) / (t - z)));
}
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 / ((a - t) / (t - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y / ((a - t) / (t - z)));
}
def code(x, y, z, t, a): return x - (y / ((a - t) / (t - z)))
function code(x, y, z, t, a) return Float64(x - Float64(y / Float64(Float64(a - t) / Float64(t - z)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y / ((a - t) / (t - z))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y}{\frac{a - t}{t - z}}
\end{array}
Initial program 98.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6498.2
Applied rewrites98.2%
Final simplification98.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- t a))) (t_2 (+ (* (/ z (- a t)) y) x)))
(if (<= t_1 -1.0)
t_2
(if (<= t_1 4e-17)
(fma (/ (- z t) a) y x)
(if (<= t_1 1.0) (+ (* (- 1.0 (/ (- z a) t)) y) x) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (t - a);
double t_2 = ((z / (a - t)) * y) + x;
double tmp;
if (t_1 <= -1.0) {
tmp = t_2;
} else if (t_1 <= 4e-17) {
tmp = fma(((z - t) / a), y, x);
} else if (t_1 <= 1.0) {
tmp = ((1.0 - ((z - a) / t)) * y) + x;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(t - a)) t_2 = Float64(Float64(Float64(z / Float64(a - t)) * y) + x) tmp = 0.0 if (t_1 <= -1.0) tmp = t_2; elseif (t_1 <= 4e-17) tmp = fma(Float64(Float64(z - t) / a), y, x); elseif (t_1 <= 1.0) tmp = Float64(Float64(Float64(1.0 - Float64(Float64(z - a) / t)) * y) + x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$1, -1.0], t$95$2, If[LessEqual[t$95$1, 4e-17], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 1.0], N[(N[(N[(1.0 - N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{t - a}\\
t_2 := \frac{z}{a - t} \cdot y + x\\
\mathbf{if}\;t\_1 \leq -1:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;\left(1 - \frac{z - a}{t}\right) \cdot y + x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -1 or 1 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 94.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
if -1 < (/.f64 (-.f64 z t) (-.f64 a t)) < 4.00000000000000029e-17Initial program 98.8%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6497.7
Applied rewrites97.7%
if 4.00000000000000029e-17 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1Initial program 100.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
lower-/.f64N/A
lower--.f64100.0
Applied rewrites100.0%
Final simplification97.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- t a))) (t_2 (+ (* (/ z (- a t)) y) x)))
(if (<= t_1 -1.0)
t_2
(if (<= t_1 4e-17)
(fma (/ (- z t) a) y x)
(if (<= t_1 1.0) (fma (- 1.0 (/ z t)) y x) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (t - a);
double t_2 = ((z / (a - t)) * y) + x;
double tmp;
if (t_1 <= -1.0) {
tmp = t_2;
} else if (t_1 <= 4e-17) {
tmp = fma(((z - t) / a), y, x);
} else if (t_1 <= 1.0) {
tmp = fma((1.0 - (z / t)), y, x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(t - a)) t_2 = Float64(Float64(Float64(z / Float64(a - t)) * y) + x) tmp = 0.0 if (t_1 <= -1.0) tmp = t_2; elseif (t_1 <= 4e-17) tmp = fma(Float64(Float64(z - t) / a), y, x); elseif (t_1 <= 1.0) tmp = fma(Float64(1.0 - Float64(z / t)), y, x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$1, -1.0], t$95$2, If[LessEqual[t$95$1, 4e-17], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 1.0], N[(N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{t - a}\\
t_2 := \frac{z}{a - t} \cdot y + x\\
\mathbf{if}\;t\_1 \leq -1:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;\mathsf{fma}\left(1 - \frac{z}{t}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -1 or 1 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 94.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6493.3
Applied rewrites93.3%
if -1 < (/.f64 (-.f64 z t) (-.f64 a t)) < 4.00000000000000029e-17Initial program 98.8%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6497.7
Applied rewrites97.7%
if 4.00000000000000029e-17 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1Initial program 100.0%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites99.9%
Applied rewrites99.9%
Final simplification97.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- t a))))
(if (<= t_1 -2e+54)
(* (/ y (- a t)) z)
(if (<= t_1 4e-17)
(fma (/ (- z t) a) y x)
(if (<= t_1 1.0) (fma (- 1.0 (/ z t)) y x) (fma z (/ y a) x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (t - a);
double tmp;
if (t_1 <= -2e+54) {
tmp = (y / (a - t)) * z;
} else if (t_1 <= 4e-17) {
tmp = fma(((z - t) / a), y, x);
} else if (t_1 <= 1.0) {
tmp = fma((1.0 - (z / t)), y, x);
} else {
tmp = fma(z, (y / a), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(t - a)) tmp = 0.0 if (t_1 <= -2e+54) tmp = Float64(Float64(y / Float64(a - t)) * z); elseif (t_1 <= 4e-17) tmp = fma(Float64(Float64(z - t) / a), y, x); elseif (t_1 <= 1.0) tmp = fma(Float64(1.0 - Float64(z / t)), y, x); else tmp = fma(z, Float64(y / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+54], N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t$95$1, 4e-17], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 1.0], N[(N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{t - a}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+54}:\\
\;\;\;\;\frac{y}{a - t} \cdot z\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;\mathsf{fma}\left(1 - \frac{z}{t}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -2.0000000000000002e54Initial program 95.5%
Taylor expanded in z around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6491.2
Applied rewrites91.2%
if -2.0000000000000002e54 < (/.f64 (-.f64 z t) (-.f64 a t)) < 4.00000000000000029e-17Initial program 98.9%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6494.7
Applied rewrites94.7%
if 4.00000000000000029e-17 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1Initial program 100.0%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites99.9%
Applied rewrites99.9%
if 1 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 92.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6493.6
Applied rewrites93.6%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6473.5
Applied rewrites73.5%
Final simplification92.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- t a))))
(if (<= t_1 -2e+54)
(* (/ y (- a t)) z)
(if (<= t_1 4e-17)
(fma (/ z a) y x)
(if (<= t_1 1.0) (+ y x) (fma z (/ y a) x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (t - a);
double tmp;
if (t_1 <= -2e+54) {
tmp = (y / (a - t)) * z;
} else if (t_1 <= 4e-17) {
tmp = fma((z / a), y, x);
} else if (t_1 <= 1.0) {
tmp = y + x;
} else {
tmp = fma(z, (y / a), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(t - a)) tmp = 0.0 if (t_1 <= -2e+54) tmp = Float64(Float64(y / Float64(a - t)) * z); elseif (t_1 <= 4e-17) tmp = fma(Float64(z / a), y, x); elseif (t_1 <= 1.0) tmp = Float64(y + x); else tmp = fma(z, Float64(y / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+54], N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t$95$1, 4e-17], N[(N[(z / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 1.0], N[(y + x), $MachinePrecision], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{t - a}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+54}:\\
\;\;\;\;\frac{y}{a - t} \cdot z\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -2.0000000000000002e54Initial program 95.5%
Taylor expanded in z around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6491.2
Applied rewrites91.2%
if -2.0000000000000002e54 < (/.f64 (-.f64 z t) (-.f64 a t)) < 4.00000000000000029e-17Initial program 98.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6486.2
Applied rewrites86.2%
if 4.00000000000000029e-17 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1Initial program 100.0%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6499.6
Applied rewrites99.6%
if 1 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 92.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6493.6
Applied rewrites93.6%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6473.5
Applied rewrites73.5%
Final simplification89.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- t a))))
(if (<= t_1 -2e+54)
(* (/ z (- a t)) y)
(if (<= t_1 4e-17)
(fma (/ z a) y x)
(if (<= t_1 1.0) (+ y x) (fma z (/ y a) x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (t - a);
double tmp;
if (t_1 <= -2e+54) {
tmp = (z / (a - t)) * y;
} else if (t_1 <= 4e-17) {
tmp = fma((z / a), y, x);
} else if (t_1 <= 1.0) {
tmp = y + x;
} else {
tmp = fma(z, (y / a), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(t - a)) tmp = 0.0 if (t_1 <= -2e+54) tmp = Float64(Float64(z / Float64(a - t)) * y); elseif (t_1 <= 4e-17) tmp = fma(Float64(z / a), y, x); elseif (t_1 <= 1.0) tmp = Float64(y + x); else tmp = fma(z, Float64(y / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+54], N[(N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 4e-17], N[(N[(z / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 1.0], N[(y + x), $MachinePrecision], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{t - a}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+54}:\\
\;\;\;\;\frac{z}{a - t} \cdot y\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -2.0000000000000002e54Initial program 95.5%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6491.2
Applied rewrites91.2%
Taylor expanded in t around 0
Applied rewrites37.1%
Applied rewrites37.1%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6486.8
Applied rewrites86.8%
if -2.0000000000000002e54 < (/.f64 (-.f64 z t) (-.f64 a t)) < 4.00000000000000029e-17Initial program 98.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6486.2
Applied rewrites86.2%
if 4.00000000000000029e-17 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1Initial program 100.0%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6499.6
Applied rewrites99.6%
if 1 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 92.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6493.6
Applied rewrites93.6%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6473.5
Applied rewrites73.5%
Final simplification89.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- t a))))
(if (<= t_1 -2e+54)
(* (/ y (- t)) z)
(if (<= t_1 4e-17)
(fma (/ z a) y x)
(if (<= t_1 1.0) (+ y x) (fma z (/ y a) x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (t - a);
double tmp;
if (t_1 <= -2e+54) {
tmp = (y / -t) * z;
} else if (t_1 <= 4e-17) {
tmp = fma((z / a), y, x);
} else if (t_1 <= 1.0) {
tmp = y + x;
} else {
tmp = fma(z, (y / a), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(t - a)) tmp = 0.0 if (t_1 <= -2e+54) tmp = Float64(Float64(y / Float64(-t)) * z); elseif (t_1 <= 4e-17) tmp = fma(Float64(z / a), y, x); elseif (t_1 <= 1.0) tmp = Float64(y + x); else tmp = fma(z, Float64(y / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+54], N[(N[(y / (-t)), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t$95$1, 4e-17], N[(N[(z / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 1.0], N[(y + x), $MachinePrecision], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{t - a}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+54}:\\
\;\;\;\;\frac{y}{-t} \cdot z\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -2.0000000000000002e54Initial program 95.5%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites73.4%
Taylor expanded in t around 0
Applied rewrites69.1%
if -2.0000000000000002e54 < (/.f64 (-.f64 z t) (-.f64 a t)) < 4.00000000000000029e-17Initial program 98.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6486.2
Applied rewrites86.2%
if 4.00000000000000029e-17 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1Initial program 100.0%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6499.6
Applied rewrites99.6%
if 1 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 92.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6493.6
Applied rewrites93.6%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6473.5
Applied rewrites73.5%
Final simplification87.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ z a) y)) (t_2 (- x (* (/ (- t z) (- a t)) y)))) (if (<= t_2 (- INFINITY)) t_1 (if (<= t_2 2e+306) (+ y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z / a) * y;
double t_2 = x - (((t - z) / (a - t)) * y);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 2e+306) {
tmp = y + x;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z / a) * y;
double t_2 = x - (((t - z) / (a - t)) * y);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= 2e+306) {
tmp = y + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z / a) * y t_2 = x - (((t - z) / (a - t)) * y) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= 2e+306: tmp = y + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z / a) * y) t_2 = Float64(x - Float64(Float64(Float64(t - z) / Float64(a - t)) * y)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= 2e+306) tmp = Float64(y + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z / a) * y; t_2 = x - (((t - z) / (a - t)) * y); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= 2e+306) tmp = y + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 2e+306], N[(y + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{a} \cdot y\\
t_2 := x - \frac{t - z}{a - t} \cdot y\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t)))) < -inf.0 or 2.00000000000000003e306 < (+.f64 x (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t)))) Initial program 80.4%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in t around 0
Applied rewrites68.7%
Applied rewrites58.9%
if -inf.0 < (+.f64 x (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t)))) < 2.00000000000000003e306Initial program 99.5%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6469.6
Applied rewrites69.6%
Final simplification68.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- t z) (- t a)) y)))
(if (<= t_1 (- INFINITY))
(/ (* z y) a)
(if (<= t_1 1e+297) (+ y x) (* (/ y a) z)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((t - z) / (t - a)) * y;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (z * y) / a;
} else if (t_1 <= 1e+297) {
tmp = y + x;
} else {
tmp = (y / a) * z;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((t - z) / (t - a)) * y;
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (z * y) / a;
} else if (t_1 <= 1e+297) {
tmp = y + x;
} else {
tmp = (y / a) * z;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((t - z) / (t - a)) * y tmp = 0 if t_1 <= -math.inf: tmp = (z * y) / a elif t_1 <= 1e+297: tmp = y + x else: tmp = (y / a) * z return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(t - z) / Float64(t - a)) * y) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(z * y) / a); elseif (t_1 <= 1e+297) tmp = Float64(y + x); else tmp = Float64(Float64(y / a) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((t - z) / (t - a)) * y; tmp = 0.0; if (t_1 <= -Inf) tmp = (z * y) / a; elseif (t_1 <= 1e+297) tmp = y + x; else tmp = (y / a) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$1, 1e+297], N[(y + x), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{t - a} \cdot y\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{z \cdot y}{a}\\
\mathbf{elif}\;t\_1 \leq 10^{+297}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot z\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) < -inf.0Initial program 77.1%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in t around 0
Applied rewrites75.0%
if -inf.0 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) < 1e297Initial program 99.5%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6469.6
Applied rewrites69.6%
if 1e297 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) Initial program 82.8%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6499.9
Applied rewrites99.9%
Taylor expanded in t around 0
Applied rewrites64.1%
Applied rewrites64.1%
Final simplification69.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ y a) z)) (t_2 (* (/ (- t z) (- t a)) y))) (if (<= t_2 (- INFINITY)) t_1 (if (<= t_2 1e+297) (+ y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / a) * z;
double t_2 = ((t - z) / (t - a)) * y;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 1e+297) {
tmp = y + x;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y / a) * z;
double t_2 = ((t - z) / (t - a)) * y;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= 1e+297) {
tmp = y + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / a) * z t_2 = ((t - z) / (t - a)) * y tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= 1e+297: tmp = y + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / a) * z) t_2 = Float64(Float64(Float64(t - z) / Float64(t - a)) * y) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= 1e+297) tmp = Float64(y + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / a) * z; t_2 = ((t - z) / (t - a)) * y; tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= 1e+297) tmp = y + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 1e+297], N[(y + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot z\\
t_2 := \frac{t - z}{t - a} \cdot y\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+297}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) < -inf.0 or 1e297 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) Initial program 80.4%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in t around 0
Applied rewrites68.7%
Applied rewrites68.6%
if -inf.0 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) < 1e297Initial program 99.5%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6469.6
Applied rewrites69.6%
Final simplification69.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- t a))))
(if (<= t_1 4e-17)
(fma (/ z a) y x)
(if (<= t_1 1.0) (+ y x) (fma z (/ y a) x)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (t - a);
double tmp;
if (t_1 <= 4e-17) {
tmp = fma((z / a), y, x);
} else if (t_1 <= 1.0) {
tmp = y + x;
} else {
tmp = fma(z, (y / a), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(t - a)) tmp = 0.0 if (t_1 <= 4e-17) tmp = fma(Float64(z / a), y, x); elseif (t_1 <= 1.0) tmp = Float64(y + x); else tmp = fma(z, Float64(y / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 4e-17], N[(N[(z / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 1.0], N[(y + x), $MachinePrecision], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{t - a}\\
\mathbf{if}\;t\_1 \leq 4 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < 4.00000000000000029e-17Initial program 98.3%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6479.1
Applied rewrites79.1%
if 4.00000000000000029e-17 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1Initial program 100.0%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6499.6
Applied rewrites99.6%
if 1 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 92.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6493.6
Applied rewrites93.6%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6473.5
Applied rewrites73.5%
Final simplification85.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- t z) (- t a))) (t_2 (fma (/ z a) y x))) (if (<= t_1 4e-17) t_2 (if (<= t_1 1.0) (+ y x) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (t - a);
double t_2 = fma((z / a), y, x);
double tmp;
if (t_1 <= 4e-17) {
tmp = t_2;
} else if (t_1 <= 1.0) {
tmp = y + x;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(t - a)) t_2 = fma(Float64(z / a), y, x) tmp = 0.0 if (t_1 <= 4e-17) tmp = t_2; elseif (t_1 <= 1.0) tmp = Float64(y + x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z / a), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[t$95$1, 4e-17], t$95$2, If[LessEqual[t$95$1, 1.0], N[(y + x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{t - a}\\
t_2 := \mathsf{fma}\left(\frac{z}{a}, y, x\right)\\
\mathbf{if}\;t\_1 \leq 4 \cdot 10^{-17}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < 4.00000000000000029e-17 or 1 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 97.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6476.1
Applied rewrites76.1%
if 4.00000000000000029e-17 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1Initial program 100.0%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6499.6
Applied rewrites99.6%
Final simplification84.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- 1.0 (/ z t)) y x))) (if (<= t -6.5e-17) t_1 (if (<= t 2.1e-59) (fma z (/ y a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((1.0 - (z / t)), y, x);
double tmp;
if (t <= -6.5e-17) {
tmp = t_1;
} else if (t <= 2.1e-59) {
tmp = fma(z, (y / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(1.0 - Float64(z / t)), y, x) tmp = 0.0 if (t <= -6.5e-17) tmp = t_1; elseif (t <= 2.1e-59) 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[(N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[t, -6.5e-17], t$95$1, If[LessEqual[t, 2.1e-59], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - \frac{z}{t}, y, x\right)\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-59}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.4999999999999996e-17 or 2.09999999999999997e-59 < t Initial program 99.9%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites88.6%
Applied rewrites88.7%
if -6.4999999999999996e-17 < t < 2.09999999999999997e-59Initial program 95.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6495.9
Applied rewrites95.9%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6487.8
Applied rewrites87.8%
(FPCore (x y z t a) :precision binary64 (- x (* (/ (- t z) (- a t)) y)))
double code(double x, double y, double z, double t, double a) {
return x - (((t - z) / (a - t)) * y);
}
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 - (((t - z) / (a - t)) * y)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (((t - z) / (a - t)) * y);
}
def code(x, y, z, t, a): return x - (((t - z) / (a - t)) * y)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(Float64(t - z) / Float64(a - t)) * y)) end
function tmp = code(x, y, z, t, a) tmp = x - (((t - z) / (a - t)) * y); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{t - z}{a - t} \cdot y
\end{array}
Initial program 98.0%
Final simplification98.0%
(FPCore (x y z t a) :precision binary64 (+ y x))
double code(double x, double y, double z, double t, double a) {
return 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 = y + x
end function
public static double code(double x, double y, double z, double t, double a) {
return y + x;
}
def code(x, y, z, t, a): return y + x
function code(x, y, z, t, a) return Float64(y + x) end
function tmp = code(x, y, z, t, a) tmp = y + x; end
code[x_, y_, z_, t_, a_] := N[(y + x), $MachinePrecision]
\begin{array}{l}
\\
y + x
\end{array}
Initial program 98.0%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6464.7
Applied rewrites64.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y * ((z - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024276
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (if (< y -8508084860551241/100000000000000000000000000000000) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t)))))))
(+ x (* y (/ (- z t) (- a t)))))