
(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 11 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 (+ x (* y (- (+ (/ t (- a t)) 1.0) (/ z (- a t))))))
(t_2 (+ (+ x y) (/ (* y (- t z)) (- a t)))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -1e-199)
(+ x (+ y (/ (- t z) (/ (- a t) y))))
(if (<= t_2 0.0) (+ x (/ y (/ t (- z a)))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (((t / (a - t)) + 1.0) - (z / (a - t))));
double t_2 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -1e-199) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else if (t_2 <= 0.0) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (((t / (a - t)) + 1.0) - (z / (a - t))));
double t_2 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= -1e-199) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else if (t_2 <= 0.0) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (((t / (a - t)) + 1.0) - (z / (a - t)))) t_2 = (x + y) + ((y * (t - z)) / (a - t)) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= -1e-199: tmp = x + (y + ((t - z) / ((a - t) / y))) elif t_2 <= 0.0: tmp = x + (y / (t / (z - a))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(Float64(t / Float64(a - t)) + 1.0) - Float64(z / Float64(a - t))))) t_2 = Float64(Float64(x + y) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -1e-199) tmp = Float64(x + Float64(y + Float64(Float64(t - z) / Float64(Float64(a - t) / y)))); elseif (t_2 <= 0.0) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (((t / (a - t)) + 1.0) - (z / (a - t)))); t_2 = (x + y) + ((y * (t - z)) / (a - t)); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= -1e-199) tmp = x + (y + ((t - z) / ((a - t) / y))); elseif (t_2 <= 0.0) tmp = x + (y / (t / (z - a))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -1e-199], N[(x + N[(y + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \left(\left(\frac{t}{a - t} + 1\right) - \frac{z}{a - t}\right)\\
t_2 := \left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 \leq -1 \cdot 10^{-199}:\\
\;\;\;\;x + \left(y + \frac{t - z}{\frac{a - t}{y}}\right)\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0 or 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 68.4%
associate--l+68.5%
associate-/l*84.6%
Simplified84.6%
Taylor expanded in y around 0 92.3%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -9.99999999999999982e-200Initial program 98.3%
associate--l+98.3%
associate-/l*99.5%
Simplified99.5%
if -9.99999999999999982e-200 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 4.4%
associate--l+49.7%
sub-neg49.7%
distribute-frac-neg49.7%
distribute-rgt-neg-out49.7%
+-commutative49.7%
distribute-rgt-neg-out49.7%
distribute-lft-neg-in49.7%
associate-/l*21.8%
associate-/r/49.7%
fma-def49.7%
sub-neg49.7%
distribute-neg-in49.7%
remove-double-neg49.7%
+-commutative49.7%
sub-neg49.7%
Simplified49.7%
Taylor expanded in t around inf 49.7%
neg-mul-149.7%
associate-+r+99.7%
neg-mul-199.7%
distribute-rgt1-in99.7%
metadata-eval99.7%
mul0-lft99.7%
associate-/l*99.9%
Simplified99.9%
Final simplification95.3%
(FPCore (x y z t a)
:precision binary64
(if (<= a -9.4e+207)
(+ x y)
(if (<= a -1.28e+67)
(- x (* z (/ y a)))
(if (or (<= a -4e+21) (not (<= a 3e+53)))
(+ x y)
(+ x (* (- z a) (/ y t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.4e+207) {
tmp = x + y;
} else if (a <= -1.28e+67) {
tmp = x - (z * (y / a));
} else if ((a <= -4e+21) || !(a <= 3e+53)) {
tmp = x + y;
} else {
tmp = x + ((z - a) * (y / 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 <= (-9.4d+207)) then
tmp = x + y
else if (a <= (-1.28d+67)) then
tmp = x - (z * (y / a))
else if ((a <= (-4d+21)) .or. (.not. (a <= 3d+53))) then
tmp = x + y
else
tmp = x + ((z - a) * (y / 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 <= -9.4e+207) {
tmp = x + y;
} else if (a <= -1.28e+67) {
tmp = x - (z * (y / a));
} else if ((a <= -4e+21) || !(a <= 3e+53)) {
tmp = x + y;
} else {
tmp = x + ((z - a) * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9.4e+207: tmp = x + y elif a <= -1.28e+67: tmp = x - (z * (y / a)) elif (a <= -4e+21) or not (a <= 3e+53): tmp = x + y else: tmp = x + ((z - a) * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.4e+207) tmp = Float64(x + y); elseif (a <= -1.28e+67) tmp = Float64(x - Float64(z * Float64(y / a))); elseif ((a <= -4e+21) || !(a <= 3e+53)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(z - a) * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -9.4e+207) tmp = x + y; elseif (a <= -1.28e+67) tmp = x - (z * (y / a)); elseif ((a <= -4e+21) || ~((a <= 3e+53))) tmp = x + y; else tmp = x + ((z - a) * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.4e+207], N[(x + y), $MachinePrecision], If[LessEqual[a, -1.28e+67], N[(x - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -4e+21], N[Not[LessEqual[a, 3e+53]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(z - a), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.4 \cdot 10^{+207}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -1.28 \cdot 10^{+67}:\\
\;\;\;\;x - z \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq -4 \cdot 10^{+21} \lor \neg \left(a \leq 3 \cdot 10^{+53}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - a\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if a < -9.39999999999999951e207 or -1.28e67 < a < -4e21 or 2.99999999999999998e53 < a Initial program 71.5%
associate--l+71.5%
associate-/l*88.0%
Simplified88.0%
Taylor expanded in a around inf 78.4%
+-commutative78.4%
Simplified78.4%
if -9.39999999999999951e207 < a < -1.28e67Initial program 69.2%
associate--l+69.9%
associate-/l*84.4%
Simplified84.4%
Taylor expanded in t around 0 73.3%
sub-neg73.3%
associate-+r+73.3%
mul-1-neg73.3%
+-commutative73.3%
mul-1-neg73.3%
sub-neg73.3%
associate-/l*79.1%
Simplified79.1%
Taylor expanded in a around 0 70.6%
mul-1-neg70.6%
associate-*l/76.4%
distribute-rgt-neg-in76.4%
Simplified76.4%
if -4e21 < a < 2.99999999999999998e53Initial program 72.9%
associate--l+80.3%
associate-/l*80.8%
Simplified80.8%
Taylor expanded in y around 0 89.7%
Taylor expanded in t around inf 76.1%
distribute-rgt-in76.1%
mul-1-neg76.1%
cancel-sign-sub-inv76.1%
*-commutative76.1%
associate-*r/76.1%
distribute-lft-out--76.1%
div-sub75.4%
associate-*r/75.4%
associate-*r/75.4%
cancel-sign-sub-inv75.4%
metadata-eval75.4%
*-lft-identity75.4%
+-commutative75.4%
mul-1-neg75.4%
sub-neg75.4%
div-sub76.1%
Simplified81.7%
Final simplification80.0%
(FPCore (x y z t a)
:precision binary64
(if (<= a -9.4e+207)
(+ x y)
(if (<= a -2.4e+67)
(- x (* z (/ y a)))
(if (or (<= a -6.8e+26) (not (<= a 2.1e+53)))
(+ x y)
(+ x (/ (- z a) (/ t y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.4e+207) {
tmp = x + y;
} else if (a <= -2.4e+67) {
tmp = x - (z * (y / a));
} else if ((a <= -6.8e+26) || !(a <= 2.1e+53)) {
tmp = x + y;
} 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 <= (-9.4d+207)) then
tmp = x + y
else if (a <= (-2.4d+67)) then
tmp = x - (z * (y / a))
else if ((a <= (-6.8d+26)) .or. (.not. (a <= 2.1d+53))) then
tmp = x + y
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 <= -9.4e+207) {
tmp = x + y;
} else if (a <= -2.4e+67) {
tmp = x - (z * (y / a));
} else if ((a <= -6.8e+26) || !(a <= 2.1e+53)) {
tmp = x + y;
} else {
tmp = x + ((z - a) / (t / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9.4e+207: tmp = x + y elif a <= -2.4e+67: tmp = x - (z * (y / a)) elif (a <= -6.8e+26) or not (a <= 2.1e+53): tmp = x + y else: tmp = x + ((z - a) / (t / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.4e+207) tmp = Float64(x + y); elseif (a <= -2.4e+67) tmp = Float64(x - Float64(z * Float64(y / a))); elseif ((a <= -6.8e+26) || !(a <= 2.1e+53)) tmp = Float64(x + y); 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 <= -9.4e+207) tmp = x + y; elseif (a <= -2.4e+67) tmp = x - (z * (y / a)); elseif ((a <= -6.8e+26) || ~((a <= 2.1e+53))) tmp = x + y; else tmp = x + ((z - a) / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.4e+207], N[(x + y), $MachinePrecision], If[LessEqual[a, -2.4e+67], N[(x - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, -6.8e+26], N[Not[LessEqual[a, 2.1e+53]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(z - a), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.4 \cdot 10^{+207}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -2.4 \cdot 10^{+67}:\\
\;\;\;\;x - z \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq -6.8 \cdot 10^{+26} \lor \neg \left(a \leq 2.1 \cdot 10^{+53}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - a}{\frac{t}{y}}\\
\end{array}
\end{array}
if a < -9.39999999999999951e207 or -2.40000000000000002e67 < a < -6.8000000000000005e26 or 2.1000000000000002e53 < a Initial program 71.5%
associate--l+71.5%
associate-/l*88.0%
Simplified88.0%
Taylor expanded in a around inf 78.4%
+-commutative78.4%
Simplified78.4%
if -9.39999999999999951e207 < a < -2.40000000000000002e67Initial program 69.2%
associate--l+69.9%
associate-/l*84.4%
Simplified84.4%
Taylor expanded in t around 0 73.3%
sub-neg73.3%
associate-+r+73.3%
mul-1-neg73.3%
+-commutative73.3%
mul-1-neg73.3%
sub-neg73.3%
associate-/l*79.1%
Simplified79.1%
Taylor expanded in a around 0 70.6%
mul-1-neg70.6%
associate-*l/76.4%
distribute-rgt-neg-in76.4%
Simplified76.4%
if -6.8000000000000005e26 < a < 2.1000000000000002e53Initial program 72.9%
associate--l+80.3%
associate-/l*80.8%
Simplified80.8%
Taylor expanded in y around 0 89.7%
Taylor expanded in t around inf 76.1%
distribute-rgt-in76.1%
mul-1-neg76.1%
cancel-sign-sub-inv76.1%
*-commutative76.1%
associate-*r/76.1%
distribute-lft-out--76.1%
div-sub75.4%
associate-*r/75.4%
associate-*r/75.4%
cancel-sign-sub-inv75.4%
metadata-eval75.4%
*-lft-identity75.4%
+-commutative75.4%
mul-1-neg75.4%
sub-neg75.4%
div-sub76.1%
Simplified81.7%
clear-num81.6%
un-div-inv81.7%
Applied egg-rr81.7%
Final simplification80.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.05e+206)
(+ x (/ (- z a) (/ t y)))
(if (<= t 7.2e+98)
(+ x (+ y (/ (- t z) (/ (- a t) y))))
(+ x (* (- z a) (/ y t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.05e+206) {
tmp = x + ((z - a) / (t / y));
} else if (t <= 7.2e+98) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else {
tmp = x + ((z - a) * (y / 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.05d+206)) then
tmp = x + ((z - a) / (t / y))
else if (t <= 7.2d+98) then
tmp = x + (y + ((t - z) / ((a - t) / y)))
else
tmp = x + ((z - a) * (y / 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.05e+206) {
tmp = x + ((z - a) / (t / y));
} else if (t <= 7.2e+98) {
tmp = x + (y + ((t - z) / ((a - t) / y)));
} else {
tmp = x + ((z - a) * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.05e+206: tmp = x + ((z - a) / (t / y)) elif t <= 7.2e+98: tmp = x + (y + ((t - z) / ((a - t) / y))) else: tmp = x + ((z - a) * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.05e+206) tmp = Float64(x + Float64(Float64(z - a) / Float64(t / y))); elseif (t <= 7.2e+98) tmp = Float64(x + Float64(y + Float64(Float64(t - z) / Float64(Float64(a - t) / y)))); else tmp = Float64(x + Float64(Float64(z - a) * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.05e+206) tmp = x + ((z - a) / (t / y)); elseif (t <= 7.2e+98) tmp = x + (y + ((t - z) / ((a - t) / y))); else tmp = x + ((z - a) * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.05e+206], N[(x + N[(N[(z - a), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e+98], N[(x + N[(y + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - a), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.05 \cdot 10^{+206}:\\
\;\;\;\;x + \frac{z - a}{\frac{t}{y}}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+98}:\\
\;\;\;\;x + \left(y + \frac{t - z}{\frac{a - t}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - a\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -3.04999999999999983e206Initial program 37.0%
associate--l+46.6%
associate-/l*51.7%
Simplified51.7%
Taylor expanded in y around 0 80.7%
Taylor expanded in t around inf 71.4%
distribute-rgt-in71.0%
mul-1-neg71.0%
cancel-sign-sub-inv71.0%
*-commutative71.0%
associate-*r/71.0%
distribute-lft-out--71.0%
div-sub71.0%
associate-*r/71.0%
associate-*r/71.0%
cancel-sign-sub-inv71.0%
metadata-eval71.0%
*-lft-identity71.0%
+-commutative71.0%
mul-1-neg71.0%
sub-neg71.0%
div-sub71.0%
Simplified93.5%
clear-num93.5%
un-div-inv93.5%
Applied egg-rr93.5%
if -3.04999999999999983e206 < t < 7.19999999999999962e98Initial program 82.7%
associate--l+84.9%
associate-/l*92.3%
Simplified92.3%
if 7.19999999999999962e98 < t Initial program 50.2%
associate--l+59.8%
associate-/l*67.4%
Simplified67.4%
Taylor expanded in y around 0 88.5%
Taylor expanded in t around inf 73.2%
distribute-rgt-in73.0%
mul-1-neg73.0%
cancel-sign-sub-inv73.0%
*-commutative73.0%
associate-*r/73.0%
distribute-lft-out--73.0%
div-sub73.0%
associate-*r/73.0%
associate-*r/73.0%
cancel-sign-sub-inv73.0%
metadata-eval73.0%
*-lft-identity73.0%
+-commutative73.0%
mul-1-neg73.0%
sub-neg73.0%
div-sub73.0%
Simplified93.4%
Final simplification92.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.8e-36)
(+ x (/ (- z a) (/ t y)))
(if (<= t 2.1e-115)
(+ x (- y (/ y (/ a z))))
(if (<= t 4.05e+39)
(- x (/ (* y z) (- a t)))
(+ x (* (- z a) (/ y t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.8e-36) {
tmp = x + ((z - a) / (t / y));
} else if (t <= 2.1e-115) {
tmp = x + (y - (y / (a / z)));
} else if (t <= 4.05e+39) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = x + ((z - a) * (y / 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-36)) then
tmp = x + ((z - a) / (t / y))
else if (t <= 2.1d-115) then
tmp = x + (y - (y / (a / z)))
else if (t <= 4.05d+39) then
tmp = x - ((y * z) / (a - t))
else
tmp = x + ((z - a) * (y / 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-36) {
tmp = x + ((z - a) / (t / y));
} else if (t <= 2.1e-115) {
tmp = x + (y - (y / (a / z)));
} else if (t <= 4.05e+39) {
tmp = x - ((y * z) / (a - t));
} else {
tmp = x + ((z - a) * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.8e-36: tmp = x + ((z - a) / (t / y)) elif t <= 2.1e-115: tmp = x + (y - (y / (a / z))) elif t <= 4.05e+39: tmp = x - ((y * z) / (a - t)) else: tmp = x + ((z - a) * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.8e-36) tmp = Float64(x + Float64(Float64(z - a) / Float64(t / y))); elseif (t <= 2.1e-115) tmp = Float64(x + Float64(y - Float64(y / Float64(a / z)))); elseif (t <= 4.05e+39) tmp = Float64(x - Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(x + Float64(Float64(z - a) * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.8e-36) tmp = x + ((z - a) / (t / y)); elseif (t <= 2.1e-115) tmp = x + (y - (y / (a / z))); elseif (t <= 4.05e+39) tmp = x - ((y * z) / (a - t)); else tmp = x + ((z - a) * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.8e-36], N[(x + N[(N[(z - a), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e-115], N[(x + N[(y - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.05e+39], N[(x - N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - a), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{-36}:\\
\;\;\;\;x + \frac{z - a}{\frac{t}{y}}\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-115}:\\
\;\;\;\;x + \left(y - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{elif}\;t \leq 4.05 \cdot 10^{+39}:\\
\;\;\;\;x - \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - a\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -3.79999999999999971e-36Initial program 51.0%
associate--l+57.9%
associate-/l*68.4%
Simplified68.4%
Taylor expanded in y around 0 87.1%
Taylor expanded in t around inf 71.6%
distribute-rgt-in71.2%
mul-1-neg71.2%
cancel-sign-sub-inv71.2%
*-commutative71.2%
associate-*r/71.2%
distribute-lft-out--71.2%
div-sub71.2%
associate-*r/71.2%
associate-*r/71.2%
cancel-sign-sub-inv71.2%
metadata-eval71.2%
*-lft-identity71.2%
+-commutative71.2%
mul-1-neg71.2%
sub-neg71.2%
div-sub71.2%
Simplified85.6%
clear-num85.6%
un-div-inv85.6%
Applied egg-rr85.6%
if -3.79999999999999971e-36 < t < 2.10000000000000002e-115Initial program 90.0%
associate--l+90.0%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in t around 0 80.5%
sub-neg80.5%
associate-+r+80.5%
mul-1-neg80.5%
+-commutative80.5%
mul-1-neg80.5%
sub-neg80.5%
associate-/l*85.0%
Simplified85.0%
if 2.10000000000000002e-115 < t < 4.0499999999999999e39Initial program 96.7%
associate--l+99.4%
associate-/l*99.4%
Simplified99.4%
Taylor expanded in z around inf 91.7%
associate-*r/91.7%
mul-1-neg91.7%
*-commutative91.7%
distribute-lft-neg-in91.7%
Simplified91.7%
if 4.0499999999999999e39 < t Initial program 52.9%
associate--l+62.4%
associate-/l*71.5%
Simplified71.5%
Taylor expanded in y around 0 89.1%
Taylor expanded in t around inf 70.9%
distribute-rgt-in70.8%
mul-1-neg70.8%
cancel-sign-sub-inv70.8%
*-commutative70.8%
associate-*r/70.8%
distribute-lft-out--70.8%
div-sub70.8%
associate-*r/70.8%
associate-*r/70.8%
cancel-sign-sub-inv70.8%
metadata-eval70.8%
*-lft-identity70.8%
+-commutative70.8%
mul-1-neg70.8%
sub-neg70.8%
div-sub70.8%
Simplified87.6%
Final simplification86.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.7e-36)
(+ x (/ (- z a) (/ t y)))
(if (<= t 3.75e+40)
(+ x (* y (- 1.0 (/ z (- a t)))))
(+ x (* (- z a) (/ y t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.7e-36) {
tmp = x + ((z - a) / (t / y));
} else if (t <= 3.75e+40) {
tmp = x + (y * (1.0 - (z / (a - t))));
} else {
tmp = x + ((z - a) * (y / 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 <= (-4.7d-36)) then
tmp = x + ((z - a) / (t / y))
else if (t <= 3.75d+40) then
tmp = x + (y * (1.0d0 - (z / (a - t))))
else
tmp = x + ((z - a) * (y / 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 <= -4.7e-36) {
tmp = x + ((z - a) / (t / y));
} else if (t <= 3.75e+40) {
tmp = x + (y * (1.0 - (z / (a - t))));
} else {
tmp = x + ((z - a) * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.7e-36: tmp = x + ((z - a) / (t / y)) elif t <= 3.75e+40: tmp = x + (y * (1.0 - (z / (a - t)))) else: tmp = x + ((z - a) * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.7e-36) tmp = Float64(x + Float64(Float64(z - a) / Float64(t / y))); elseif (t <= 3.75e+40) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / Float64(a - t))))); else tmp = Float64(x + Float64(Float64(z - a) * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.7e-36) tmp = x + ((z - a) / (t / y)); elseif (t <= 3.75e+40) tmp = x + (y * (1.0 - (z / (a - t)))); else tmp = x + ((z - a) * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.7e-36], N[(x + N[(N[(z - a), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.75e+40], N[(x + N[(y * N[(1.0 - N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - a), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.7 \cdot 10^{-36}:\\
\;\;\;\;x + \frac{z - a}{\frac{t}{y}}\\
\mathbf{elif}\;t \leq 3.75 \cdot 10^{+40}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{a - t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - a\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -4.7000000000000003e-36Initial program 51.0%
associate--l+57.9%
associate-/l*68.4%
Simplified68.4%
Taylor expanded in y around 0 87.1%
Taylor expanded in t around inf 71.6%
distribute-rgt-in71.2%
mul-1-neg71.2%
cancel-sign-sub-inv71.2%
*-commutative71.2%
associate-*r/71.2%
distribute-lft-out--71.2%
div-sub71.2%
associate-*r/71.2%
associate-*r/71.2%
cancel-sign-sub-inv71.2%
metadata-eval71.2%
*-lft-identity71.2%
+-commutative71.2%
mul-1-neg71.2%
sub-neg71.2%
div-sub71.2%
Simplified85.6%
clear-num85.6%
un-div-inv85.6%
Applied egg-rr85.6%
if -4.7000000000000003e-36 < t < 3.7499999999999998e40Initial program 91.6%
associate--l+92.2%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in y around 0 93.1%
Taylor expanded in t around 0 90.9%
if 3.7499999999999998e40 < t Initial program 52.9%
associate--l+62.4%
associate-/l*71.5%
Simplified71.5%
Taylor expanded in y around 0 89.1%
Taylor expanded in t around inf 70.9%
distribute-rgt-in70.8%
mul-1-neg70.8%
cancel-sign-sub-inv70.8%
*-commutative70.8%
associate-*r/70.8%
distribute-lft-out--70.8%
div-sub70.8%
associate-*r/70.8%
associate-*r/70.8%
cancel-sign-sub-inv70.8%
metadata-eval70.8%
*-lft-identity70.8%
+-commutative70.8%
mul-1-neg70.8%
sub-neg70.8%
div-sub70.8%
Simplified87.6%
Final simplification88.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.7e-36)
(+ x (/ (- z a) (/ t y)))
(if (<= t 3.45e+40)
(+ x (- y (/ y (/ (- a t) z))))
(+ x (* (- z a) (/ y t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.7e-36) {
tmp = x + ((z - a) / (t / y));
} else if (t <= 3.45e+40) {
tmp = x + (y - (y / ((a - t) / z)));
} else {
tmp = x + ((z - a) * (y / 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 <= (-4.7d-36)) then
tmp = x + ((z - a) / (t / y))
else if (t <= 3.45d+40) then
tmp = x + (y - (y / ((a - t) / z)))
else
tmp = x + ((z - a) * (y / 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 <= -4.7e-36) {
tmp = x + ((z - a) / (t / y));
} else if (t <= 3.45e+40) {
tmp = x + (y - (y / ((a - t) / z)));
} else {
tmp = x + ((z - a) * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.7e-36: tmp = x + ((z - a) / (t / y)) elif t <= 3.45e+40: tmp = x + (y - (y / ((a - t) / z))) else: tmp = x + ((z - a) * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.7e-36) tmp = Float64(x + Float64(Float64(z - a) / Float64(t / y))); elseif (t <= 3.45e+40) tmp = Float64(x + Float64(y - Float64(y / Float64(Float64(a - t) / z)))); else tmp = Float64(x + Float64(Float64(z - a) * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.7e-36) tmp = x + ((z - a) / (t / y)); elseif (t <= 3.45e+40) tmp = x + (y - (y / ((a - t) / z))); else tmp = x + ((z - a) * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.7e-36], N[(x + N[(N[(z - a), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.45e+40], N[(x + N[(y - N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - a), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.7 \cdot 10^{-36}:\\
\;\;\;\;x + \frac{z - a}{\frac{t}{y}}\\
\mathbf{elif}\;t \leq 3.45 \cdot 10^{+40}:\\
\;\;\;\;x + \left(y - \frac{y}{\frac{a - t}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - a\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -4.7000000000000003e-36Initial program 51.0%
associate--l+57.9%
associate-/l*68.4%
Simplified68.4%
Taylor expanded in y around 0 87.1%
Taylor expanded in t around inf 71.6%
distribute-rgt-in71.2%
mul-1-neg71.2%
cancel-sign-sub-inv71.2%
*-commutative71.2%
associate-*r/71.2%
distribute-lft-out--71.2%
div-sub71.2%
associate-*r/71.2%
associate-*r/71.2%
cancel-sign-sub-inv71.2%
metadata-eval71.2%
*-lft-identity71.2%
+-commutative71.2%
mul-1-neg71.2%
sub-neg71.2%
div-sub71.2%
Simplified85.6%
clear-num85.6%
un-div-inv85.6%
Applied egg-rr85.6%
if -4.7000000000000003e-36 < t < 3.4500000000000001e40Initial program 91.6%
associate--l+92.2%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in z around inf 90.9%
associate-/l*91.5%
Simplified91.5%
if 3.4500000000000001e40 < t Initial program 52.9%
associate--l+62.4%
associate-/l*71.5%
Simplified71.5%
Taylor expanded in y around 0 89.1%
Taylor expanded in t around inf 70.9%
distribute-rgt-in70.8%
mul-1-neg70.8%
cancel-sign-sub-inv70.8%
*-commutative70.8%
associate-*r/70.8%
distribute-lft-out--70.8%
div-sub70.8%
associate-*r/70.8%
associate-*r/70.8%
cancel-sign-sub-inv70.8%
metadata-eval70.8%
*-lft-identity70.8%
+-commutative70.8%
mul-1-neg70.8%
sub-neg70.8%
div-sub70.8%
Simplified87.6%
Final simplification89.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.7e-36) (+ x (/ (- z a) (/ t y))) (if (<= t 2.5e-13) (+ x (- y (/ y (/ a z)))) (+ x (* (- z a) (/ y t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.7e-36) {
tmp = x + ((z - a) / (t / y));
} else if (t <= 2.5e-13) {
tmp = x + (y - (y / (a / z)));
} else {
tmp = x + ((z - a) * (y / 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.7d-36)) then
tmp = x + ((z - a) / (t / y))
else if (t <= 2.5d-13) then
tmp = x + (y - (y / (a / z)))
else
tmp = x + ((z - a) * (y / 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.7e-36) {
tmp = x + ((z - a) / (t / y));
} else if (t <= 2.5e-13) {
tmp = x + (y - (y / (a / z)));
} else {
tmp = x + ((z - a) * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.7e-36: tmp = x + ((z - a) / (t / y)) elif t <= 2.5e-13: tmp = x + (y - (y / (a / z))) else: tmp = x + ((z - a) * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.7e-36) tmp = Float64(x + Float64(Float64(z - a) / Float64(t / y))); elseif (t <= 2.5e-13) tmp = Float64(x + Float64(y - Float64(y / Float64(a / z)))); else tmp = Float64(x + Float64(Float64(z - a) * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.7e-36) tmp = x + ((z - a) / (t / y)); elseif (t <= 2.5e-13) tmp = x + (y - (y / (a / z))); else tmp = x + ((z - a) * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.7e-36], N[(x + N[(N[(z - a), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e-13], N[(x + N[(y - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - a), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{-36}:\\
\;\;\;\;x + \frac{z - a}{\frac{t}{y}}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-13}:\\
\;\;\;\;x + \left(y - \frac{y}{\frac{a}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - a\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -1.7000000000000001e-36Initial program 51.0%
associate--l+57.9%
associate-/l*68.4%
Simplified68.4%
Taylor expanded in y around 0 87.1%
Taylor expanded in t around inf 71.6%
distribute-rgt-in71.2%
mul-1-neg71.2%
cancel-sign-sub-inv71.2%
*-commutative71.2%
associate-*r/71.2%
distribute-lft-out--71.2%
div-sub71.2%
associate-*r/71.2%
associate-*r/71.2%
cancel-sign-sub-inv71.2%
metadata-eval71.2%
*-lft-identity71.2%
+-commutative71.2%
mul-1-neg71.2%
sub-neg71.2%
div-sub71.2%
Simplified85.6%
clear-num85.6%
un-div-inv85.6%
Applied egg-rr85.6%
if -1.7000000000000001e-36 < t < 2.49999999999999995e-13Initial program 90.9%
associate--l+91.6%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in t around 0 78.5%
sub-neg78.5%
associate-+r+78.5%
mul-1-neg78.5%
+-commutative78.5%
mul-1-neg78.5%
sub-neg78.5%
associate-/l*82.1%
Simplified82.1%
if 2.49999999999999995e-13 < t Initial program 60.0%
associate--l+68.0%
associate-/l*75.8%
Simplified75.8%
Taylor expanded in y around 0 90.8%
Taylor expanded in t around inf 72.4%
distribute-rgt-in72.3%
mul-1-neg72.3%
cancel-sign-sub-inv72.3%
*-commutative72.3%
associate-*r/72.3%
distribute-lft-out--72.3%
div-sub72.3%
associate-*r/72.3%
associate-*r/72.3%
cancel-sign-sub-inv72.3%
metadata-eval72.3%
*-lft-identity72.3%
+-commutative72.3%
mul-1-neg72.3%
sub-neg72.3%
div-sub72.3%
Simplified86.7%
Final simplification84.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.7e+112) (not (<= a 1.45e+53))) (+ x y) (+ x (* z (/ y t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.7e+112) || !(a <= 1.45e+53)) {
tmp = x + y;
} else {
tmp = x + (z * (y / 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.7d+112)) .or. (.not. (a <= 1.45d+53))) then
tmp = x + y
else
tmp = x + (z * (y / 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.7e+112) || !(a <= 1.45e+53)) {
tmp = x + y;
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.7e+112) or not (a <= 1.45e+53): tmp = x + y else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.7e+112) || !(a <= 1.45e+53)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.7e+112) || ~((a <= 1.45e+53))) tmp = x + y; else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.7e+112], N[Not[LessEqual[a, 1.45e+53]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.7 \cdot 10^{+112} \lor \neg \left(a \leq 1.45 \cdot 10^{+53}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if a < -1.69999999999999997e112 or 1.4500000000000001e53 < a Initial program 71.5%
associate--l+71.5%
associate-/l*88.7%
Simplified88.7%
Taylor expanded in a around inf 76.3%
+-commutative76.3%
Simplified76.3%
if -1.69999999999999997e112 < a < 1.4500000000000001e53Initial program 72.3%
associate--l+79.0%
associate-/l*80.6%
Simplified80.6%
Taylor expanded in y around 0 89.8%
Taylor expanded in a around 0 69.6%
associate-/l*74.6%
Simplified74.6%
associate-/r/75.7%
Applied egg-rr75.7%
Final simplification75.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.6e+44) (not (<= a 1.3e-88))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.6e+44) || !(a <= 1.3e-88)) {
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 ((a <= (-1.6d+44)) .or. (.not. (a <= 1.3d-88))) 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 ((a <= -1.6e+44) || !(a <= 1.3e-88)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.6e+44) or not (a <= 1.3e-88): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.6e+44) || !(a <= 1.3e-88)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.6e+44) || ~((a <= 1.3e-88))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.6e+44], N[Not[LessEqual[a, 1.3e-88]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{+44} \lor \neg \left(a \leq 1.3 \cdot 10^{-88}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.60000000000000002e44 or 1.30000000000000007e-88 < a Initial program 72.5%
associate--l+73.4%
associate-/l*86.8%
Simplified86.8%
Taylor expanded in a around inf 67.5%
+-commutative67.5%
Simplified67.5%
if -1.60000000000000002e44 < a < 1.30000000000000007e-88Initial program 71.4%
associate--l+79.5%
associate-/l*79.8%
Simplified79.8%
Taylor expanded in x around inf 46.1%
Final simplification57.3%
(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 72.0%
associate--l+76.3%
associate-/l*83.5%
Simplified83.5%
Taylor expanded in x around inf 45.4%
Final simplification45.4%
(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 2023333
(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))))