
(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 15 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
(let* ((t_1 (/ t (- a t))))
(+
x
(*
y
(-
(/ (- -1.0 (pow t_1 3.0)) (+ -1.0 (- t_1 (* t_1 t_1))))
(/ z (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t / (a - t);
return x + (y * (((-1.0 - pow(t_1, 3.0)) / (-1.0 + (t_1 - (t_1 * t_1)))) - (z / (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
real(8) :: t_1
t_1 = t / (a - t)
code = x + (y * ((((-1.0d0) - (t_1 ** 3.0d0)) / ((-1.0d0) + (t_1 - (t_1 * t_1)))) - (z / (a - t))))
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t / (a - t);
return x + (y * (((-1.0 - Math.pow(t_1, 3.0)) / (-1.0 + (t_1 - (t_1 * t_1)))) - (z / (a - t))));
}
def code(x, y, z, t, a): t_1 = t / (a - t) return x + (y * (((-1.0 - math.pow(t_1, 3.0)) / (-1.0 + (t_1 - (t_1 * t_1)))) - (z / (a - t))))
function code(x, y, z, t, a) t_1 = Float64(t / Float64(a - t)) return Float64(x + Float64(y * Float64(Float64(Float64(-1.0 - (t_1 ^ 3.0)) / Float64(-1.0 + Float64(t_1 - Float64(t_1 * t_1)))) - Float64(z / Float64(a - t))))) end
function tmp = code(x, y, z, t, a) t_1 = t / (a - t); tmp = x + (y * (((-1.0 - (t_1 ^ 3.0)) / (-1.0 + (t_1 - (t_1 * t_1)))) - (z / (a - t)))); end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]}, N[(x + N[(y * N[(N[(N[(-1.0 - N[Power[t$95$1, 3.0], $MachinePrecision]), $MachinePrecision] / N[(-1.0 + N[(t$95$1 - N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{a - t}\\
x + y \cdot \left(\frac{-1 - {t_1}^{3}}{-1 + \left(t_1 - t_1 \cdot t_1\right)} - \frac{z}{a - t}\right)
\end{array}
\end{array}
Initial program 74.3%
sub-neg74.3%
distribute-frac-neg74.3%
distribute-rgt-neg-out74.3%
associate-/l*83.1%
div-sub83.1%
associate-+r-83.1%
associate-/r/83.6%
distribute-rgt-neg-out83.6%
associate-/r/83.1%
distribute-frac-neg83.1%
associate-+l+83.1%
associate-+r-88.1%
distribute-frac-neg88.1%
Simplified88.1%
Taylor expanded in y around 0 95.1%
flip3-+95.1%
frac-2neg95.1%
metadata-eval95.1%
metadata-eval95.1%
pow295.1%
*-un-lft-identity95.1%
Applied egg-rr95.1%
distribute-neg-in95.1%
metadata-eval95.1%
unsub-neg95.1%
distribute-neg-in95.1%
metadata-eval95.1%
unsub-neg95.1%
Simplified95.1%
unpow295.1%
Applied egg-rr95.1%
Final simplification95.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7e+118) (not (<= t 2.1e+115))) (- x (/ y (/ t (- a z)))) (+ x (- y (/ (- z t) (/ (- a t) y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7e+118) || !(t <= 2.1e+115)) {
tmp = x - (y / (t / (a - z)));
} else {
tmp = x + (y - ((z - t) / ((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 ((t <= (-7d+118)) .or. (.not. (t <= 2.1d+115))) then
tmp = x - (y / (t / (a - z)))
else
tmp = x + (y - ((z - t) / ((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 ((t <= -7e+118) || !(t <= 2.1e+115)) {
tmp = x - (y / (t / (a - z)));
} else {
tmp = x + (y - ((z - t) / ((a - t) / y)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7e+118) or not (t <= 2.1e+115): tmp = x - (y / (t / (a - z))) else: tmp = x + (y - ((z - t) / ((a - t) / y))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7e+118) || !(t <= 2.1e+115)) tmp = Float64(x - Float64(y / Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(y - Float64(Float64(z - t) / Float64(Float64(a - t) / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7e+118) || ~((t <= 2.1e+115))) tmp = x - (y / (t / (a - z))); else tmp = x + (y - ((z - t) / ((a - t) / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7e+118], N[Not[LessEqual[t, 2.1e+115]], $MachinePrecision]], N[(x - N[(y / N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y - N[(N[(z - t), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+118} \lor \neg \left(t \leq 2.1 \cdot 10^{+115}\right):\\
\;\;\;\;x - \frac{y}{\frac{t}{a - z}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - \frac{z - t}{\frac{a - t}{y}}\right)\\
\end{array}
\end{array}
if t < -7.00000000000000033e118 or 2.10000000000000003e115 < t Initial program 45.5%
sub-neg45.5%
distribute-frac-neg45.5%
distribute-rgt-neg-out45.5%
associate-/l*63.4%
div-sub63.5%
associate-+r-63.5%
associate-/r/64.9%
distribute-rgt-neg-out64.9%
associate-/r/63.5%
distribute-frac-neg63.5%
associate-+l+63.5%
associate-+r-74.7%
distribute-frac-neg74.7%
Simplified74.6%
Taylor expanded in y around 0 90.9%
Taylor expanded in t around inf 78.7%
associate-*r/78.7%
neg-mul-178.7%
+-commutative78.7%
distribute-lft-in78.6%
*-commutative78.6%
distribute-rgt-neg-in78.6%
neg-mul-178.6%
neg-mul-178.6%
+-commutative78.6%
sub-neg78.6%
*-commutative78.6%
distribute-rgt-out--78.7%
associate-*r/78.7%
mul-1-neg78.7%
associate-/l*90.3%
Simplified90.3%
if -7.00000000000000033e118 < t < 2.10000000000000003e115Initial program 88.6%
sub-neg88.6%
distribute-frac-neg88.6%
distribute-rgt-neg-out88.6%
associate-/l*92.8%
div-sub92.8%
associate-+r-92.8%
associate-/r/92.9%
distribute-rgt-neg-out92.9%
associate-/r/92.8%
distribute-frac-neg92.8%
associate-+l+92.8%
associate-+r-94.8%
distribute-frac-neg94.8%
Simplified94.8%
Final simplification93.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.55e+118) (not (<= t 1.9e+115))) (- x (/ y (/ t (- a z)))) (+ x (* y (+ 1.0 (/ (- t z) (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.55e+118) || !(t <= 1.9e+115)) {
tmp = x - (y / (t / (a - z)));
} 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 <= (-1.55d+118)) .or. (.not. (t <= 1.9d+115))) then
tmp = x - (y / (t / (a - z)))
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 <= -1.55e+118) || !(t <= 1.9e+115)) {
tmp = x - (y / (t / (a - z)));
} else {
tmp = x + (y * (1.0 + ((t - z) / (a - t))));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.55e+118) or not (t <= 1.9e+115): tmp = x - (y / (t / (a - z))) else: tmp = x + (y * (1.0 + ((t - z) / (a - t)))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.55e+118) || !(t <= 1.9e+115)) tmp = Float64(x - Float64(y / Float64(t / Float64(a - z)))); 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 <= -1.55e+118) || ~((t <= 1.9e+115))) tmp = x - (y / (t / (a - z))); else tmp = x + (y * (1.0 + ((t - z) / (a - t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.55e+118], N[Not[LessEqual[t, 1.9e+115]], $MachinePrecision]], N[(x - N[(y / N[(t / N[(a - z), $MachinePrecision]), $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 -1.55 \cdot 10^{+118} \lor \neg \left(t \leq 1.9 \cdot 10^{+115}\right):\\
\;\;\;\;x - \frac{y}{\frac{t}{a - z}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 + \frac{t - z}{a - t}\right)\\
\end{array}
\end{array}
if t < -1.54999999999999993e118 or 1.9e115 < t Initial program 45.5%
sub-neg45.5%
distribute-frac-neg45.5%
distribute-rgt-neg-out45.5%
associate-/l*63.4%
div-sub63.5%
associate-+r-63.5%
associate-/r/64.9%
distribute-rgt-neg-out64.9%
associate-/r/63.5%
distribute-frac-neg63.5%
associate-+l+63.5%
associate-+r-74.7%
distribute-frac-neg74.7%
Simplified74.6%
Taylor expanded in y around 0 90.9%
Taylor expanded in t around inf 78.7%
associate-*r/78.7%
neg-mul-178.7%
+-commutative78.7%
distribute-lft-in78.6%
*-commutative78.6%
distribute-rgt-neg-in78.6%
neg-mul-178.6%
neg-mul-178.6%
+-commutative78.6%
sub-neg78.6%
*-commutative78.6%
distribute-rgt-out--78.7%
associate-*r/78.7%
mul-1-neg78.7%
associate-/l*90.3%
Simplified90.3%
if -1.54999999999999993e118 < t < 1.9e115Initial program 88.6%
+-commutative88.6%
associate--l+88.6%
sub-neg88.6%
distribute-frac-neg88.6%
*-commutative88.6%
distribute-rgt-neg-in88.6%
associate-/l*94.2%
sub-neg94.2%
distribute-neg-in94.2%
remove-double-neg94.2%
+-commutative94.2%
sub-neg94.2%
Simplified94.2%
Taylor expanded in y around 0 97.2%
+-commutative97.2%
associate--l+96.5%
div-sub96.5%
Simplified96.5%
Final simplification94.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.8e+118) (not (<= t 2.6e+115))) (- x (* y (+ (/ z (- a t)) (/ 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 <= -3.8e+118) || !(t <= 2.6e+115)) {
tmp = x - (y * ((z / (a - t)) + (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 <= (-3.8d+118)) .or. (.not. (t <= 2.6d+115))) then
tmp = x - (y * ((z / (a - t)) + (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 <= -3.8e+118) || !(t <= 2.6e+115)) {
tmp = x - (y * ((z / (a - t)) + (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 <= -3.8e+118) or not (t <= 2.6e+115): tmp = x - (y * ((z / (a - t)) + (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 <= -3.8e+118) || !(t <= 2.6e+115)) tmp = Float64(x - Float64(y * Float64(Float64(z / Float64(a - t)) + Float64(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 <= -3.8e+118) || ~((t <= 2.6e+115))) tmp = x - (y * ((z / (a - t)) + (a / t))); else tmp = x + (y * (1.0 + ((t - z) / (a - t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.8e+118], N[Not[LessEqual[t, 2.6e+115]], $MachinePrecision]], N[(x - N[(y * N[(N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] + N[(a / t), $MachinePrecision]), $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 -3.8 \cdot 10^{+118} \lor \neg \left(t \leq 2.6 \cdot 10^{+115}\right):\\
\;\;\;\;x - y \cdot \left(\frac{z}{a - t} + \frac{a}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 + \frac{t - z}{a - t}\right)\\
\end{array}
\end{array}
if t < -3.80000000000000016e118 or 2.6e115 < t Initial program 45.5%
sub-neg45.5%
distribute-frac-neg45.5%
distribute-rgt-neg-out45.5%
associate-/l*63.4%
div-sub63.5%
associate-+r-63.5%
associate-/r/64.9%
distribute-rgt-neg-out64.9%
associate-/r/63.5%
distribute-frac-neg63.5%
associate-+l+63.5%
associate-+r-74.7%
distribute-frac-neg74.7%
Simplified74.6%
Taylor expanded in y around 0 90.9%
Taylor expanded in t around inf 91.5%
associate-*r/91.5%
mul-1-neg91.5%
Simplified91.5%
if -3.80000000000000016e118 < t < 2.6e115Initial program 88.6%
+-commutative88.6%
associate--l+88.6%
sub-neg88.6%
distribute-frac-neg88.6%
*-commutative88.6%
distribute-rgt-neg-in88.6%
associate-/l*94.2%
sub-neg94.2%
distribute-neg-in94.2%
remove-double-neg94.2%
+-commutative94.2%
sub-neg94.2%
Simplified94.2%
Taylor expanded in y around 0 97.2%
+-commutative97.2%
associate--l+96.5%
div-sub96.5%
Simplified96.5%
Final simplification94.9%
(FPCore (x y z t a) :precision binary64 (+ x (* y (- (+ (/ t (- a t)) 1.0) (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
return x + (y * (((t / (a - t)) + 1.0) - (z / (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 * (((t / (a - t)) + 1.0d0) - (z / (a - t))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * (((t / (a - t)) + 1.0) - (z / (a - t))));
}
def code(x, y, z, t, a): return x + (y * (((t / (a - t)) + 1.0) - (z / (a - t))))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(Float64(t / Float64(a - t)) + 1.0) - Float64(z / Float64(a - t))))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * (((t / (a - t)) + 1.0) - (z / (a - t)))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \left(\left(\frac{t}{a - t} + 1\right) - \frac{z}{a - t}\right)
\end{array}
Initial program 74.3%
sub-neg74.3%
distribute-frac-neg74.3%
distribute-rgt-neg-out74.3%
associate-/l*83.1%
div-sub83.1%
associate-+r-83.1%
associate-/r/83.6%
distribute-rgt-neg-out83.6%
associate-/r/83.1%
distribute-frac-neg83.1%
associate-+l+83.1%
associate-+r-88.1%
distribute-frac-neg88.1%
Simplified88.1%
Taylor expanded in y around 0 95.1%
Final simplification95.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1e+80) (not (<= t 1.3e+115))) (- x (/ y (/ t (- a z)))) (- (+ x y) (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1e+80) || !(t <= 1.3e+115)) {
tmp = x - (y / (t / (a - z)));
} else {
tmp = (x + y) - (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 ((t <= (-1d+80)) .or. (.not. (t <= 1.3d+115))) then
tmp = x - (y / (t / (a - z)))
else
tmp = (x + y) - (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 ((t <= -1e+80) || !(t <= 1.3e+115)) {
tmp = x - (y / (t / (a - z)));
} else {
tmp = (x + y) - (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1e+80) or not (t <= 1.3e+115): tmp = x - (y / (t / (a - z))) else: tmp = (x + y) - (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1e+80) || !(t <= 1.3e+115)) tmp = Float64(x - Float64(y / Float64(t / Float64(a - z)))); else tmp = Float64(Float64(x + y) - Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1e+80) || ~((t <= 1.3e+115))) tmp = x - (y / (t / (a - z))); else tmp = (x + y) - (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1e+80], N[Not[LessEqual[t, 1.3e+115]], $MachinePrecision]], N[(x - N[(y / N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+80} \lor \neg \left(t \leq 1.3 \cdot 10^{+115}\right):\\
\;\;\;\;x - \frac{y}{\frac{t}{a - z}}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -1e80 or 1.3e115 < t Initial program 45.4%
sub-neg45.4%
distribute-frac-neg45.4%
distribute-rgt-neg-out45.4%
associate-/l*63.1%
div-sub63.2%
associate-+r-63.2%
associate-/r/64.5%
distribute-rgt-neg-out64.5%
associate-/r/63.2%
distribute-frac-neg63.2%
associate-+l+63.2%
associate-+r-74.6%
distribute-frac-neg74.6%
Simplified74.5%
Taylor expanded in y around 0 91.6%
Taylor expanded in t around inf 78.3%
associate-*r/78.3%
neg-mul-178.3%
+-commutative78.3%
distribute-lft-in78.2%
*-commutative78.2%
distribute-rgt-neg-in78.2%
neg-mul-178.2%
neg-mul-178.2%
+-commutative78.2%
sub-neg78.2%
*-commutative78.2%
distribute-rgt-out--78.3%
associate-*r/78.3%
mul-1-neg78.3%
associate-/l*89.0%
Simplified89.0%
if -1e80 < t < 1.3e115Initial program 90.5%
associate-*l/95.2%
Simplified95.2%
Taylor expanded in z around inf 93.2%
Final simplification91.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.35e-37) (not (<= a 6e+57))) (+ x (* y (- 1.0 (/ z a)))) (+ x (/ y (/ t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.35e-37) || !(a <= 6e+57)) {
tmp = x + (y * (1.0 - (z / a)));
} 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 <= (-1.35d-37)) .or. (.not. (a <= 6d+57))) then
tmp = x + (y * (1.0d0 - (z / a)))
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 <= -1.35e-37) || !(a <= 6e+57)) {
tmp = x + (y * (1.0 - (z / a)));
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.35e-37) or not (a <= 6e+57): tmp = x + (y * (1.0 - (z / a))) else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.35e-37) || !(a <= 6e+57)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / a)))); 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 <= -1.35e-37) || ~((a <= 6e+57))) tmp = x + (y * (1.0 - (z / a))); else tmp = x + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.35e-37], N[Not[LessEqual[a, 6e+57]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{-37} \lor \neg \left(a \leq 6 \cdot 10^{+57}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if a < -1.35000000000000008e-37 or 5.9999999999999999e57 < a Initial program 76.5%
sub-neg76.5%
distribute-frac-neg76.5%
distribute-rgt-neg-out76.5%
associate-/l*90.0%
div-sub90.0%
associate-+r-90.0%
associate-/r/90.3%
distribute-rgt-neg-out90.3%
associate-/r/90.0%
distribute-frac-neg90.0%
associate-+l+90.0%
associate-+r-93.7%
distribute-frac-neg93.7%
Simplified93.7%
Taylor expanded in y around 0 96.9%
Taylor expanded in t around 0 87.3%
if -1.35000000000000008e-37 < a < 5.9999999999999999e57Initial program 72.1%
sub-neg72.1%
distribute-frac-neg72.1%
distribute-rgt-neg-out72.1%
associate-/l*76.4%
div-sub76.4%
associate-+r-76.4%
associate-/r/77.1%
distribute-rgt-neg-out77.1%
associate-/r/76.4%
distribute-frac-neg76.4%
associate-+l+76.4%
associate-+r-82.7%
distribute-frac-neg82.7%
Simplified82.7%
Taylor expanded in y around 0 93.4%
Taylor expanded in a around 0 75.7%
associate-/l*80.0%
Simplified80.0%
Final simplification83.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.3e+62) (not (<= t 2200000000000.0))) (- x (/ y (/ t (- a z)))) (+ x (* y (- 1.0 (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.3e+62) || !(t <= 2200000000000.0)) {
tmp = x - (y / (t / (a - z)));
} else {
tmp = x + (y * (1.0 - (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.3d+62)) .or. (.not. (t <= 2200000000000.0d0))) then
tmp = x - (y / (t / (a - z)))
else
tmp = x + (y * (1.0d0 - (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.3e+62) || !(t <= 2200000000000.0)) {
tmp = x - (y / (t / (a - z)));
} else {
tmp = x + (y * (1.0 - (z / a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.3e+62) or not (t <= 2200000000000.0): tmp = x - (y / (t / (a - z))) else: tmp = x + (y * (1.0 - (z / a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.3e+62) || !(t <= 2200000000000.0)) tmp = Float64(x - Float64(y / Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.3e+62) || ~((t <= 2200000000000.0))) tmp = x - (y / (t / (a - z))); else tmp = x + (y * (1.0 - (z / a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.3e+62], N[Not[LessEqual[t, 2200000000000.0]], $MachinePrecision]], N[(x - N[(y / N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{+62} \lor \neg \left(t \leq 2200000000000\right):\\
\;\;\;\;x - \frac{y}{\frac{t}{a - z}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{a}\right)\\
\end{array}
\end{array}
if t < -1.29999999999999992e62 or 2.2e12 < t Initial program 51.0%
sub-neg51.0%
distribute-frac-neg51.0%
distribute-rgt-neg-out51.0%
associate-/l*67.3%
div-sub67.3%
associate-+r-67.3%
associate-/r/68.4%
distribute-rgt-neg-out68.4%
associate-/r/67.3%
distribute-frac-neg67.3%
associate-+l+67.3%
associate-+r-77.6%
distribute-frac-neg77.6%
Simplified77.5%
Taylor expanded in y around 0 91.5%
Taylor expanded in t around inf 75.8%
associate-*r/75.8%
neg-mul-175.8%
+-commutative75.8%
distribute-lft-in75.8%
*-commutative75.8%
distribute-rgt-neg-in75.8%
neg-mul-175.8%
neg-mul-175.8%
+-commutative75.8%
sub-neg75.8%
*-commutative75.8%
distribute-rgt-out--75.8%
associate-*r/75.8%
mul-1-neg75.8%
associate-/l*84.6%
Simplified84.6%
if -1.29999999999999992e62 < t < 2.2e12Initial program 92.4%
sub-neg92.4%
distribute-frac-neg92.4%
distribute-rgt-neg-out92.4%
associate-/l*95.4%
div-sub95.4%
associate-+r-95.4%
associate-/r/95.4%
distribute-rgt-neg-out95.4%
associate-/r/95.4%
distribute-frac-neg95.4%
associate-+l+95.4%
associate-+r-96.4%
distribute-frac-neg96.4%
Simplified96.4%
Taylor expanded in y around 0 97.9%
Taylor expanded in t around 0 85.9%
Final simplification85.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.25e+41) (not (<= a 4.8e+59))) (+ x (* y (- 1.0 (/ z a)))) (- x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.25e+41) || !(a <= 4.8e+59)) {
tmp = x + (y * (1.0 - (z / a)));
} else {
tmp = x - (y / ((a - 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 <= (-1.25d+41)) .or. (.not. (a <= 4.8d+59))) then
tmp = x + (y * (1.0d0 - (z / a)))
else
tmp = x - (y / ((a - 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 <= -1.25e+41) || !(a <= 4.8e+59)) {
tmp = x + (y * (1.0 - (z / a)));
} else {
tmp = x - (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.25e+41) or not (a <= 4.8e+59): tmp = x + (y * (1.0 - (z / a))) else: tmp = x - (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.25e+41) || !(a <= 4.8e+59)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / a)))); else tmp = Float64(x - Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.25e+41) || ~((a <= 4.8e+59))) tmp = x + (y * (1.0 - (z / a))); else tmp = x - (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.25e+41], N[Not[LessEqual[a, 4.8e+59]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{+41} \lor \neg \left(a \leq 4.8 \cdot 10^{+59}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if a < -1.25000000000000006e41 or 4.8000000000000004e59 < a Initial program 75.9%
sub-neg75.9%
distribute-frac-neg75.9%
distribute-rgt-neg-out75.9%
associate-/l*91.2%
div-sub91.2%
associate-+r-91.2%
associate-/r/91.6%
distribute-rgt-neg-out91.6%
associate-/r/91.2%
distribute-frac-neg91.2%
associate-+l+91.2%
associate-+r-93.8%
distribute-frac-neg93.8%
Simplified93.8%
Taylor expanded in y around 0 96.5%
Taylor expanded in t around 0 90.4%
if -1.25000000000000006e41 < a < 4.8000000000000004e59Initial program 73.0%
sub-neg73.0%
distribute-frac-neg73.0%
distribute-rgt-neg-out73.0%
associate-/l*76.8%
div-sub76.9%
associate-+r-76.9%
associate-/r/77.5%
distribute-rgt-neg-out77.5%
associate-/r/76.9%
distribute-frac-neg76.9%
associate-+l+76.9%
associate-+r-83.8%
distribute-frac-neg83.8%
Simplified83.7%
Taylor expanded in y around 0 94.0%
Taylor expanded in z around inf 86.1%
mul-1-neg86.1%
associate-/l*90.0%
distribute-neg-frac90.0%
Simplified90.0%
Final simplification90.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -8.3e+43) (+ x (* y (+ (/ t (- a t)) 1.0))) (if (<= a 1e+60) (- x (/ y (/ (- a t) z))) (+ x (* y (- 1.0 (/ z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.3e+43) {
tmp = x + (y * ((t / (a - t)) + 1.0));
} else if (a <= 1e+60) {
tmp = x - (y / ((a - t) / z));
} else {
tmp = x + (y * (1.0 - (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 <= (-8.3d+43)) then
tmp = x + (y * ((t / (a - t)) + 1.0d0))
else if (a <= 1d+60) then
tmp = x - (y / ((a - t) / z))
else
tmp = x + (y * (1.0d0 - (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 <= -8.3e+43) {
tmp = x + (y * ((t / (a - t)) + 1.0));
} else if (a <= 1e+60) {
tmp = x - (y / ((a - t) / z));
} else {
tmp = x + (y * (1.0 - (z / a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -8.3e+43: tmp = x + (y * ((t / (a - t)) + 1.0)) elif a <= 1e+60: tmp = x - (y / ((a - t) / z)) else: tmp = x + (y * (1.0 - (z / a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8.3e+43) tmp = Float64(x + Float64(y * Float64(Float64(t / Float64(a - t)) + 1.0))); elseif (a <= 1e+60) tmp = Float64(x - Float64(y / Float64(Float64(a - t) / z))); else tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -8.3e+43) tmp = x + (y * ((t / (a - t)) + 1.0)); elseif (a <= 1e+60) tmp = x - (y / ((a - t) / z)); else tmp = x + (y * (1.0 - (z / a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8.3e+43], N[(x + N[(y * N[(N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1e+60], N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.3 \cdot 10^{+43}:\\
\;\;\;\;x + y \cdot \left(\frac{t}{a - t} + 1\right)\\
\mathbf{elif}\;a \leq 10^{+60}:\\
\;\;\;\;x - \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{a}\right)\\
\end{array}
\end{array}
if a < -8.29999999999999958e43Initial program 77.8%
sub-neg77.8%
distribute-frac-neg77.8%
distribute-rgt-neg-out77.8%
associate-/l*93.0%
div-sub93.0%
associate-+r-93.0%
associate-/r/93.6%
distribute-rgt-neg-out93.6%
associate-/r/93.0%
distribute-frac-neg93.0%
associate-+l+93.0%
associate-+r-96.5%
distribute-frac-neg96.5%
Simplified96.5%
Taylor expanded in y around 0 98.5%
Taylor expanded in z around 0 93.1%
if -8.29999999999999958e43 < a < 9.9999999999999995e59Initial program 73.0%
sub-neg73.0%
distribute-frac-neg73.0%
distribute-rgt-neg-out73.0%
associate-/l*76.8%
div-sub76.9%
associate-+r-76.9%
associate-/r/77.5%
distribute-rgt-neg-out77.5%
associate-/r/76.9%
distribute-frac-neg76.9%
associate-+l+76.9%
associate-+r-83.8%
distribute-frac-neg83.8%
Simplified83.7%
Taylor expanded in y around 0 94.0%
Taylor expanded in z around inf 86.1%
mul-1-neg86.1%
associate-/l*90.0%
distribute-neg-frac90.0%
Simplified90.0%
if 9.9999999999999995e59 < a Initial program 74.0%
sub-neg74.0%
distribute-frac-neg74.0%
distribute-rgt-neg-out74.0%
associate-/l*89.5%
div-sub89.5%
associate-+r-89.5%
associate-/r/89.5%
distribute-rgt-neg-out89.5%
associate-/r/89.5%
distribute-frac-neg89.5%
associate-+l+89.5%
associate-+r-91.3%
distribute-frac-neg91.3%
Simplified91.3%
Taylor expanded in y around 0 94.6%
Taylor expanded in t around 0 90.7%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.65e+39) (+ x y) (if (<= a 5.5e+60) (+ x (* z (/ y t))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.65e+39) {
tmp = x + y;
} else if (a <= 5.5e+60) {
tmp = x + (z * (y / t));
} else {
tmp = x + 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 <= (-1.65d+39)) then
tmp = x + y
else if (a <= 5.5d+60) then
tmp = x + (z * (y / t))
else
tmp = x + 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 <= -1.65e+39) {
tmp = x + y;
} else if (a <= 5.5e+60) {
tmp = x + (z * (y / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.65e+39: tmp = x + y elif a <= 5.5e+60: tmp = x + (z * (y / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.65e+39) tmp = Float64(x + y); elseif (a <= 5.5e+60) tmp = Float64(x + Float64(z * Float64(y / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.65e+39) tmp = x + y; elseif (a <= 5.5e+60) tmp = x + (z * (y / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.65e+39], N[(x + y), $MachinePrecision], If[LessEqual[a, 5.5e+60], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.65 \cdot 10^{+39}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{+60}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -1.6500000000000001e39 or 5.5000000000000001e60 < a Initial program 75.9%
+-commutative75.9%
associate--l+75.9%
sub-neg75.9%
distribute-frac-neg75.9%
*-commutative75.9%
distribute-rgt-neg-in75.9%
associate-/l*92.4%
sub-neg92.4%
distribute-neg-in92.4%
remove-double-neg92.4%
+-commutative92.4%
sub-neg92.4%
Simplified92.4%
Taylor expanded in a around inf 82.6%
+-commutative82.6%
Simplified82.6%
if -1.6500000000000001e39 < a < 5.5000000000000001e60Initial program 73.0%
sub-neg73.0%
distribute-frac-neg73.0%
distribute-rgt-neg-out73.0%
associate-/l*76.8%
div-sub76.9%
associate-+r-76.9%
associate-/r/77.5%
distribute-rgt-neg-out77.5%
associate-/r/76.9%
distribute-frac-neg76.9%
associate-+l+76.9%
associate-+r-83.8%
distribute-frac-neg83.8%
Simplified83.7%
Taylor expanded in y around 0 94.0%
Taylor expanded in a around 0 74.2%
associate-/l*78.0%
Simplified78.0%
associate-/r/77.4%
Applied egg-rr77.4%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.6e+39) (+ x y) (if (<= a 1.8e+58) (+ x (/ y (/ t z))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.6e+39) {
tmp = x + y;
} else if (a <= 1.8e+58) {
tmp = x + (y / (t / z));
} else {
tmp = x + 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 <= (-4.6d+39)) then
tmp = x + y
else if (a <= 1.8d+58) then
tmp = x + (y / (t / z))
else
tmp = x + 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 <= -4.6e+39) {
tmp = x + y;
} else if (a <= 1.8e+58) {
tmp = x + (y / (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.6e+39: tmp = x + y elif a <= 1.8e+58: tmp = x + (y / (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.6e+39) tmp = Float64(x + y); elseif (a <= 1.8e+58) tmp = Float64(x + Float64(y / Float64(t / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.6e+39) tmp = x + y; elseif (a <= 1.8e+58) tmp = x + (y / (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.6e+39], N[(x + y), $MachinePrecision], If[LessEqual[a, 1.8e+58], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.6 \cdot 10^{+39}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{+58}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -4.60000000000000024e39 or 1.79999999999999998e58 < a Initial program 75.9%
+-commutative75.9%
associate--l+75.9%
sub-neg75.9%
distribute-frac-neg75.9%
*-commutative75.9%
distribute-rgt-neg-in75.9%
associate-/l*92.4%
sub-neg92.4%
distribute-neg-in92.4%
remove-double-neg92.4%
+-commutative92.4%
sub-neg92.4%
Simplified92.4%
Taylor expanded in a around inf 82.6%
+-commutative82.6%
Simplified82.6%
if -4.60000000000000024e39 < a < 1.79999999999999998e58Initial program 73.0%
sub-neg73.0%
distribute-frac-neg73.0%
distribute-rgt-neg-out73.0%
associate-/l*76.8%
div-sub76.9%
associate-+r-76.9%
associate-/r/77.5%
distribute-rgt-neg-out77.5%
associate-/r/76.9%
distribute-frac-neg76.9%
associate-+l+76.9%
associate-+r-83.8%
distribute-frac-neg83.8%
Simplified83.7%
Taylor expanded in y around 0 94.0%
Taylor expanded in a around 0 74.2%
associate-/l*78.0%
Simplified78.0%
Final simplification80.0%
(FPCore (x y z t a) :precision binary64 (if (<= t 9.4e+207) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 9.4e+207) {
tmp = x + y;
} else {
tmp = 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 <= 9.4d+207) then
tmp = x + y
else
tmp = 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 <= 9.4e+207) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 9.4e+207: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 9.4e+207) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 9.4e+207) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 9.4e+207], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 9.4 \cdot 10^{+207}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < 9.39999999999999951e207Initial program 79.2%
+-commutative79.2%
associate--l+79.2%
sub-neg79.2%
distribute-frac-neg79.2%
*-commutative79.2%
distribute-rgt-neg-in79.2%
associate-/l*88.6%
sub-neg88.6%
distribute-neg-in88.6%
remove-double-neg88.6%
+-commutative88.6%
sub-neg88.6%
Simplified88.6%
Taylor expanded in a around inf 61.9%
+-commutative61.9%
Simplified61.9%
if 9.39999999999999951e207 < t Initial program 40.2%
+-commutative40.2%
associate--l+40.2%
sub-neg40.2%
distribute-frac-neg40.2%
*-commutative40.2%
distribute-rgt-neg-in40.2%
associate-/l*55.6%
sub-neg55.6%
distribute-neg-in55.6%
remove-double-neg55.6%
+-commutative55.6%
sub-neg55.6%
Simplified55.6%
Taylor expanded in y around 0 79.0%
Final simplification64.1%
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
return 0.0;
}
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 = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return 0.0;
}
def code(x, y, z, t, a): return 0.0
function code(x, y, z, t, a) return 0.0 end
function tmp = code(x, y, z, t, a) tmp = 0.0; end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 74.3%
+-commutative74.3%
associate--l+74.3%
sub-neg74.3%
distribute-frac-neg74.3%
*-commutative74.3%
distribute-rgt-neg-in74.3%
associate-/l*84.5%
sub-neg84.5%
distribute-neg-in84.5%
remove-double-neg84.5%
+-commutative84.5%
sub-neg84.5%
Simplified84.5%
Taylor expanded in x around 0 77.8%
associate-+r+74.3%
associate-*r/84.1%
*-commutative84.1%
+-commutative84.1%
*-commutative84.1%
associate-*r/74.3%
associate-*l/83.2%
*-commutative83.2%
fma-def83.4%
+-commutative83.4%
Simplified83.4%
Taylor expanded in x around 0 35.8%
*-commutative35.8%
associate-*r/42.2%
Simplified42.2%
Taylor expanded in t around inf 2.9%
distribute-rgt1-in2.9%
metadata-eval2.9%
mul0-lft2.9%
Simplified2.9%
Final simplification2.9%
(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 74.3%
+-commutative74.3%
associate--l+74.3%
sub-neg74.3%
distribute-frac-neg74.3%
*-commutative74.3%
distribute-rgt-neg-in74.3%
associate-/l*84.5%
sub-neg84.5%
distribute-neg-in84.5%
remove-double-neg84.5%
+-commutative84.5%
sub-neg84.5%
Simplified84.5%
Taylor expanded in y around 0 50.7%
Final simplification50.7%
(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 2023290
(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))))