
(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 9 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 (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 86.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6497.4
Applied rewrites97.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.1e-31) (fma (- z t) (/ y a) x) (if (<= a 1.2e-60) (- x (/ (* (- z t) y) t)) (fma (/ (- z t) a) y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.1e-31) {
tmp = fma((z - t), (y / a), x);
} else if (a <= 1.2e-60) {
tmp = x - (((z - t) * y) / t);
} else {
tmp = fma(((z - t) / a), y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.1e-31) tmp = fma(Float64(z - t), Float64(y / a), x); elseif (a <= 1.2e-60) tmp = Float64(x - Float64(Float64(Float64(z - t) * y) / t)); else tmp = fma(Float64(Float64(z - t) / a), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.1e-31], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 1.2e-60], N[(x - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{-31}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{a}, x\right)\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{-60}:\\
\;\;\;\;x - \frac{\left(z - t\right) \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y, x\right)\\
\end{array}
\end{array}
if a < -1.10000000000000005e-31Initial program 83.8%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6482.1
Applied rewrites82.1%
if -1.10000000000000005e-31 < a < 1.20000000000000005e-60Initial program 87.1%
Taylor expanded in a around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6475.7
Applied rewrites75.7%
if 1.20000000000000005e-60 < a Initial program 86.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6486.8
Applied rewrites86.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4000000.0) (not (<= t 3.8e-51))) (+ y x) (fma (- z t) (/ y a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4000000.0) || !(t <= 3.8e-51)) {
tmp = y + x;
} else {
tmp = fma((z - t), (y / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4000000.0) || !(t <= 3.8e-51)) tmp = Float64(y + x); else tmp = fma(Float64(z - t), Float64(y / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4000000.0], N[Not[LessEqual[t, 3.8e-51]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4000000 \lor \neg \left(t \leq 3.8 \cdot 10^{-51}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{a}, x\right)\\
\end{array}
\end{array}
if t < -4e6 or 3.80000000000000003e-51 < t Initial program 76.8%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6475.8
Applied rewrites75.8%
if -4e6 < t < 3.80000000000000003e-51Initial program 94.2%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6483.6
Applied rewrites83.6%
Final simplification79.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1e-24) (not (<= t 3.8e-51))) (+ y x) (fma (/ z a) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1e-24) || !(t <= 3.8e-51)) {
tmp = y + x;
} else {
tmp = fma((z / a), y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1e-24) || !(t <= 3.8e-51)) tmp = Float64(y + x); else tmp = fma(Float64(z / a), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1e-24], N[Not[LessEqual[t, 3.8e-51]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-24} \lor \neg \left(t \leq 3.8 \cdot 10^{-51}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, x\right)\\
\end{array}
\end{array}
if t < -9.99999999999999924e-25 or 3.80000000000000003e-51 < t Initial program 77.3%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6474.7
Applied rewrites74.7%
if -9.99999999999999924e-25 < t < 3.80000000000000003e-51Initial program 94.7%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6484.4
Applied rewrites84.4%
Final simplification79.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3e-151)
(+ y x)
(if (<= t -3.15e-195)
(/ (* y z) a)
(if (<= t 5.4e+41) (* (- x) -1.0) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3e-151) {
tmp = y + x;
} else if (t <= -3.15e-195) {
tmp = (y * z) / a;
} else if (t <= 5.4e+41) {
tmp = -x * -1.0;
} 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 <= (-3d-151)) then
tmp = y + x
else if (t <= (-3.15d-195)) then
tmp = (y * z) / a
else if (t <= 5.4d+41) then
tmp = -x * (-1.0d0)
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 <= -3e-151) {
tmp = y + x;
} else if (t <= -3.15e-195) {
tmp = (y * z) / a;
} else if (t <= 5.4e+41) {
tmp = -x * -1.0;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3e-151: tmp = y + x elif t <= -3.15e-195: tmp = (y * z) / a elif t <= 5.4e+41: tmp = -x * -1.0 else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3e-151) tmp = Float64(y + x); elseif (t <= -3.15e-195) tmp = Float64(Float64(y * z) / a); elseif (t <= 5.4e+41) tmp = Float64(Float64(-x) * -1.0); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3e-151) tmp = y + x; elseif (t <= -3.15e-195) tmp = (y * z) / a; elseif (t <= 5.4e+41) tmp = -x * -1.0; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3e-151], N[(y + x), $MachinePrecision], If[LessEqual[t, -3.15e-195], N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t, 5.4e+41], N[((-x) * -1.0), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{-151}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -3.15 \cdot 10^{-195}:\\
\;\;\;\;\frac{y \cdot z}{a}\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{+41}:\\
\;\;\;\;\left(-x\right) \cdot -1\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -3e-151 or 5.39999999999999999e41 < t Initial program 76.9%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6474.6
Applied rewrites74.6%
if -3e-151 < t < -3.15e-195Initial program 99.9%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6488.2
Applied rewrites88.2%
Taylor expanded in z around inf
Applied rewrites68.0%
Applied rewrites68.1%
if -3.15e-195 < t < 5.39999999999999999e41Initial program 95.6%
Taylor expanded in x around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
Applied rewrites90.2%
Taylor expanded in x around inf
Applied rewrites55.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4e-151)
(+ y x)
(if (<= t -3.15e-195)
(* (/ z a) y)
(if (<= t 5.4e+41) (* (- x) -1.0) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4e-151) {
tmp = y + x;
} else if (t <= -3.15e-195) {
tmp = (z / a) * y;
} else if (t <= 5.4e+41) {
tmp = -x * -1.0;
} 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 <= (-4d-151)) then
tmp = y + x
else if (t <= (-3.15d-195)) then
tmp = (z / a) * y
else if (t <= 5.4d+41) then
tmp = -x * (-1.0d0)
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 <= -4e-151) {
tmp = y + x;
} else if (t <= -3.15e-195) {
tmp = (z / a) * y;
} else if (t <= 5.4e+41) {
tmp = -x * -1.0;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4e-151: tmp = y + x elif t <= -3.15e-195: tmp = (z / a) * y elif t <= 5.4e+41: tmp = -x * -1.0 else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4e-151) tmp = Float64(y + x); elseif (t <= -3.15e-195) tmp = Float64(Float64(z / a) * y); elseif (t <= 5.4e+41) tmp = Float64(Float64(-x) * -1.0); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4e-151) tmp = y + x; elseif (t <= -3.15e-195) tmp = (z / a) * y; elseif (t <= 5.4e+41) tmp = -x * -1.0; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4e-151], N[(y + x), $MachinePrecision], If[LessEqual[t, -3.15e-195], N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 5.4e+41], N[((-x) * -1.0), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-151}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -3.15 \cdot 10^{-195}:\\
\;\;\;\;\frac{z}{a} \cdot y\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{+41}:\\
\;\;\;\;\left(-x\right) \cdot -1\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -3.9999999999999998e-151 or 5.39999999999999999e41 < t Initial program 76.9%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6474.6
Applied rewrites74.6%
if -3.9999999999999998e-151 < t < -3.15e-195Initial program 99.9%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6488.2
Applied rewrites88.2%
Taylor expanded in z around inf
Applied rewrites68.0%
if -3.15e-195 < t < 5.39999999999999999e41Initial program 95.6%
Taylor expanded in x around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
Applied rewrites90.2%
Taylor expanded in x around inf
Applied rewrites55.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4e-151)
(+ y x)
(if (<= t -1.38e-191)
(* z (/ y a))
(if (<= t 5.4e+41) (* (- x) -1.0) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4e-151) {
tmp = y + x;
} else if (t <= -1.38e-191) {
tmp = z * (y / a);
} else if (t <= 5.4e+41) {
tmp = -x * -1.0;
} 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 <= (-4d-151)) then
tmp = y + x
else if (t <= (-1.38d-191)) then
tmp = z * (y / a)
else if (t <= 5.4d+41) then
tmp = -x * (-1.0d0)
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 <= -4e-151) {
tmp = y + x;
} else if (t <= -1.38e-191) {
tmp = z * (y / a);
} else if (t <= 5.4e+41) {
tmp = -x * -1.0;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4e-151: tmp = y + x elif t <= -1.38e-191: tmp = z * (y / a) elif t <= 5.4e+41: tmp = -x * -1.0 else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4e-151) tmp = Float64(y + x); elseif (t <= -1.38e-191) tmp = Float64(z * Float64(y / a)); elseif (t <= 5.4e+41) tmp = Float64(Float64(-x) * -1.0); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4e-151) tmp = y + x; elseif (t <= -1.38e-191) tmp = z * (y / a); elseif (t <= 5.4e+41) tmp = -x * -1.0; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4e-151], N[(y + x), $MachinePrecision], If[LessEqual[t, -1.38e-191], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.4e+41], N[((-x) * -1.0), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-151}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -1.38 \cdot 10^{-191}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{+41}:\\
\;\;\;\;\left(-x\right) \cdot -1\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -3.9999999999999998e-151 or 5.39999999999999999e41 < t Initial program 76.9%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6474.6
Applied rewrites74.6%
if -3.9999999999999998e-151 < t < -1.38000000000000003e-191Initial program 99.9%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6488.2
Applied rewrites88.2%
Taylor expanded in z around inf
Applied rewrites68.0%
Applied rewrites67.8%
if -1.38000000000000003e-191 < t < 5.39999999999999999e41Initial program 95.6%
Taylor expanded in x around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
Applied rewrites90.2%
Taylor expanded in x around inf
Applied rewrites55.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.9e-65) (not (<= t 5.4e+41))) (+ y x) (* (- x) -1.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.9e-65) || !(t <= 5.4e+41)) {
tmp = y + x;
} else {
tmp = -x * -1.0;
}
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 <= (-2.9d-65)) .or. (.not. (t <= 5.4d+41))) then
tmp = y + x
else
tmp = -x * (-1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.9e-65) || !(t <= 5.4e+41)) {
tmp = y + x;
} else {
tmp = -x * -1.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.9e-65) or not (t <= 5.4e+41): tmp = y + x else: tmp = -x * -1.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.9e-65) || !(t <= 5.4e+41)) tmp = Float64(y + x); else tmp = Float64(Float64(-x) * -1.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.9e-65) || ~((t <= 5.4e+41))) tmp = y + x; else tmp = -x * -1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.9e-65], N[Not[LessEqual[t, 5.4e+41]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[((-x) * -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{-65} \lor \neg \left(t \leq 5.4 \cdot 10^{+41}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\left(-x\right) \cdot -1\\
\end{array}
\end{array}
if t < -2.8999999999999998e-65 or 5.39999999999999999e41 < t Initial program 74.9%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6478.1
Applied rewrites78.1%
if -2.8999999999999998e-65 < t < 5.39999999999999999e41Initial program 95.1%
Taylor expanded in x around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
Applied rewrites89.5%
Taylor expanded in x around inf
Applied rewrites53.3%
Final simplification64.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 86.0%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6456.7
Applied rewrites56.7%
(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 2024326
(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))))