
(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 10 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 (if (<= z -1.75e+277) (fma (/ y (- a t)) (- z t) x) (+ x (/ y (/ (- a t) (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.75e+277) {
tmp = fma((y / (a - t)), (z - t), x);
} else {
tmp = x + (y / ((a - t) / (z - t)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.75e+277) tmp = fma(Float64(y / Float64(a - t)), Float64(z - t), x); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.75e+277], N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+277}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\
\end{array}
\end{array}
if z < -1.7500000000000001e277Initial program 80.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64100.0
Applied rewrites100.0%
if -1.7500000000000001e277 < z Initial program 83.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.4e+191)
(+ y (fma y (/ a t) x))
(if (<= t -7.5e-15)
(fma y (/ z (- t)) x)
(if (<= t 2.55e-21) (fma y (/ z a) x) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.4e+191) {
tmp = y + fma(y, (a / t), x);
} else if (t <= -7.5e-15) {
tmp = fma(y, (z / -t), x);
} else if (t <= 2.55e-21) {
tmp = fma(y, (z / a), x);
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.4e+191) tmp = Float64(y + fma(y, Float64(a / t), x)); elseif (t <= -7.5e-15) tmp = fma(y, Float64(z / Float64(-t)), x); elseif (t <= 2.55e-21) tmp = fma(y, Float64(z / a), x); else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.4e+191], N[(y + N[(y * N[(a / t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -7.5e-15], N[(y * N[(z / (-t)), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 2.55e-21], N[(y * N[(z / a), $MachinePrecision] + x), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+191}:\\
\;\;\;\;y + \mathsf{fma}\left(y, \frac{a}{t}, x\right)\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{-t}, x\right)\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-21}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -3.40000000000000009e191Initial program 45.1%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6492.1
Applied rewrites92.1%
Taylor expanded in a around 0
Applied rewrites91.8%
if -3.40000000000000009e191 < t < -7.4999999999999996e-15Initial program 88.2%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-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-/.f6484.2
Applied rewrites84.2%
Taylor expanded in z around inf
Applied rewrites78.7%
if -7.4999999999999996e-15 < t < 2.55000000000000002e-21Initial program 89.8%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6481.3
Applied rewrites81.3%
if 2.55000000000000002e-21 < t Initial program 81.6%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6485.0
Applied rewrites85.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.35e+187)
(+ y x)
(if (<= t -7.5e-15)
(fma y (/ z (- t)) x)
(if (<= t 2.55e-21) (fma y (/ z a) x) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.35e+187) {
tmp = y + x;
} else if (t <= -7.5e-15) {
tmp = fma(y, (z / -t), x);
} else if (t <= 2.55e-21) {
tmp = fma(y, (z / a), x);
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.35e+187) tmp = Float64(y + x); elseif (t <= -7.5e-15) tmp = fma(y, Float64(z / Float64(-t)), x); elseif (t <= 2.55e-21) tmp = fma(y, Float64(z / a), x); else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.35e+187], N[(y + x), $MachinePrecision], If[LessEqual[t, -7.5e-15], N[(y * N[(z / (-t)), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 2.55e-21], N[(y * N[(z / a), $MachinePrecision] + x), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{+187}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{-t}, x\right)\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-21}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.35000000000000004e187 or 2.55000000000000002e-21 < t Initial program 72.0%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6486.4
Applied rewrites86.4%
if -1.35000000000000004e187 < t < -7.4999999999999996e-15Initial program 88.2%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-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-/.f6484.2
Applied rewrites84.2%
Taylor expanded in z around inf
Applied rewrites78.7%
if -7.4999999999999996e-15 < t < 2.55000000000000002e-21Initial program 89.8%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6481.3
Applied rewrites81.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.4e+15) (fma y (- 1.0 (/ z t)) x) (if (<= t 6.6e-22) (fma y (/ (- z t) a) x) (fma (/ y (- a t)) (- t) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.4e+15) {
tmp = fma(y, (1.0 - (z / t)), x);
} else if (t <= 6.6e-22) {
tmp = fma(y, ((z - t) / a), x);
} else {
tmp = fma((y / (a - t)), -t, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.4e+15) tmp = fma(y, Float64(1.0 - Float64(z / t)), x); elseif (t <= 6.6e-22) tmp = fma(y, Float64(Float64(z - t) / a), x); else tmp = fma(Float64(y / Float64(a - t)), Float64(-t), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.4e+15], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 6.6e-22], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * (-t) + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{fma}\left(y, 1 - \frac{z}{t}, x\right)\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{-22}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - t}, -t, x\right)\\
\end{array}
\end{array}
if t < -2.4e15Initial program 67.4%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-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-/.f6491.4
Applied rewrites91.4%
if -2.4e15 < t < 6.6000000000000002e-22Initial program 90.1%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6482.3
Applied rewrites82.3%
if 6.6000000000000002e-22 < t Initial program 81.6%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6490.7
Applied rewrites90.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.4e+15) (fma y (- 1.0 (/ z t)) x) (if (<= t 2.55e-21) (fma y (/ (- z t) a) x) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.4e+15) {
tmp = fma(y, (1.0 - (z / t)), x);
} else if (t <= 2.55e-21) {
tmp = fma(y, ((z - t) / a), x);
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.4e+15) tmp = fma(y, Float64(1.0 - Float64(z / t)), x); elseif (t <= 2.55e-21) tmp = fma(y, Float64(Float64(z - t) / a), x); else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.4e+15], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 2.55e-21], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{fma}\left(y, 1 - \frac{z}{t}, x\right)\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-21}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -2.4e15Initial program 67.4%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-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-/.f6491.4
Applied rewrites91.4%
if -2.4e15 < t < 2.55000000000000002e-21Initial program 90.1%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6482.3
Applied rewrites82.3%
if 2.55000000000000002e-21 < t Initial program 81.6%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6485.0
Applied rewrites85.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -5.8e+14) (fma y (- 1.0 (/ z t)) x) (if (<= t 2.55e-21) (fma y (/ z a) x) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.8e+14) {
tmp = fma(y, (1.0 - (z / t)), x);
} else if (t <= 2.55e-21) {
tmp = fma(y, (z / a), x);
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.8e+14) tmp = fma(y, Float64(1.0 - Float64(z / t)), x); elseif (t <= 2.55e-21) tmp = fma(y, Float64(z / a), x); else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.8e+14], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 2.55e-21], N[(y * N[(z / a), $MachinePrecision] + x), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{+14}:\\
\;\;\;\;\mathsf{fma}\left(y, 1 - \frac{z}{t}, x\right)\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-21}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -5.8e14Initial program 67.4%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-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-/.f6491.4
Applied rewrites91.4%
if -5.8e14 < t < 2.55000000000000002e-21Initial program 90.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6480.5
Applied rewrites80.5%
if 2.55000000000000002e-21 < t Initial program 81.6%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6485.0
Applied rewrites85.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.02e+45) (+ y x) (if (<= t 2.55e-21) (fma y (/ z a) x) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.02e+45) {
tmp = y + x;
} else if (t <= 2.55e-21) {
tmp = fma(y, (z / a), x);
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.02e+45) tmp = Float64(y + x); elseif (t <= 2.55e-21) tmp = fma(y, Float64(z / a), x); else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.02e+45], N[(y + x), $MachinePrecision], If[LessEqual[t, 2.55e-21], N[(y * N[(z / a), $MachinePrecision] + x), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.02 \cdot 10^{+45}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-21}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.02e45 or 2.55000000000000002e-21 < t Initial program 74.1%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6482.4
Applied rewrites82.4%
if -1.02e45 < t < 2.55000000000000002e-21Initial program 90.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6479.3
Applied rewrites79.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.3e-225) (+ y x) (if (<= t 8e-190) (* z (/ y a)) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.3e-225) {
tmp = y + x;
} else if (t <= 8e-190) {
tmp = z * (y / a);
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.3d-225)) then
tmp = y + x
else if (t <= 8d-190) then
tmp = z * (y / a)
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.3e-225) {
tmp = y + x;
} else if (t <= 8e-190) {
tmp = z * (y / a);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.3e-225: tmp = y + x elif t <= 8e-190: tmp = z * (y / a) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.3e-225) tmp = Float64(y + x); elseif (t <= 8e-190) tmp = Float64(z * Float64(y / a)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.3e-225) tmp = y + x; elseif (t <= 8e-190) tmp = z * (y / a); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.3e-225], N[(y + x), $MachinePrecision], If[LessEqual[t, 8e-190], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{-225}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-190}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.30000000000000007e-225 or 8.0000000000000002e-190 < t Initial program 82.1%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6468.3
Applied rewrites68.3%
if -1.30000000000000007e-225 < t < 8.0000000000000002e-190Initial program 88.9%
lift-*.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6488.9
Applied rewrites88.9%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6458.4
Applied rewrites58.4%
Taylor expanded in a around inf
Applied rewrites54.0%
Applied rewrites54.7%
(FPCore (x y z t a) :precision binary64 (fma (/ y (- a t)) (- z t) x))
double code(double x, double y, double z, double t, double a) {
return fma((y / (a - t)), (z - t), x);
}
function code(x, y, z, t, a) return fma(Float64(y / Float64(a - t)), Float64(z - t), x) end
code[x_, y_, z_, t_, a_] := N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)
\end{array}
Initial program 83.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6496.5
Applied rewrites96.5%
(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 83.3%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6460.6
Applied rewrites60.6%
(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 2024220
(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))))