
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (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) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (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) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (* y (- (+ 1.0 (/ t (- a t))) (/ z (- a t)))) x))
double code(double x, double y, double z, double t, double a) {
return (y * ((1.0 + (t / (a - t))) - (z / (a - 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 * ((1.0d0 + (t / (a - t))) - (z / (a - t)))) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return (y * ((1.0 + (t / (a - t))) - (z / (a - t)))) + x;
}
def code(x, y, z, t, a): return (y * ((1.0 + (t / (a - t))) - (z / (a - t)))) + x
function code(x, y, z, t, a) return Float64(Float64(y * Float64(Float64(1.0 + Float64(t / Float64(a - t))) - Float64(z / Float64(a - t)))) + x) end
function tmp = code(x, y, z, t, a) tmp = (y * ((1.0 + (t / (a - t))) - (z / (a - t)))) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(y * N[(N[(1.0 + N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(\left(1 + \frac{t}{a - t}\right) - \frac{z}{a - t}\right) + x
\end{array}
Initial program 77.1%
associate--l+78.8%
sub-neg78.8%
+-commutative78.8%
associate-/l*87.6%
distribute-neg-frac87.6%
associate-/r/89.9%
fma-def89.9%
sub-neg89.9%
+-commutative89.9%
distribute-neg-in89.9%
unsub-neg89.9%
remove-double-neg89.9%
Simplified89.9%
Taylor expanded in y around 0 96.1%
Final simplification96.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.6e+23)
(+ x (* y (/ (- z a) t)))
(if (<= t 1.75e+169)
(+ x (- y (/ y (/ (- a t) z))))
(+ x (/ y (/ t (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.6e+23) {
tmp = x + (y * ((z - a) / t));
} else if (t <= 1.75e+169) {
tmp = x + (y - (y / ((a - t) / z)));
} else {
tmp = x + (y / (t / (z - 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 (t <= (-1.6d+23)) then
tmp = x + (y * ((z - a) / t))
else if (t <= 1.75d+169) then
tmp = x + (y - (y / ((a - t) / z)))
else
tmp = x + (y / (t / (z - a)))
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.6e+23) {
tmp = x + (y * ((z - a) / t));
} else if (t <= 1.75e+169) {
tmp = x + (y - (y / ((a - t) / z)));
} else {
tmp = x + (y / (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.6e+23: tmp = x + (y * ((z - a) / t)) elif t <= 1.75e+169: tmp = x + (y - (y / ((a - t) / z))) else: tmp = x + (y / (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.6e+23) tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); elseif (t <= 1.75e+169) tmp = Float64(x + Float64(y - Float64(y / Float64(Float64(a - t) / z)))); else tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.6e+23) tmp = x + (y * ((z - a) / t)); elseif (t <= 1.75e+169) tmp = x + (y - (y / ((a - t) / z))); else tmp = x + (y / (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.6e+23], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e+169], N[(x + N[(y - N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{+23}:\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+169}:\\
\;\;\;\;x + \left(y - \frac{y}{\frac{a - t}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\end{array}
\end{array}
if t < -1.6e23Initial program 59.2%
associate--l+63.8%
sub-neg63.8%
+-commutative63.8%
associate-/l*74.6%
distribute-neg-frac74.6%
associate-/r/78.6%
fma-def78.7%
sub-neg78.7%
+-commutative78.7%
distribute-neg-in78.7%
unsub-neg78.7%
remove-double-neg78.7%
Simplified78.7%
Taylor expanded in y around 0 91.7%
Taylor expanded in t around inf 90.0%
associate-*r/90.0%
neg-mul-190.0%
distribute-lft-in90.0%
neg-mul-190.0%
remove-double-neg90.0%
neg-mul-190.0%
sub-neg90.0%
Simplified90.0%
if -1.6e23 < t < 1.75000000000000009e169Initial program 86.9%
associate--l+86.9%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in z around inf 88.3%
associate-/l*93.4%
Simplified93.4%
if 1.75000000000000009e169 < t Initial program 63.6%
associate--l+67.2%
sub-neg67.2%
+-commutative67.2%
associate-/l*75.6%
distribute-neg-frac75.6%
associate-/r/87.0%
fma-def87.0%
sub-neg87.0%
+-commutative87.0%
distribute-neg-in87.0%
unsub-neg87.0%
remove-double-neg87.0%
Simplified87.0%
Taylor expanded in y around 0 94.6%
associate--l+87.0%
div-sub87.0%
Simplified87.0%
Taylor expanded in t around -inf 82.9%
associate-/l*90.5%
Simplified90.5%
Final simplification92.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.1e+169) (+ x (* y (/ (- z a) t))) (+ x (* y (+ 1.0 (/ (- t z) (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.1e+169) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = x + (y * (1.0 + ((t - z) / (a - t))));
}
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.1d+169)) then
tmp = x + (y * ((z - a) / t))
else
tmp = x + (y * (1.0d0 + ((t - z) / (a - t))))
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.1e+169) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = x + (y * (1.0 + ((t - z) / (a - t))));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.1e+169: tmp = x + (y * ((z - a) / t)) else: tmp = x + (y * (1.0 + ((t - z) / (a - t)))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.1e+169) tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); else tmp = Float64(x + Float64(y * Float64(1.0 + Float64(Float64(t - z) / Float64(a - t))))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.1e+169) tmp = x + (y * ((z - a) / t)); else tmp = x + (y * (1.0 + ((t - z) / (a - t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.1e+169], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(1.0 + N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+169}:\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 + \frac{t - z}{a - t}\right)\\
\end{array}
\end{array}
if t < -2.1000000000000001e169Initial program 50.1%
associate--l+50.3%
sub-neg50.3%
+-commutative50.3%
associate-/l*63.5%
distribute-neg-frac63.5%
associate-/r/66.1%
fma-def66.2%
sub-neg66.2%
+-commutative66.2%
distribute-neg-in66.2%
unsub-neg66.2%
remove-double-neg66.2%
Simplified66.2%
Taylor expanded in y around 0 86.3%
Taylor expanded in t around inf 92.8%
associate-*r/92.8%
neg-mul-192.8%
distribute-lft-in92.8%
neg-mul-192.8%
remove-double-neg92.8%
neg-mul-192.8%
sub-neg92.8%
Simplified92.8%
if -2.1000000000000001e169 < t Initial program 81.4%
associate--l+83.3%
sub-neg83.3%
+-commutative83.3%
associate-/l*91.4%
distribute-neg-frac91.4%
associate-/r/93.7%
fma-def93.7%
sub-neg93.7%
+-commutative93.7%
distribute-neg-in93.7%
unsub-neg93.7%
remove-double-neg93.7%
Simplified93.7%
Taylor expanded in y around 0 97.6%
associate--l+93.7%
div-sub93.7%
Simplified93.7%
Final simplification93.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.5e+14) (not (<= a 2.6e+39))) (+ y x) (+ x (* y (/ (- z a) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.5e+14) || !(a <= 2.6e+39)) {
tmp = y + x;
} else {
tmp = x + (y * ((z - a) / t));
}
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.5d+14)) .or. (.not. (a <= 2.6d+39))) then
tmp = y + x
else
tmp = x + (y * ((z - a) / t))
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.5e+14) || !(a <= 2.6e+39)) {
tmp = y + x;
} else {
tmp = x + (y * ((z - a) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.5e+14) or not (a <= 2.6e+39): tmp = y + x else: tmp = x + (y * ((z - a) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.5e+14) || !(a <= 2.6e+39)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.5e+14) || ~((a <= 2.6e+39))) tmp = y + x; else tmp = x + (y * ((z - a) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.5e+14], N[Not[LessEqual[a, 2.6e+39]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{+14} \lor \neg \left(a \leq 2.6 \cdot 10^{+39}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\end{array}
\end{array}
if a < -2.5e14 or 2.6e39 < a Initial program 79.3%
associate--l+79.5%
sub-neg79.5%
+-commutative79.5%
associate-/l*92.6%
distribute-neg-frac92.6%
associate-/r/94.1%
fma-def94.2%
sub-neg94.2%
+-commutative94.2%
distribute-neg-in94.2%
unsub-neg94.2%
remove-double-neg94.2%
Simplified94.2%
Taylor expanded in a around inf 83.3%
if -2.5e14 < a < 2.6e39Initial program 75.0%
associate--l+78.0%
sub-neg78.0%
+-commutative78.0%
associate-/l*82.5%
distribute-neg-frac82.5%
associate-/r/85.7%
fma-def85.7%
sub-neg85.7%
+-commutative85.7%
distribute-neg-in85.7%
unsub-neg85.7%
remove-double-neg85.7%
Simplified85.7%
Taylor expanded in y around 0 96.2%
Taylor expanded in t around inf 82.6%
associate-*r/82.6%
neg-mul-182.6%
distribute-lft-in82.6%
neg-mul-182.6%
remove-double-neg82.6%
neg-mul-182.6%
sub-neg82.6%
Simplified82.6%
Final simplification83.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -8.8e-66) (not (<= a 2.2e+43))) (- (+ y x) (* y (/ z a))) (+ x (/ (- z a) (/ t y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -8.8e-66) || !(a <= 2.2e+43)) {
tmp = (y + x) - (y * (z / a));
} else {
tmp = x + ((z - a) / (t / 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 ((a <= (-8.8d-66)) .or. (.not. (a <= 2.2d+43))) then
tmp = (y + x) - (y * (z / a))
else
tmp = x + ((z - a) / (t / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -8.8e-66) || !(a <= 2.2e+43)) {
tmp = (y + x) - (y * (z / a));
} else {
tmp = x + ((z - a) / (t / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -8.8e-66) or not (a <= 2.2e+43): tmp = (y + x) - (y * (z / a)) else: tmp = x + ((z - a) / (t / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -8.8e-66) || !(a <= 2.2e+43)) tmp = Float64(Float64(y + x) - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(Float64(z - a) / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -8.8e-66) || ~((a <= 2.2e+43))) tmp = (y + x) - (y * (z / a)); else tmp = x + ((z - a) / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -8.8e-66], N[Not[LessEqual[a, 2.2e+43]], $MachinePrecision]], N[(N[(y + x), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - a), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.8 \cdot 10^{-66} \lor \neg \left(a \leq 2.2 \cdot 10^{+43}\right):\\
\;\;\;\;\left(y + x\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - a}{\frac{t}{y}}\\
\end{array}
\end{array}
if a < -8.8000000000000004e-66 or 2.20000000000000001e43 < a Initial program 79.9%
associate-*l/92.6%
Simplified92.6%
Taylor expanded in t around 0 86.6%
if -8.8000000000000004e-66 < a < 2.20000000000000001e43Initial program 73.8%
associate--l+77.2%
sub-neg77.2%
+-commutative77.2%
associate-/l*82.2%
distribute-neg-frac82.2%
associate-/r/85.8%
fma-def85.8%
sub-neg85.8%
+-commutative85.8%
distribute-neg-in85.8%
unsub-neg85.8%
remove-double-neg85.8%
Simplified85.8%
Taylor expanded in y around 0 96.6%
Taylor expanded in t around inf 81.5%
mul-1-neg81.5%
associate-/l*85.4%
neg-mul-185.4%
+-commutative85.4%
sub-neg85.4%
distribute-neg-frac85.4%
mul-1-neg85.4%
sub-neg85.4%
+-commutative85.4%
distribute-lft-in85.4%
neg-mul-185.4%
remove-double-neg85.4%
neg-mul-185.4%
sub-neg85.4%
Simplified85.4%
Final simplification86.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -3900000000000.0) (+ y x) (if (<= a 5.5e+39) (+ x (/ y (/ t (- z a)))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3900000000000.0) {
tmp = y + x;
} else if (a <= 5.5e+39) {
tmp = x + (y / (t / (z - 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 (a <= (-3900000000000.0d0)) then
tmp = y + x
else if (a <= 5.5d+39) then
tmp = x + (y / (t / (z - 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 (a <= -3900000000000.0) {
tmp = y + x;
} else if (a <= 5.5e+39) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3900000000000.0: tmp = y + x elif a <= 5.5e+39: tmp = x + (y / (t / (z - a))) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3900000000000.0) tmp = Float64(y + x); elseif (a <= 5.5e+39) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3900000000000.0) tmp = y + x; elseif (a <= 5.5e+39) tmp = x + (y / (t / (z - a))); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3900000000000.0], N[(y + x), $MachinePrecision], If[LessEqual[a, 5.5e+39], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3900000000000:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{+39}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -3.9e12 or 5.4999999999999997e39 < a Initial program 79.3%
associate--l+79.5%
sub-neg79.5%
+-commutative79.5%
associate-/l*92.6%
distribute-neg-frac92.6%
associate-/r/94.1%
fma-def94.2%
sub-neg94.2%
+-commutative94.2%
distribute-neg-in94.2%
unsub-neg94.2%
remove-double-neg94.2%
Simplified94.2%
Taylor expanded in a around inf 83.3%
if -3.9e12 < a < 5.4999999999999997e39Initial program 75.0%
associate--l+78.0%
sub-neg78.0%
+-commutative78.0%
associate-/l*82.5%
distribute-neg-frac82.5%
associate-/r/85.7%
fma-def85.7%
sub-neg85.7%
+-commutative85.7%
distribute-neg-in85.7%
unsub-neg85.7%
remove-double-neg85.7%
Simplified85.7%
Taylor expanded in y around 0 96.2%
associate--l+85.7%
div-sub85.7%
Simplified85.7%
Taylor expanded in t around -inf 79.5%
associate-/l*82.6%
Simplified82.6%
Final simplification82.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.4e+16) (+ (+ y x) (/ y (/ a t))) (if (<= a 4.3e+39) (+ x (* y (/ (- z a) t))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.4e+16) {
tmp = (y + x) + (y / (a / t));
} else if (a <= 4.3e+39) {
tmp = x + (y * ((z - a) / t));
} 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 <= (-3.4d+16)) then
tmp = (y + x) + (y / (a / t))
else if (a <= 4.3d+39) then
tmp = x + (y * ((z - a) / t))
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 <= -3.4e+16) {
tmp = (y + x) + (y / (a / t));
} else if (a <= 4.3e+39) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.4e+16: tmp = (y + x) + (y / (a / t)) elif a <= 4.3e+39: tmp = x + (y * ((z - a) / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.4e+16) tmp = Float64(Float64(y + x) + Float64(y / Float64(a / t))); elseif (a <= 4.3e+39) tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.4e+16) tmp = (y + x) + (y / (a / t)); elseif (a <= 4.3e+39) tmp = x + (y * ((z - a) / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.4e+16], N[(N[(y + x), $MachinePrecision] + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.3e+39], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.4 \cdot 10^{+16}:\\
\;\;\;\;\left(y + x\right) + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;a \leq 4.3 \cdot 10^{+39}:\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -3.4e16Initial program 78.8%
associate--l+79.1%
sub-neg79.1%
+-commutative79.1%
associate-/l*93.6%
distribute-neg-frac93.6%
associate-/r/96.2%
fma-def96.3%
sub-neg96.3%
+-commutative96.3%
distribute-neg-in96.3%
unsub-neg96.3%
remove-double-neg96.3%
Simplified96.3%
Taylor expanded in y around 0 98.0%
Taylor expanded in z around 0 86.8%
Taylor expanded in t around 0 72.7%
+-commutative72.7%
associate-+r+72.7%
associate-/l*81.2%
Simplified81.2%
if -3.4e16 < a < 4.3e39Initial program 75.0%
associate--l+78.0%
sub-neg78.0%
+-commutative78.0%
associate-/l*82.5%
distribute-neg-frac82.5%
associate-/r/85.7%
fma-def85.7%
sub-neg85.7%
+-commutative85.7%
distribute-neg-in85.7%
unsub-neg85.7%
remove-double-neg85.7%
Simplified85.7%
Taylor expanded in y around 0 96.2%
Taylor expanded in t around inf 82.6%
associate-*r/82.6%
neg-mul-182.6%
distribute-lft-in82.6%
neg-mul-182.6%
remove-double-neg82.6%
neg-mul-182.6%
sub-neg82.6%
Simplified82.6%
if 4.3e39 < a Initial program 80.0%
associate--l+80.1%
sub-neg80.1%
+-commutative80.1%
associate-/l*91.4%
distribute-neg-frac91.4%
associate-/r/91.5%
fma-def91.5%
sub-neg91.5%
+-commutative91.5%
distribute-neg-in91.5%
unsub-neg91.5%
remove-double-neg91.5%
Simplified91.5%
Taylor expanded in a around inf 86.2%
Final simplification83.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -8.2e+15) (+ (+ y x) (/ y (/ a t))) (if (<= a 3.3e+39) (+ x (/ (- z a) (/ t y))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.2e+15) {
tmp = (y + x) + (y / (a / t));
} else if (a <= 3.3e+39) {
tmp = x + ((z - a) / (t / y));
} 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 <= (-8.2d+15)) then
tmp = (y + x) + (y / (a / t))
else if (a <= 3.3d+39) then
tmp = x + ((z - a) / (t / y))
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 <= -8.2e+15) {
tmp = (y + x) + (y / (a / t));
} else if (a <= 3.3e+39) {
tmp = x + ((z - a) / (t / y));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -8.2e+15: tmp = (y + x) + (y / (a / t)) elif a <= 3.3e+39: tmp = x + ((z - a) / (t / y)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8.2e+15) tmp = Float64(Float64(y + x) + Float64(y / Float64(a / t))); elseif (a <= 3.3e+39) tmp = Float64(x + Float64(Float64(z - a) / Float64(t / y))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -8.2e+15) tmp = (y + x) + (y / (a / t)); elseif (a <= 3.3e+39) tmp = x + ((z - a) / (t / y)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8.2e+15], N[(N[(y + x), $MachinePrecision] + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.3e+39], N[(x + N[(N[(z - a), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.2 \cdot 10^{+15}:\\
\;\;\;\;\left(y + x\right) + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{+39}:\\
\;\;\;\;x + \frac{z - a}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -8.2e15Initial program 78.8%
associate--l+79.1%
sub-neg79.1%
+-commutative79.1%
associate-/l*93.6%
distribute-neg-frac93.6%
associate-/r/96.2%
fma-def96.3%
sub-neg96.3%
+-commutative96.3%
distribute-neg-in96.3%
unsub-neg96.3%
remove-double-neg96.3%
Simplified96.3%
Taylor expanded in y around 0 98.0%
Taylor expanded in z around 0 86.8%
Taylor expanded in t around 0 72.7%
+-commutative72.7%
associate-+r+72.7%
associate-/l*81.2%
Simplified81.2%
if -8.2e15 < a < 3.30000000000000021e39Initial program 75.0%
associate--l+78.0%
sub-neg78.0%
+-commutative78.0%
associate-/l*82.5%
distribute-neg-frac82.5%
associate-/r/85.7%
fma-def85.7%
sub-neg85.7%
+-commutative85.7%
distribute-neg-in85.7%
unsub-neg85.7%
remove-double-neg85.7%
Simplified85.7%
Taylor expanded in y around 0 96.2%
Taylor expanded in t around inf 79.5%
mul-1-neg79.5%
associate-/l*83.1%
neg-mul-183.1%
+-commutative83.1%
sub-neg83.1%
distribute-neg-frac83.1%
mul-1-neg83.1%
sub-neg83.1%
+-commutative83.1%
distribute-lft-in83.1%
neg-mul-183.1%
remove-double-neg83.1%
neg-mul-183.1%
sub-neg83.1%
Simplified83.1%
if 3.30000000000000021e39 < a Initial program 80.0%
associate--l+80.1%
sub-neg80.1%
+-commutative80.1%
associate-/l*91.4%
distribute-neg-frac91.4%
associate-/r/91.5%
fma-def91.5%
sub-neg91.5%
+-commutative91.5%
distribute-neg-in91.5%
unsub-neg91.5%
remove-double-neg91.5%
Simplified91.5%
Taylor expanded in a around inf 86.2%
Final simplification83.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -5e-66) (- (+ y x) (* z (/ y a))) (if (<= a 1.18e+38) (+ x (/ (- z a) (/ t y))) (- (+ y x) (* y (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5e-66) {
tmp = (y + x) - (z * (y / a));
} else if (a <= 1.18e+38) {
tmp = x + ((z - a) / (t / y));
} else {
tmp = (y + x) - (y * (z / 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 (a <= (-5d-66)) then
tmp = (y + x) - (z * (y / a))
else if (a <= 1.18d+38) then
tmp = x + ((z - a) / (t / y))
else
tmp = (y + x) - (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5e-66) {
tmp = (y + x) - (z * (y / a));
} else if (a <= 1.18e+38) {
tmp = x + ((z - a) / (t / y));
} else {
tmp = (y + x) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5e-66: tmp = (y + x) - (z * (y / a)) elif a <= 1.18e+38: tmp = x + ((z - a) / (t / y)) else: tmp = (y + x) - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5e-66) tmp = Float64(Float64(y + x) - Float64(z * Float64(y / a))); elseif (a <= 1.18e+38) tmp = Float64(x + Float64(Float64(z - a) / Float64(t / y))); else tmp = Float64(Float64(y + x) - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5e-66) tmp = (y + x) - (z * (y / a)); elseif (a <= 1.18e+38) tmp = x + ((z - a) / (t / y)); else tmp = (y + x) - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5e-66], N[(N[(y + x), $MachinePrecision] - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.18e+38], N[(x + N[(N[(z - a), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + x), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{-66}:\\
\;\;\;\;\left(y + x\right) - z \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 1.18 \cdot 10^{+38}:\\
\;\;\;\;x + \frac{z - a}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;\left(y + x\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -4.99999999999999962e-66Initial program 79.8%
associate--l+80.1%
associate-/l*92.3%
Simplified92.3%
Taylor expanded in z around inf 82.5%
associate-/l*88.3%
Simplified88.3%
div-sub87.1%
Applied egg-rr87.1%
Taylor expanded in a around inf 77.7%
mul-1-neg77.7%
+-commutative77.7%
associate-+r+77.7%
sub-neg77.7%
associate-/l*83.4%
associate-/r/83.5%
Simplified83.5%
if -4.99999999999999962e-66 < a < 1.18e38Initial program 73.8%
associate--l+77.2%
sub-neg77.2%
+-commutative77.2%
associate-/l*82.2%
distribute-neg-frac82.2%
associate-/r/85.8%
fma-def85.8%
sub-neg85.8%
+-commutative85.8%
distribute-neg-in85.8%
unsub-neg85.8%
remove-double-neg85.8%
Simplified85.8%
Taylor expanded in y around 0 96.6%
Taylor expanded in t around inf 81.5%
mul-1-neg81.5%
associate-/l*85.4%
neg-mul-185.4%
+-commutative85.4%
sub-neg85.4%
distribute-neg-frac85.4%
mul-1-neg85.4%
sub-neg85.4%
+-commutative85.4%
distribute-lft-in85.4%
neg-mul-185.4%
remove-double-neg85.4%
neg-mul-185.4%
sub-neg85.4%
Simplified85.4%
if 1.18e38 < a Initial program 80.0%
associate-*l/91.4%
Simplified91.4%
Taylor expanded in t around 0 91.4%
Final simplification86.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.35e+79) (- (+ y x) (* z (/ y a))) (if (<= a 5.2e+19) (- x (/ (* y z) (- a t))) (- (+ y x) (* y (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.35e+79) {
tmp = (y + x) - (z * (y / a));
} else if (a <= 5.2e+19) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = (y + x) - (y * (z / 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 (a <= (-1.35d+79)) then
tmp = (y + x) - (z * (y / a))
else if (a <= 5.2d+19) then
tmp = x - ((y * z) / (a - t))
else
tmp = (y + x) - (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.35e+79) {
tmp = (y + x) - (z * (y / a));
} else if (a <= 5.2e+19) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = (y + x) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.35e+79: tmp = (y + x) - (z * (y / a)) elif a <= 5.2e+19: tmp = x - ((y * z) / (a - t)) else: tmp = (y + x) - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.35e+79) tmp = Float64(Float64(y + x) - Float64(z * Float64(y / a))); elseif (a <= 5.2e+19) tmp = Float64(x - Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(Float64(y + x) - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.35e+79) tmp = (y + x) - (z * (y / a)); elseif (a <= 5.2e+19) tmp = x - ((y * z) / (a - t)); else tmp = (y + x) - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.35e+79], N[(N[(y + x), $MachinePrecision] - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.2e+19], N[(x - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + x), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{+79}:\\
\;\;\;\;\left(y + x\right) - z \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{+19}:\\
\;\;\;\;x - \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\left(y + x\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -1.35e79Initial program 78.9%
associate--l+78.9%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in z around inf 84.1%
associate-/l*92.6%
Simplified92.6%
div-sub90.9%
Applied egg-rr90.9%
Taylor expanded in a around inf 80.8%
mul-1-neg80.8%
+-commutative80.8%
associate-+r+80.8%
sub-neg80.8%
associate-/l*89.2%
associate-/r/89.4%
Simplified89.4%
if -1.35e79 < a < 5.2e19Initial program 75.6%
associate--l+78.6%
sub-neg78.6%
+-commutative78.6%
associate-/l*82.8%
distribute-neg-frac82.8%
associate-/r/85.9%
fma-def85.9%
sub-neg85.9%
+-commutative85.9%
distribute-neg-in85.9%
unsub-neg85.9%
remove-double-neg85.9%
Simplified85.9%
Taylor expanded in z around inf 90.2%
associate-*r/90.2%
associate-*r*90.2%
neg-mul-190.2%
Simplified90.2%
if 5.2e19 < a Initial program 78.9%
associate-*l/89.1%
Simplified89.1%
Taylor expanded in t around 0 89.1%
Final simplification89.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.55e+15) (not (<= a 9.2e+19))) (+ y x) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.55e+15) || !(a <= 9.2e+19)) {
tmp = y + x;
} else {
tmp = x + (y * (z / t));
}
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 <= (-1.55d+15)) .or. (.not. (a <= 9.2d+19))) then
tmp = y + x
else
tmp = x + (y * (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.55e+15) || !(a <= 9.2e+19)) {
tmp = y + x;
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.55e+15) or not (a <= 9.2e+19): tmp = y + x else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.55e+15) || !(a <= 9.2e+19)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.55e+15) || ~((a <= 9.2e+19))) tmp = y + x; else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.55e+15], N[Not[LessEqual[a, 9.2e+19]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{+15} \lor \neg \left(a \leq 9.2 \cdot 10^{+19}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if a < -1.55e15 or 9.2e19 < a Initial program 78.8%
associate--l+79.0%
sub-neg79.0%
+-commutative79.0%
associate-/l*92.2%
distribute-neg-frac92.2%
associate-/r/93.6%
fma-def93.7%
sub-neg93.7%
+-commutative93.7%
distribute-neg-in93.7%
unsub-neg93.7%
remove-double-neg93.7%
Simplified93.7%
Taylor expanded in a around inf 82.5%
if -1.55e15 < a < 9.2e19Initial program 75.3%
associate--l+78.5%
sub-neg78.5%
+-commutative78.5%
associate-/l*82.4%
distribute-neg-frac82.4%
associate-/r/85.8%
fma-def85.8%
sub-neg85.8%
+-commutative85.8%
distribute-neg-in85.8%
unsub-neg85.8%
remove-double-neg85.8%
Simplified85.8%
Taylor expanded in y around 0 96.0%
Taylor expanded in a around 0 83.0%
Final simplification82.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -22500000000000.0) (not (<= a 5.5e+17))) (+ y x) (+ x (/ y (/ t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -22500000000000.0) || !(a <= 5.5e+17)) {
tmp = y + x;
} else {
tmp = x + (y / (t / 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 ((a <= (-22500000000000.0d0)) .or. (.not. (a <= 5.5d+17))) then
tmp = y + x
else
tmp = x + (y / (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -22500000000000.0) || !(a <= 5.5e+17)) {
tmp = y + x;
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -22500000000000.0) or not (a <= 5.5e+17): tmp = y + x else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -22500000000000.0) || !(a <= 5.5e+17)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -22500000000000.0) || ~((a <= 5.5e+17))) tmp = y + x; else tmp = x + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -22500000000000.0], N[Not[LessEqual[a, 5.5e+17]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -22500000000000 \lor \neg \left(a \leq 5.5 \cdot 10^{+17}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if a < -2.25e13 or 5.5e17 < a Initial program 78.8%
associate--l+79.0%
sub-neg79.0%
+-commutative79.0%
associate-/l*92.2%
distribute-neg-frac92.2%
associate-/r/93.6%
fma-def93.7%
sub-neg93.7%
+-commutative93.7%
distribute-neg-in93.7%
unsub-neg93.7%
remove-double-neg93.7%
Simplified93.7%
Taylor expanded in a around inf 82.5%
if -2.25e13 < a < 5.5e17Initial program 75.3%
associate--l+78.5%
sub-neg78.5%
+-commutative78.5%
associate-/l*82.4%
distribute-neg-frac82.4%
associate-/r/85.8%
fma-def85.8%
sub-neg85.8%
+-commutative85.8%
distribute-neg-in85.8%
unsub-neg85.8%
remove-double-neg85.8%
Simplified85.8%
Taylor expanded in y around 0 96.0%
Taylor expanded in a around 0 80.5%
associate-/l*83.1%
Simplified83.1%
Final simplification82.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -9.5e-31) (+ y x) (if (<= a 3.8e-91) x (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.5e-31) {
tmp = y + x;
} else if (a <= 3.8e-91) {
tmp = 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 <= (-9.5d-31)) then
tmp = y + x
else if (a <= 3.8d-91) then
tmp = 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 <= -9.5e-31) {
tmp = y + x;
} else if (a <= 3.8e-91) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9.5e-31: tmp = y + x elif a <= 3.8e-91: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.5e-31) tmp = Float64(y + x); elseif (a <= 3.8e-91) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -9.5e-31) tmp = y + x; elseif (a <= 3.8e-91) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.5e-31], N[(y + x), $MachinePrecision], If[LessEqual[a, 3.8e-91], x, N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{-31}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{-91}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -9.5000000000000008e-31 or 3.79999999999999978e-91 < a Initial program 78.2%
associate--l+78.4%
sub-neg78.4%
+-commutative78.4%
associate-/l*90.9%
distribute-neg-frac90.9%
associate-/r/91.9%
fma-def92.0%
sub-neg92.0%
+-commutative92.0%
distribute-neg-in92.0%
unsub-neg92.0%
remove-double-neg92.0%
Simplified92.0%
Taylor expanded in a around inf 77.8%
if -9.5000000000000008e-31 < a < 3.79999999999999978e-91Initial program 75.2%
associate--l+79.5%
sub-neg79.5%
+-commutative79.5%
associate-/l*81.5%
distribute-neg-frac81.5%
associate-/r/86.2%
fma-def86.2%
sub-neg86.2%
+-commutative86.2%
distribute-neg-in86.2%
unsub-neg86.2%
remove-double-neg86.2%
Simplified86.2%
Taylor expanded in x around inf 52.8%
Final simplification69.0%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return 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 = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 77.1%
associate--l+78.8%
sub-neg78.8%
+-commutative78.8%
associate-/l*87.6%
distribute-neg-frac87.6%
associate-/r/89.9%
fma-def89.9%
sub-neg89.9%
+-commutative89.9%
distribute-neg-in89.9%
unsub-neg89.9%
remove-double-neg89.9%
Simplified89.9%
Taylor expanded in x around inf 56.2%
Final simplification56.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (< t_2 -1.3664970889390727e-7)
t_1
(if (< t_2 1.4754293444577233e-239)
(/ (- (* y (- a z)) (* x t)) (- a t))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y + x) - (((z - t) * (1.0d0 / (a - t))) * y)
t_2 = (x + y) - (((z - t) * y) / (a - t))
if (t_2 < (-1.3664970889390727d-7)) then
tmp = t_1
else if (t_2 < 1.4754293444577233d-239) then
tmp = ((y * (a - z)) - (x * t)) / (a - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 < -1.3664970889390727e-7: tmp = t_1 elif t_2 < 1.4754293444577233e-239: tmp = ((y * (a - z)) - (x * t)) / (a - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y + x) - Float64(Float64(Float64(z - t) * Float64(1.0 / Float64(a - t))) * y)) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = Float64(Float64(Float64(y * Float64(a - z)) - Float64(x * t)) / Float64(a - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = ((y * (a - z)) - (x * t)) / (a - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -1.3664970889390727e-7], t$95$1, If[Less[t$95$2, 1.4754293444577233e-239], N[(N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t_2 < -1.3664970889390727 \cdot 10^{-7}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 < 1.4754293444577233 \cdot 10^{-239}:\\
\;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023242
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-7) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))