
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\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)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (/ (- z t) (- z a)) y x))
double code(double x, double y, double z, double t, double a) {
return fma(((z - t) / (z - a)), y, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(z - t) / Float64(z - a)), y, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{z - t}{z - a}, y, x\right)
\end{array}
Initial program 87.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6499.2
Applied rewrites99.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (<= t_1 -5e+66)
(fma (- 1.0 (/ t z)) y x)
(if (<= t_1 2e+35) (fma (/ z (- z a)) y x) (* (/ y (- z a)) (- z t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if (t_1 <= -5e+66) {
tmp = fma((1.0 - (t / z)), y, x);
} else if (t_1 <= 2e+35) {
tmp = fma((z / (z - a)), y, x);
} else {
tmp = (y / (z - a)) * (z - t);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if (t_1 <= -5e+66) tmp = fma(Float64(1.0 - Float64(t / z)), y, x); elseif (t_1 <= 2e+35) tmp = fma(Float64(z / Float64(z - a)), y, x); else tmp = Float64(Float64(y / Float64(z - a)) * Float64(z - t)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+66], N[(N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+35], N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+66}:\\
\;\;\;\;\mathsf{fma}\left(1 - \frac{t}{z}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{z - a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z - a} \cdot \left(z - t\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -4.99999999999999991e66Initial program 69.1%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6478.7
Applied rewrites78.7%
Applied rewrites78.8%
if -4.99999999999999991e66 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 1.9999999999999999e35Initial program 99.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6492.1
Applied rewrites92.1%
if 1.9999999999999999e35 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 75.7%
Taylor expanded in x around 0
distribute-lft-out--N/A
fp-cancel-sub-signN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
div-add-revN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
distribute-rgt-outN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6488.6
Applied rewrites88.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t) z) y x)))
(if (<= z -1.5e+90)
(+ y x)
(if (<= z -1.9e-30)
t_1
(if (<= z 1.15e+35)
(fma (/ t a) y x)
(if (<= z 7.5e+164) t_1 (+ y x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((-t / z), y, x);
double tmp;
if (z <= -1.5e+90) {
tmp = y + x;
} else if (z <= -1.9e-30) {
tmp = t_1;
} else if (z <= 1.15e+35) {
tmp = fma((t / a), y, x);
} else if (z <= 7.5e+164) {
tmp = t_1;
} else {
tmp = y + x;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(-t) / z), y, x) tmp = 0.0 if (z <= -1.5e+90) tmp = Float64(y + x); elseif (z <= -1.9e-30) tmp = t_1; elseif (z <= 1.15e+35) tmp = fma(Float64(t / a), y, x); elseif (z <= 7.5e+164) tmp = t_1; else tmp = Float64(y + x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[((-t) / z), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[z, -1.5e+90], N[(y + x), $MachinePrecision], If[LessEqual[z, -1.9e-30], t$95$1, If[LessEqual[z, 1.15e+35], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[z, 7.5e+164], t$95$1, N[(y + x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{-t}{z}, y, x\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+90}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+164}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -1.49999999999999989e90 or 7.49999999999999976e164 < z Initial program 70.2%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6491.3
Applied rewrites91.3%
if -1.49999999999999989e90 < z < -1.9000000000000002e-30 or 1.1499999999999999e35 < z < 7.49999999999999976e164Initial program 89.4%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6487.8
Applied rewrites87.8%
Taylor expanded in z around 0
Applied rewrites81.6%
if -1.9000000000000002e-30 < z < 1.1499999999999999e35Initial program 97.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6498.5
Applied rewrites98.5%
Taylor expanded in z around 0
lower-/.f6479.4
Applied rewrites79.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -60000000000.0) (not (<= a 4.9e-33))) (fma (/ t a) y x) (fma (- 1.0 (/ t z)) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -60000000000.0) || !(a <= 4.9e-33)) {
tmp = fma((t / a), y, x);
} else {
tmp = fma((1.0 - (t / z)), y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -60000000000.0) || !(a <= 4.9e-33)) tmp = fma(Float64(t / a), y, x); else tmp = fma(Float64(1.0 - Float64(t / z)), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -60000000000.0], N[Not[LessEqual[a, 4.9e-33]], $MachinePrecision]], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], N[(N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -60000000000 \lor \neg \left(a \leq 4.9 \cdot 10^{-33}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - \frac{t}{z}, y, x\right)\\
\end{array}
\end{array}
if a < -6e10 or 4.8999999999999998e-33 < a Initial program 87.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in z around 0
lower-/.f6482.7
Applied rewrites82.7%
if -6e10 < a < 4.8999999999999998e-33Initial program 87.9%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6489.1
Applied rewrites89.1%
Applied rewrites89.1%
Final simplification85.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -60000000000.0) (fma (/ t a) y x) (if (<= a 1.45e-35) (fma (- 1.0 (/ t z)) y x) (fma (/ z (- z a)) y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -60000000000.0) {
tmp = fma((t / a), y, x);
} else if (a <= 1.45e-35) {
tmp = fma((1.0 - (t / z)), y, x);
} else {
tmp = fma((z / (z - a)), y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -60000000000.0) tmp = fma(Float64(t / a), y, x); elseif (a <= 1.45e-35) tmp = fma(Float64(1.0 - Float64(t / z)), y, x); else tmp = fma(Float64(z / Float64(z - a)), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -60000000000.0], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[a, 1.45e-35], N[(N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -60000000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{-35}:\\
\;\;\;\;\mathsf{fma}\left(1 - \frac{t}{z}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{z - a}, y, x\right)\\
\end{array}
\end{array}
if a < -6e10Initial program 88.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in z around 0
lower-/.f6486.2
Applied rewrites86.2%
if -6e10 < a < 1.4500000000000001e-35Initial program 87.8%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6489.0
Applied rewrites89.0%
Applied rewrites89.0%
if 1.4500000000000001e-35 < a Initial program 87.4%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6483.6
Applied rewrites83.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.8e+33) (not (<= z 3.4e+50))) (+ y x) (fma (/ t a) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.8e+33) || !(z <= 3.4e+50)) {
tmp = y + x;
} else {
tmp = fma((t / a), y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.8e+33) || !(z <= 3.4e+50)) tmp = Float64(y + x); else tmp = fma(Float64(t / a), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.8e+33], N[Not[LessEqual[z, 3.4e+50]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{+33} \lor \neg \left(z \leq 3.4 \cdot 10^{+50}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
\end{array}
\end{array}
if z < -9.80000000000000027e33 or 3.3999999999999998e50 < z Initial program 75.1%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6479.9
Applied rewrites79.9%
if -9.80000000000000027e33 < z < 3.3999999999999998e50Initial program 97.4%
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%
Taylor expanded in z around 0
lower-/.f6478.3
Applied rewrites78.3%
Final simplification79.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.8e+33) (not (<= z 3.3e+50))) (+ y x) (fma (/ y a) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.8e+33) || !(z <= 3.3e+50)) {
tmp = y + x;
} else {
tmp = fma((y / a), t, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.8e+33) || !(z <= 3.3e+50)) tmp = Float64(y + x); else tmp = fma(Float64(y / a), t, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.8e+33], N[Not[LessEqual[z, 3.3e+50]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{+33} \lor \neg \left(z \leq 3.3 \cdot 10^{+50}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\end{array}
\end{array}
if z < -9.80000000000000027e33 or 3.3e50 < z Initial program 75.1%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6479.9
Applied rewrites79.9%
if -9.80000000000000027e33 < z < 3.3e50Initial program 97.4%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6477.6
Applied rewrites77.6%
Final simplification78.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= y 2.45e+132) (not (<= y 1.22e+260))) (+ y x) (* (/ t a) y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= 2.45e+132) || !(y <= 1.22e+260)) {
tmp = y + x;
} else {
tmp = (t / a) * y;
}
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 <= 2.45d+132) .or. (.not. (y <= 1.22d+260))) then
tmp = y + x
else
tmp = (t / a) * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= 2.45e+132) || !(y <= 1.22e+260)) {
tmp = y + x;
} else {
tmp = (t / a) * y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= 2.45e+132) or not (y <= 1.22e+260): tmp = y + x else: tmp = (t / a) * y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= 2.45e+132) || !(y <= 1.22e+260)) tmp = Float64(y + x); else tmp = Float64(Float64(t / a) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= 2.45e+132) || ~((y <= 1.22e+260))) tmp = y + x; else tmp = (t / a) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, 2.45e+132], N[Not[LessEqual[y, 1.22e+260]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(N[(t / a), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.45 \cdot 10^{+132} \lor \neg \left(y \leq 1.22 \cdot 10^{+260}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{a} \cdot y\\
\end{array}
\end{array}
if y < 2.4500000000000001e132 or 1.22e260 < y Initial program 87.1%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6464.5
Applied rewrites64.5%
if 2.4500000000000001e132 < y < 1.22e260Initial program 95.8%
Taylor expanded in x around 0
distribute-lft-out--N/A
fp-cancel-sub-signN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
div-add-revN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
distribute-rgt-outN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6479.3
Applied rewrites79.3%
Taylor expanded in z around inf
Applied rewrites54.3%
Taylor expanded in z around 0
Applied rewrites62.5%
Applied rewrites62.6%
Final simplification64.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= y 2.45e+132) (not (<= y 3.8e+259))) (+ y x) (* t (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= 2.45e+132) || !(y <= 3.8e+259)) {
tmp = y + x;
} else {
tmp = t * (y / a);
}
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 <= 2.45d+132) .or. (.not. (y <= 3.8d+259))) then
tmp = y + x
else
tmp = t * (y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= 2.45e+132) || !(y <= 3.8e+259)) {
tmp = y + x;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= 2.45e+132) or not (y <= 3.8e+259): tmp = y + x else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= 2.45e+132) || !(y <= 3.8e+259)) tmp = Float64(y + x); else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= 2.45e+132) || ~((y <= 3.8e+259))) tmp = y + x; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, 2.45e+132], N[Not[LessEqual[y, 3.8e+259]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.45 \cdot 10^{+132} \lor \neg \left(y \leq 3.8 \cdot 10^{+259}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < 2.4500000000000001e132 or 3.8e259 < y Initial program 87.1%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6464.5
Applied rewrites64.5%
if 2.4500000000000001e132 < y < 3.8e259Initial program 95.8%
Taylor expanded in x around 0
distribute-lft-out--N/A
fp-cancel-sub-signN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
div-add-revN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
distribute-rgt-outN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6479.3
Applied rewrites79.3%
Taylor expanded in z around inf
Applied rewrites54.3%
Taylor expanded in z around 0
Applied rewrites62.5%
Applied rewrites62.5%
Final simplification64.3%
(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 87.9%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6460.6
Applied rewrites60.6%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (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 / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024339
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (/ (* y (- z t)) (- z a))))