
(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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (/ y (/ (- a t) (- z t))) x))
double code(double x, double y, double z, double t, double a) {
return (y / ((a - t) / (z - t))) + 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 / ((a - t) / (z - t))) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return (y / ((a - t) / (z - t))) + x;
}
def code(x, y, z, t, a): return (y / ((a - t) / (z - t))) + x
function code(x, y, z, t, a) return Float64(Float64(y / Float64(Float64(a - t) / Float64(z - t))) + x) end
function tmp = code(x, y, z, t, a) tmp = (y / ((a - t) / (z - t))) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{\frac{a - t}{z - t}} + x
\end{array}
Initial program 85.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6498.7
Applied rewrites98.7%
Final simplification98.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- z) t) y x)) (t_2 (fma (/ y t) a (+ y x))))
(if (<= t -4e+99)
t_2
(if (<= t -2.05e-96)
t_1
(if (<= t 2e-54) (fma (/ z a) y x) (if (<= t 3200.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((-z / t), y, x);
double t_2 = fma((y / t), a, (y + x));
double tmp;
if (t <= -4e+99) {
tmp = t_2;
} else if (t <= -2.05e-96) {
tmp = t_1;
} else if (t <= 2e-54) {
tmp = fma((z / a), y, x);
} else if (t <= 3200.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(-z) / t), y, x) t_2 = fma(Float64(y / t), a, Float64(y + x)) tmp = 0.0 if (t <= -4e+99) tmp = t_2; elseif (t <= -2.05e-96) tmp = t_1; elseif (t <= 2e-54) tmp = fma(Float64(z / a), y, x); elseif (t <= 3200.0) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[((-z) / t), $MachinePrecision] * y + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / t), $MachinePrecision] * a + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4e+99], t$95$2, If[LessEqual[t, -2.05e-96], t$95$1, If[LessEqual[t, 2e-54], N[(N[(z / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t, 3200.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{-z}{t}, y, x\right)\\
t_2 := \mathsf{fma}\left(\frac{y}{t}, a, y + x\right)\\
\mathbf{if}\;t \leq -4 \cdot 10^{+99}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -2.05 \cdot 10^{-96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-54}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, x\right)\\
\mathbf{elif}\;t \leq 3200:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -3.9999999999999999e99 or 3200 < t Initial program 76.6%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6480.9
Applied rewrites80.9%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6487.2
Applied rewrites87.2%
Taylor expanded in a around 0
Applied rewrites81.9%
if -3.9999999999999999e99 < t < -2.05000000000000012e-96 or 2.0000000000000001e-54 < t < 3200Initial program 94.7%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f6479.1
Applied rewrites79.1%
Taylor expanded in t around 0
Applied rewrites76.8%
if -2.05000000000000012e-96 < t < 2.0000000000000001e-54Initial program 93.2%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6482.1
Applied rewrites82.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- z) t) y x)))
(if (<= t -4e+99)
(+ y x)
(if (<= t -2.05e-96)
t_1
(if (<= t 2e-54) (fma (/ z a) y x) (if (<= t 3200.0) t_1 (+ y x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((-z / t), y, x);
double tmp;
if (t <= -4e+99) {
tmp = y + x;
} else if (t <= -2.05e-96) {
tmp = t_1;
} else if (t <= 2e-54) {
tmp = fma((z / a), y, x);
} else if (t <= 3200.0) {
tmp = t_1;
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(-z) / t), y, x) tmp = 0.0 if (t <= -4e+99) tmp = Float64(y + x); elseif (t <= -2.05e-96) tmp = t_1; elseif (t <= 2e-54) tmp = fma(Float64(z / a), y, x); elseif (t <= 3200.0) tmp = t_1; else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[((-z) / t), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[t, -4e+99], N[(y + x), $MachinePrecision], If[LessEqual[t, -2.05e-96], t$95$1, If[LessEqual[t, 2e-54], N[(N[(z / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t, 3200.0], t$95$1, N[(y + x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{-z}{t}, y, x\right)\\
\mathbf{if}\;t \leq -4 \cdot 10^{+99}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -2.05 \cdot 10^{-96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-54}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, x\right)\\
\mathbf{elif}\;t \leq 3200:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -3.9999999999999999e99 or 3200 < t Initial program 76.6%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6480.9
Applied rewrites80.9%
if -3.9999999999999999e99 < t < -2.05000000000000012e-96 or 2.0000000000000001e-54 < t < 3200Initial program 94.7%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f6479.1
Applied rewrites79.1%
Taylor expanded in t around 0
Applied rewrites76.8%
if -2.05000000000000012e-96 < t < 2.0000000000000001e-54Initial program 93.2%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6482.1
Applied rewrites82.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ t (- t a)) x)))
(if (<= t -9.2e-97)
t_1
(if (<= t 2e-54)
(fma (/ z a) y x)
(if (<= t 1.85) (fma (/ (- z) t) y x) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (t / (t - a)), x);
double tmp;
if (t <= -9.2e-97) {
tmp = t_1;
} else if (t <= 2e-54) {
tmp = fma((z / a), y, x);
} else if (t <= 1.85) {
tmp = fma((-z / t), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(t / Float64(t - a)), x) tmp = 0.0 if (t <= -9.2e-97) tmp = t_1; elseif (t <= 2e-54) tmp = fma(Float64(z / a), y, x); elseif (t <= 1.85) tmp = fma(Float64(Float64(-z) / t), y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -9.2e-97], t$95$1, If[LessEqual[t, 2e-54], N[(N[(z / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t, 1.85], N[(N[((-z) / t), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{t}{t - a}, x\right)\\
\mathbf{if}\;t \leq -9.2 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-54}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, x\right)\\
\mathbf{elif}\;t \leq 1.85:\\
\;\;\;\;\mathsf{fma}\left(\frac{-z}{t}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.19999999999999976e-97 or 1.8500000000000001 < t Initial program 80.5%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6473.2
Applied rewrites73.2%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6482.3
Applied rewrites82.3%
if -9.19999999999999976e-97 < t < 2.0000000000000001e-54Initial program 93.2%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6482.1
Applied rewrites82.1%
if 2.0000000000000001e-54 < t < 1.8500000000000001Initial program 99.7%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f6487.0
Applied rewrites87.0%
Taylor expanded in t around 0
Applied rewrites93.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.2e+46)
(+ y x)
(if (<= t -1.82e-96)
(- x (/ (* t y) a))
(if (<= t 4.2e-39) (fma (/ z a) y x) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.2e+46) {
tmp = y + x;
} else if (t <= -1.82e-96) {
tmp = x - ((t * y) / a);
} else if (t <= 4.2e-39) {
tmp = fma((z / a), y, x);
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.2e+46) tmp = Float64(y + x); elseif (t <= -1.82e-96) tmp = Float64(x - Float64(Float64(t * y) / a)); elseif (t <= 4.2e-39) tmp = fma(Float64(z / a), y, x); else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.2e+46], N[(y + x), $MachinePrecision], If[LessEqual[t, -1.82e-96], N[(x - N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e-39], N[(N[(z / a), $MachinePrecision] * y + x), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+46}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -1.82 \cdot 10^{-96}:\\
\;\;\;\;x - \frac{t \cdot y}{a}\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-39}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -2.2e46 or 4.19999999999999987e-39 < t Initial program 78.6%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6477.4
Applied rewrites77.4%
if -2.2e46 < t < -1.82e-96Initial program 96.8%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6445.2
Applied rewrites45.2%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6466.1
Applied rewrites66.1%
Taylor expanded in a around inf
Applied rewrites64.3%
if -1.82e-96 < t < 4.19999999999999987e-39Initial program 93.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6481.8
Applied rewrites81.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- 1.0 (/ z t)) y x))) (if (<= t -0.005) t_1 (if (<= t 6.5e-38) (+ (/ (* z y) (- a t)) 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 <= -0.005) {
tmp = t_1;
} else if (t <= 6.5e-38) {
tmp = ((z * y) / (a - t)) + 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 <= -0.005) tmp = t_1; elseif (t <= 6.5e-38) tmp = Float64(Float64(Float64(z * y) / Float64(a - t)) + 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, -0.005], t$95$1, If[LessEqual[t, 6.5e-38], N[(N[(N[(z * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $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 -0.005:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-38}:\\
\;\;\;\;\frac{z \cdot y}{a - t} + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -0.0050000000000000001 or 6.49999999999999949e-38 < t Initial program 80.1%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f6489.9
Applied rewrites89.9%
if -0.0050000000000000001 < t < 6.49999999999999949e-38Initial program 94.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f6486.0
Applied rewrites86.0%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- 1.0 (/ z t)) y x))) (if (<= t -6.1e-61) t_1 (if (<= t 2e-54) (fma (/ (- z t) a) y 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.1e-61) {
tmp = t_1;
} else if (t <= 2e-54) {
tmp = fma(((z - t) / a), y, 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.1e-61) tmp = t_1; elseif (t <= 2e-54) tmp = fma(Float64(Float64(z - t) / a), y, 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.1e-61], t$95$1, If[LessEqual[t, 2e-54], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * y + 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.1 \cdot 10^{-61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-54}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.1000000000000001e-61 or 2.0000000000000001e-54 < t Initial program 81.5%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f6488.3
Applied rewrites88.3%
if -6.1000000000000001e-61 < t < 2.0000000000000001e-54Initial program 93.7%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6485.5
Applied rewrites85.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (- 1.0 (/ z t)) y x))) (if (<= t -6.1e-61) t_1 (if (<= t 1.05e-59) (fma (/ z a) y 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.1e-61) {
tmp = t_1;
} else if (t <= 1.05e-59) {
tmp = fma((z / a), y, 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.1e-61) tmp = t_1; elseif (t <= 1.05e-59) tmp = fma(Float64(z / a), y, 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.1e-61], t$95$1, If[LessEqual[t, 1.05e-59], N[(N[(z / a), $MachinePrecision] * y + 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.1 \cdot 10^{-61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-59}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.1000000000000001e-61 or 1.04999999999999998e-59 < t Initial program 81.6%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f6487.8
Applied rewrites87.8%
if -6.1000000000000001e-61 < t < 1.04999999999999998e-59Initial program 93.6%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6482.1
Applied rewrites82.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -7.5e-53) (+ y x) (if (<= t 4.2e-39) (fma (/ z a) y x) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.5e-53) {
tmp = y + x;
} else if (t <= 4.2e-39) {
tmp = fma((z / a), y, x);
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.5e-53) tmp = Float64(y + x); elseif (t <= 4.2e-39) tmp = fma(Float64(z / a), y, x); else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.5e-53], N[(y + x), $MachinePrecision], If[LessEqual[t, 4.2e-39], N[(N[(z / a), $MachinePrecision] * y + x), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-53}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-39}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -7.5000000000000001e-53 or 4.19999999999999987e-39 < t Initial program 80.8%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6473.8
Applied rewrites73.8%
if -7.5000000000000001e-53 < t < 4.19999999999999987e-39Initial program 94.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6478.6
Applied rewrites78.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -7.5e-53) (+ y x) (if (<= t 4.8e-38) (fma z (/ y a) x) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.5e-53) {
tmp = y + x;
} else if (t <= 4.8e-38) {
tmp = fma(z, (y / a), x);
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.5e-53) tmp = Float64(y + x); elseif (t <= 4.8e-38) tmp = fma(z, Float64(y / a), x); else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.5e-53], N[(y + x), $MachinePrecision], If[LessEqual[t, 4.8e-38], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-53}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-38}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -7.5000000000000001e-53 or 4.80000000000000044e-38 < t Initial program 80.8%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6473.8
Applied rewrites73.8%
if -7.5000000000000001e-53 < t < 4.80000000000000044e-38Initial program 94.1%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6427.0
Applied rewrites27.0%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6477.9
Applied rewrites77.9%
(FPCore (x y z t a) :precision binary64 (if (<= y -4e+232) (fma (/ y x) x x) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4e+232) {
tmp = fma((y / x), x, x);
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4e+232) tmp = fma(Float64(y / x), x, x); else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4e+232], N[(N[(y / x), $MachinePrecision] * x + x), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+232}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{x}, x, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if y < -4.00000000000000023e232Initial program 89.9%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6416.9
Applied rewrites16.9%
Taylor expanded in x around inf
Applied rewrites78.2%
if -4.00000000000000023e232 < y Initial program 85.7%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6457.3
Applied rewrites57.3%
(FPCore (x y z t a) :precision binary64 (fma (/ (- z t) (- a t)) y x))
double code(double x, double y, double z, double t, double a) {
return fma(((z - t) / (a - t)), y, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(z - t) / Float64(a - t)), y, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{z - t}{a - t}, y, x\right)
\end{array}
Initial program 85.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6498.6
Applied rewrites98.6%
(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 85.8%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6455.9
Applied rewrites55.9%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - 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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2024254
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- a t) (- z t)))))
(+ x (/ (* y (- z t)) (- a t))))