
(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
(let* ((t_1 (/ (* y (- z t)) (- a t))))
(if (<= t_1 (- INFINITY))
(/ (- z t) (/ (- a t) y))
(if (<= t_1 1e+295) (+ x t_1) (* (/ y (- a t)) (- z t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (a - t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (z - t) / ((a - t) / y);
} else if (t_1 <= 1e+295) {
tmp = x + t_1;
} else {
tmp = (y / (a - t)) * (z - t);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (a - t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (z - t) / ((a - t) / y);
} else if (t_1 <= 1e+295) {
tmp = x + t_1;
} else {
tmp = (y / (a - t)) * (z - t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (a - t) tmp = 0 if t_1 <= -math.inf: tmp = (z - t) / ((a - t) / y) elif t_1 <= 1e+295: tmp = x + t_1 else: tmp = (y / (a - t)) * (z - t) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(a - t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(z - t) / Float64(Float64(a - t) / y)); elseif (t_1 <= 1e+295) tmp = Float64(x + t_1); else tmp = Float64(Float64(y / Float64(a - t)) * Float64(z - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (a - t); tmp = 0.0; if (t_1 <= -Inf) tmp = (z - t) / ((a - t) / y); elseif (t_1 <= 1e+295) tmp = x + t_1; else tmp = (y / (a - t)) * (z - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(z - t), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+295], N[(x + t$95$1), $MachinePrecision], N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{z - t}{\frac{a - t}{y}}\\
\mathbf{elif}\;t\_1 \leq 10^{+295}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - t} \cdot \left(z - t\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -inf.0Initial program 19.6%
Taylor expanded in x around 0
associate-/l*N/A
div-subN/A
distribute-lft-out--N/A
associate-/l*N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
associate-*l/N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6481.9
Applied rewrites81.9%
Applied rewrites82.1%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 9.9999999999999998e294Initial program 99.4%
if 9.9999999999999998e294 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 51.6%
Taylor expanded in x around 0
associate-/l*N/A
div-subN/A
distribute-lft-out--N/A
associate-/l*N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
associate-*l/N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6490.2
Applied rewrites90.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- a t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+295)))
(* (/ y (- a t)) (- z t))
(+ x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (a - t);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+295)) {
tmp = (y / (a - t)) * (z - t);
} else {
tmp = x + t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (a - t);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+295)) {
tmp = (y / (a - t)) * (z - t);
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (a - t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+295): tmp = (y / (a - t)) * (z - t) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(a - t)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+295)) tmp = Float64(Float64(y / Float64(a - t)) * Float64(z - t)); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (a - t); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 1e+295))) tmp = (y / (a - t)) * (z - t); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+295]], $MachinePrecision]], N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+295}\right):\\
\;\;\;\;\frac{y}{a - t} \cdot \left(z - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -inf.0 or 9.9999999999999998e294 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 37.0%
Taylor expanded in x around 0
associate-/l*N/A
div-subN/A
distribute-lft-out--N/A
associate-/l*N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
associate-*l/N/A
*-commutativeN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6486.4
Applied rewrites86.4%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 9.9999999999999998e294Initial program 99.4%
Final simplification95.7%
(FPCore (x y z t a) :precision binary64 (if (<= (/ (* y (- z t)) (- a t)) 5e+230) (+ y x) (* (/ y a) z)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((y * (z - t)) / (a - t)) <= 5e+230) {
tmp = y + x;
} else {
tmp = (y / a) * z;
}
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 (((y * (z - t)) / (a - t)) <= 5d+230) then
tmp = y + x
else
tmp = (y / a) * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((y * (z - t)) / (a - t)) <= 5e+230) {
tmp = y + x;
} else {
tmp = (y / a) * z;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((y * (z - t)) / (a - t)) <= 5e+230: tmp = y + x else: tmp = (y / a) * z return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(y * Float64(z - t)) / Float64(a - t)) <= 5e+230) tmp = Float64(y + x); else tmp = Float64(Float64(y / a) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((y * (z - t)) / (a - t)) <= 5e+230) tmp = y + x; else tmp = (y / a) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], 5e+230], N[(y + x), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq 5 \cdot 10^{+230}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot z\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 5.0000000000000003e230Initial program 87.0%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6471.2
Applied rewrites71.2%
if 5.0000000000000003e230 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 56.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6446.0
Applied rewrites46.0%
Taylor expanded in x around 0
Applied rewrites36.7%
Applied rewrites45.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.2e+47) (not (<= a 5.7e+76))) (fma y (/ (- z t) a) x) (fma (- 1.0 (/ z t)) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.2e+47) || !(a <= 5.7e+76)) {
tmp = fma(y, ((z - t) / a), x);
} else {
tmp = fma((1.0 - (z / t)), y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.2e+47) || !(a <= 5.7e+76)) tmp = fma(y, Float64(Float64(z - t) / a), x); else tmp = fma(Float64(1.0 - Float64(z / t)), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.2e+47], N[Not[LessEqual[a, 5.7e+76]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{+47} \lor \neg \left(a \leq 5.7 \cdot 10^{+76}\right):\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - \frac{z}{t}, y, x\right)\\
\end{array}
\end{array}
if a < -3.2e47 or 5.70000000000000004e76 < a Initial program 81.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6482.8
Applied rewrites82.8%
Taylor expanded in a around inf
Applied rewrites91.6%
if -3.2e47 < a < 5.70000000000000004e76Initial program 82.2%
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-/.f6485.6
Applied rewrites85.6%
Final simplification88.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.15e+51) (not (<= t 3.4e-29))) (+ y x) (fma y (/ (- z t) a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.15e+51) || !(t <= 3.4e-29)) {
tmp = y + x;
} else {
tmp = fma(y, ((z - t) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.15e+51) || !(t <= 3.4e-29)) tmp = Float64(y + x); else tmp = fma(y, Float64(Float64(z - t) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.15e+51], N[Not[LessEqual[t, 3.4e-29]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.15 \cdot 10^{+51} \lor \neg \left(t \leq 3.4 \cdot 10^{-29}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\end{array}
\end{array}
if t < -2.1499999999999999e51 or 3.39999999999999972e-29 < t Initial program 72.1%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6481.5
Applied rewrites81.5%
if -2.1499999999999999e51 < t < 3.39999999999999972e-29Initial program 91.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6488.5
Applied rewrites88.5%
Taylor expanded in a around inf
Applied rewrites77.1%
Final simplification79.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.2e+47) (fma y (/ (- z t) a) x) (if (<= a 5.7e+76) (fma (- 1.0 (/ z t)) y x) (fma (- z t) (/ y a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.2e+47) {
tmp = fma(y, ((z - t) / a), x);
} else if (a <= 5.7e+76) {
tmp = fma((1.0 - (z / t)), y, x);
} else {
tmp = fma((z - t), (y / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.2e+47) tmp = fma(y, Float64(Float64(z - t) / a), x); elseif (a <= 5.7e+76) tmp = fma(Float64(1.0 - Float64(z / t)), y, x); else tmp = fma(Float64(z - t), Float64(y / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.2e+47], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 5.7e+76], N[(N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{+47}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\mathbf{elif}\;a \leq 5.7 \cdot 10^{+76}:\\
\;\;\;\;\mathsf{fma}\left(1 - \frac{z}{t}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{a}, x\right)\\
\end{array}
\end{array}
if a < -3.2e47Initial program 86.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6486.5
Applied rewrites86.5%
Taylor expanded in a around inf
Applied rewrites90.2%
if -3.2e47 < a < 5.70000000000000004e76Initial program 82.2%
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-/.f6485.6
Applied rewrites85.6%
if 5.70000000000000004e76 < a Initial program 74.0%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6493.5
Applied rewrites93.5%
Final simplification88.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.15e+51) (not (<= t 1.75e-36))) (+ y x) (fma z (/ y a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.15e+51) || !(t <= 1.75e-36)) {
tmp = y + x;
} else {
tmp = fma(z, (y / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.15e+51) || !(t <= 1.75e-36)) tmp = Float64(y + x); else tmp = fma(z, Float64(y / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.15e+51], N[Not[LessEqual[t, 1.75e-36]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(z * N[(y / a), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.15 \cdot 10^{+51} \lor \neg \left(t \leq 1.75 \cdot 10^{-36}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{a}, x\right)\\
\end{array}
\end{array}
if t < -2.1499999999999999e51 or 1.75e-36 < t Initial program 72.3%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6480.9
Applied rewrites80.9%
if -2.1499999999999999e51 < t < 1.75e-36Initial program 91.7%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6476.7
Applied rewrites76.7%
Applied rewrites77.4%
Final simplification79.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.05e+83) (* 1.0 x) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.05e+83) {
tmp = 1.0 * x;
} 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 (a <= (-2.05d+83)) then
tmp = 1.0d0 * x
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 (a <= -2.05e+83) {
tmp = 1.0 * x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.05e+83: tmp = 1.0 * x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.05e+83) tmp = Float64(1.0 * x); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.05e+83) tmp = 1.0 * x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.05e+83], N[(1.0 * x), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.05 \cdot 10^{+83}:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -2.05e83Initial program 84.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6485.7
Applied rewrites85.7%
Taylor expanded in x around inf
Applied rewrites67.5%
if -2.05e83 < a Initial program 81.3%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6465.8
Applied rewrites65.8%
(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 81.8%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f6463.9
Applied rewrites63.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 2024321
(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))))