
(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 16 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
(if (<= t -1.75e+137)
(- x (/ 1.0 (/ (/ t y) (- a z))))
(if (<= t 0.00015)
(+ x (- y (/ (- z t) (/ (- a t) y))))
(- x (* y (+ (/ z (- a t)) (/ a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.75e+137) {
tmp = x - (1.0 / ((t / y) / (a - z)));
} else if (t <= 0.00015) {
tmp = x + (y - ((z - t) / ((a - t) / y)));
} else {
tmp = x - (y * ((z / (a - t)) + (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.75d+137)) then
tmp = x - (1.0d0 / ((t / y) / (a - z)))
else if (t <= 0.00015d0) then
tmp = x + (y - ((z - t) / ((a - t) / y)))
else
tmp = x - (y * ((z / (a - t)) + (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.75e+137) {
tmp = x - (1.0 / ((t / y) / (a - z)));
} else if (t <= 0.00015) {
tmp = x + (y - ((z - t) / ((a - t) / y)));
} else {
tmp = x - (y * ((z / (a - t)) + (a / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.75e+137: tmp = x - (1.0 / ((t / y) / (a - z))) elif t <= 0.00015: tmp = x + (y - ((z - t) / ((a - t) / y))) else: tmp = x - (y * ((z / (a - t)) + (a / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.75e+137) tmp = Float64(x - Float64(1.0 / Float64(Float64(t / y) / Float64(a - z)))); elseif (t <= 0.00015) tmp = Float64(x + Float64(y - Float64(Float64(z - t) / Float64(Float64(a - t) / y)))); else tmp = Float64(x - Float64(y * Float64(Float64(z / Float64(a - t)) + Float64(a / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.75e+137) tmp = x - (1.0 / ((t / y) / (a - z))); elseif (t <= 0.00015) tmp = x + (y - ((z - t) / ((a - t) / y))); else tmp = x - (y * ((z / (a - t)) + (a / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.75e+137], N[(x - N[(1.0 / N[(N[(t / y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.00015], N[(x + N[(y - N[(N[(z - t), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] + N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.75 \cdot 10^{+137}:\\
\;\;\;\;x - \frac{1}{\frac{\frac{t}{y}}{a - z}}\\
\mathbf{elif}\;t \leq 0.00015:\\
\;\;\;\;x + \left(y - \frac{z - t}{\frac{a - t}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \left(\frac{z}{a - t} + \frac{a}{t}\right)\\
\end{array}
\end{array}
if t < -1.7500000000000001e137Initial program 56.8%
associate--l+70.3%
associate-/l*67.7%
Simplified67.7%
Taylor expanded in t around -inf 82.5%
+-commutative82.5%
sub-neg82.5%
mul-1-neg82.5%
mul-1-neg82.5%
unsub-neg82.5%
mul-1-neg82.5%
sub-neg82.5%
distribute-lft-out--82.7%
Simplified82.7%
clear-num82.6%
inv-pow82.6%
Applied egg-rr82.6%
unpow-182.6%
associate-/r*97.3%
Simplified97.3%
if -1.7500000000000001e137 < t < 1.49999999999999987e-4Initial program 90.9%
associate--l+91.7%
associate-/l*94.9%
Simplified94.9%
if 1.49999999999999987e-4 < t Initial program 56.1%
associate--l+61.7%
sub-neg61.7%
+-commutative61.7%
associate-/l*74.3%
distribute-neg-frac74.3%
associate-/r/78.1%
fma-def78.3%
sub-neg78.3%
+-commutative78.3%
distribute-neg-in78.3%
unsub-neg78.3%
remove-double-neg78.3%
Simplified78.3%
Taylor expanded in y around 0 89.8%
Taylor expanded in t around inf 90.2%
associate-*r/90.2%
neg-mul-190.2%
Simplified90.2%
Final simplification93.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.2e+136) (not (<= t 8e-7))) (+ x (/ -1.0 (/ (/ t y) (- a z)))) (+ x (+ y (/ (- t z) (/ (- a t) y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.2e+136) || !(t <= 8e-7)) {
tmp = x + (-1.0 / ((t / y) / (a - z)));
} else {
tmp = x + (y + ((t - 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 ((t <= (-5.2d+136)) .or. (.not. (t <= 8d-7))) then
tmp = x + ((-1.0d0) / ((t / y) / (a - z)))
else
tmp = x + (y + ((t - 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 ((t <= -5.2e+136) || !(t <= 8e-7)) {
tmp = x + (-1.0 / ((t / y) / (a - z)));
} else {
tmp = x + (y + ((t - z) / ((a - t) / y)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.2e+136) or not (t <= 8e-7): tmp = x + (-1.0 / ((t / y) / (a - z))) else: tmp = x + (y + ((t - z) / ((a - t) / y))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.2e+136) || !(t <= 8e-7)) tmp = Float64(x + Float64(-1.0 / Float64(Float64(t / y) / Float64(a - z)))); else tmp = Float64(x + Float64(y + Float64(Float64(t - z) / Float64(Float64(a - t) / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.2e+136) || ~((t <= 8e-7))) tmp = x + (-1.0 / ((t / y) / (a - z))); else tmp = x + (y + ((t - z) / ((a - t) / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.2e+136], N[Not[LessEqual[t, 8e-7]], $MachinePrecision]], N[(x + N[(-1.0 / N[(N[(t / y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{+136} \lor \neg \left(t \leq 8 \cdot 10^{-7}\right):\\
\;\;\;\;x + \frac{-1}{\frac{\frac{t}{y}}{a - z}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \frac{t - z}{\frac{a - t}{y}}\right)\\
\end{array}
\end{array}
if t < -5.2000000000000003e136 or 7.9999999999999996e-7 < t Initial program 56.3%
associate--l+64.8%
associate-/l*72.0%
Simplified72.0%
Taylor expanded in t around -inf 82.2%
+-commutative82.2%
sub-neg82.2%
mul-1-neg82.2%
mul-1-neg82.2%
unsub-neg82.2%
mul-1-neg82.2%
sub-neg82.2%
distribute-lft-out--82.3%
Simplified82.3%
clear-num82.2%
inv-pow82.2%
Applied egg-rr82.2%
unpow-182.2%
associate-/r*92.5%
Simplified92.5%
if -5.2000000000000003e136 < t < 7.9999999999999996e-7Initial program 90.9%
associate--l+91.7%
associate-/l*94.9%
Simplified94.9%
Final simplification93.9%
(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 76.0%
associate--l+80.1%
sub-neg80.1%
+-commutative80.1%
associate-/l*85.0%
distribute-neg-frac85.0%
associate-/r/85.8%
fma-def85.9%
sub-neg85.9%
+-commutative85.9%
distribute-neg-in85.9%
unsub-neg85.9%
remove-double-neg85.9%
Simplified85.9%
Taylor expanded in y around 0 90.4%
Final simplification90.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.4e+136) (not (<= t 0.00015))) (- x (/ y (/ t (- a z)))) (+ x (- y (/ y (/ (- a t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.4e+136) || !(t <= 0.00015)) {
tmp = x - (y / (t / (a - z)));
} else {
tmp = x + (y - (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 ((t <= (-5.4d+136)) .or. (.not. (t <= 0.00015d0))) then
tmp = x - (y / (t / (a - z)))
else
tmp = x + (y - (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 ((t <= -5.4e+136) || !(t <= 0.00015)) {
tmp = x - (y / (t / (a - z)));
} else {
tmp = x + (y - (y / ((a - t) / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.4e+136) or not (t <= 0.00015): tmp = x - (y / (t / (a - z))) else: tmp = x + (y - (y / ((a - t) / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.4e+136) || !(t <= 0.00015)) tmp = Float64(x - Float64(y / Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(y - Float64(y / Float64(Float64(a - t) / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.4e+136) || ~((t <= 0.00015))) tmp = x - (y / (t / (a - z))); else tmp = x + (y - (y / ((a - t) / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.4e+136], N[Not[LessEqual[t, 0.00015]], $MachinePrecision]], N[(x - N[(y / N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y - N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.4 \cdot 10^{+136} \lor \neg \left(t \leq 0.00015\right):\\
\;\;\;\;x - \frac{y}{\frac{t}{a - z}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - \frac{y}{\frac{a - t}{z}}\right)\\
\end{array}
\end{array}
if t < -5.4000000000000003e136 or 1.49999999999999987e-4 < t Initial program 56.3%
associate--l+64.8%
sub-neg64.8%
+-commutative64.8%
associate-/l*72.0%
distribute-neg-frac72.0%
associate-/r/78.0%
fma-def78.1%
sub-neg78.1%
+-commutative78.1%
distribute-neg-in78.1%
unsub-neg78.1%
remove-double-neg78.1%
Simplified78.1%
Taylor expanded in y around 0 87.3%
Taylor expanded in t around inf 82.3%
fma-def82.3%
+-commutative82.3%
mul-1-neg82.3%
sub-neg82.3%
*-commutative82.3%
fma-def82.3%
+-commutative82.3%
mul-1-neg82.3%
unsub-neg82.3%
associate-/l*90.0%
Simplified90.0%
if -5.4000000000000003e136 < t < 1.49999999999999987e-4Initial program 90.9%
associate--l+91.7%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in z around inf 89.5%
associate-/l*90.2%
Simplified90.2%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.9e+136) (not (<= t 0.00015))) (+ x (/ -1.0 (/ (/ t y) (- a z)))) (+ x (- y (/ y (/ (- a t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.9e+136) || !(t <= 0.00015)) {
tmp = x + (-1.0 / ((t / y) / (a - z)));
} else {
tmp = x + (y - (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 ((t <= (-2.9d+136)) .or. (.not. (t <= 0.00015d0))) then
tmp = x + ((-1.0d0) / ((t / y) / (a - z)))
else
tmp = x + (y - (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 ((t <= -2.9e+136) || !(t <= 0.00015)) {
tmp = x + (-1.0 / ((t / y) / (a - z)));
} else {
tmp = x + (y - (y / ((a - t) / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.9e+136) or not (t <= 0.00015): tmp = x + (-1.0 / ((t / y) / (a - z))) else: tmp = x + (y - (y / ((a - t) / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.9e+136) || !(t <= 0.00015)) tmp = Float64(x + Float64(-1.0 / Float64(Float64(t / y) / Float64(a - z)))); else tmp = Float64(x + Float64(y - Float64(y / Float64(Float64(a - t) / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.9e+136) || ~((t <= 0.00015))) tmp = x + (-1.0 / ((t / y) / (a - z))); else tmp = x + (y - (y / ((a - t) / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.9e+136], N[Not[LessEqual[t, 0.00015]], $MachinePrecision]], N[(x + N[(-1.0 / N[(N[(t / y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y - N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+136} \lor \neg \left(t \leq 0.00015\right):\\
\;\;\;\;x + \frac{-1}{\frac{\frac{t}{y}}{a - z}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - \frac{y}{\frac{a - t}{z}}\right)\\
\end{array}
\end{array}
if t < -2.89999999999999974e136 or 1.49999999999999987e-4 < t Initial program 56.3%
associate--l+64.8%
associate-/l*72.0%
Simplified72.0%
Taylor expanded in t around -inf 82.2%
+-commutative82.2%
sub-neg82.2%
mul-1-neg82.2%
mul-1-neg82.2%
unsub-neg82.2%
mul-1-neg82.2%
sub-neg82.2%
distribute-lft-out--82.3%
Simplified82.3%
clear-num82.2%
inv-pow82.2%
Applied egg-rr82.2%
unpow-182.2%
associate-/r*92.5%
Simplified92.5%
if -2.89999999999999974e136 < t < 1.49999999999999987e-4Initial program 90.9%
associate--l+91.7%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in z around inf 89.5%
associate-/l*90.2%
Simplified90.2%
Final simplification91.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ y t))))
(if (<= a -1.9e-192)
(+ y x)
(if (<= a 1.22e-287)
t_1
(if (<= a 3e-221)
x
(if (<= a 2.3e-200) t_1 (if (<= a 3.65e+50) x (+ y x))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / t);
double tmp;
if (a <= -1.9e-192) {
tmp = y + x;
} else if (a <= 1.22e-287) {
tmp = t_1;
} else if (a <= 3e-221) {
tmp = x;
} else if (a <= 2.3e-200) {
tmp = t_1;
} else if (a <= 3.65e+50) {
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) :: t_1
real(8) :: tmp
t_1 = z * (y / t)
if (a <= (-1.9d-192)) then
tmp = y + x
else if (a <= 1.22d-287) then
tmp = t_1
else if (a <= 3d-221) then
tmp = x
else if (a <= 2.3d-200) then
tmp = t_1
else if (a <= 3.65d+50) 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 t_1 = z * (y / t);
double tmp;
if (a <= -1.9e-192) {
tmp = y + x;
} else if (a <= 1.22e-287) {
tmp = t_1;
} else if (a <= 3e-221) {
tmp = x;
} else if (a <= 2.3e-200) {
tmp = t_1;
} else if (a <= 3.65e+50) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (y / t) tmp = 0 if a <= -1.9e-192: tmp = y + x elif a <= 1.22e-287: tmp = t_1 elif a <= 3e-221: tmp = x elif a <= 2.3e-200: tmp = t_1 elif a <= 3.65e+50: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / t)) tmp = 0.0 if (a <= -1.9e-192) tmp = Float64(y + x); elseif (a <= 1.22e-287) tmp = t_1; elseif (a <= 3e-221) tmp = x; elseif (a <= 2.3e-200) tmp = t_1; elseif (a <= 3.65e+50) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (y / t); tmp = 0.0; if (a <= -1.9e-192) tmp = y + x; elseif (a <= 1.22e-287) tmp = t_1; elseif (a <= 3e-221) tmp = x; elseif (a <= 2.3e-200) tmp = t_1; elseif (a <= 3.65e+50) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.9e-192], N[(y + x), $MachinePrecision], If[LessEqual[a, 1.22e-287], t$95$1, If[LessEqual[a, 3e-221], x, If[LessEqual[a, 2.3e-200], t$95$1, If[LessEqual[a, 3.65e+50], x, N[(y + x), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{t}\\
\mathbf{if}\;a \leq -1.9 \cdot 10^{-192}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 1.22 \cdot 10^{-287}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 3 \cdot 10^{-221}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-200}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 3.65 \cdot 10^{+50}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -1.9000000000000001e-192 or 3.6500000000000002e50 < a Initial program 76.1%
associate--l+77.6%
sub-neg77.6%
+-commutative77.6%
associate-/l*87.7%
distribute-neg-frac87.7%
associate-/r/89.1%
fma-def89.1%
sub-neg89.1%
+-commutative89.1%
distribute-neg-in89.1%
unsub-neg89.1%
remove-double-neg89.1%
Simplified89.1%
Taylor expanded in a around inf 67.3%
if -1.9000000000000001e-192 < a < 1.21999999999999996e-287 or 3.0000000000000002e-221 < a < 2.30000000000000007e-200Initial program 68.2%
associate--l+73.2%
associate-/l*68.8%
Simplified68.8%
Taylor expanded in t around -inf 89.6%
+-commutative89.6%
sub-neg89.6%
mul-1-neg89.6%
mul-1-neg89.6%
unsub-neg89.6%
mul-1-neg89.6%
sub-neg89.6%
distribute-lft-out--89.7%
Simplified89.7%
Taylor expanded in z around inf 68.3%
associate-/l*58.7%
Simplified58.7%
associate-/r/68.3%
Applied egg-rr68.3%
if 1.21999999999999996e-287 < a < 3.0000000000000002e-221 or 2.30000000000000007e-200 < a < 3.6500000000000002e50Initial program 80.0%
associate--l+88.5%
sub-neg88.5%
+-commutative88.5%
associate-/l*88.5%
distribute-neg-frac88.5%
associate-/r/92.2%
fma-def92.2%
sub-neg92.2%
+-commutative92.2%
distribute-neg-in92.2%
unsub-neg92.2%
remove-double-neg92.2%
Simplified92.2%
Taylor expanded in x around inf 64.6%
Final simplification66.7%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.4e-193)
(+ y x)
(if (<= a 1.3e-289)
(* z (/ y t))
(if (<= a 1.55e-223)
x
(if (<= a 2.3e-196) (/ (* y z) t) (if (<= a 3.65e+50) x (+ y x)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.4e-193) {
tmp = y + x;
} else if (a <= 1.3e-289) {
tmp = z * (y / t);
} else if (a <= 1.55e-223) {
tmp = x;
} else if (a <= 2.3e-196) {
tmp = (y * z) / t;
} else if (a <= 3.65e+50) {
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 <= (-2.4d-193)) then
tmp = y + x
else if (a <= 1.3d-289) then
tmp = z * (y / t)
else if (a <= 1.55d-223) then
tmp = x
else if (a <= 2.3d-196) then
tmp = (y * z) / t
else if (a <= 3.65d+50) 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 <= -2.4e-193) {
tmp = y + x;
} else if (a <= 1.3e-289) {
tmp = z * (y / t);
} else if (a <= 1.55e-223) {
tmp = x;
} else if (a <= 2.3e-196) {
tmp = (y * z) / t;
} else if (a <= 3.65e+50) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.4e-193: tmp = y + x elif a <= 1.3e-289: tmp = z * (y / t) elif a <= 1.55e-223: tmp = x elif a <= 2.3e-196: tmp = (y * z) / t elif a <= 3.65e+50: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.4e-193) tmp = Float64(y + x); elseif (a <= 1.3e-289) tmp = Float64(z * Float64(y / t)); elseif (a <= 1.55e-223) tmp = x; elseif (a <= 2.3e-196) tmp = Float64(Float64(y * z) / t); elseif (a <= 3.65e+50) 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 <= -2.4e-193) tmp = y + x; elseif (a <= 1.3e-289) tmp = z * (y / t); elseif (a <= 1.55e-223) tmp = x; elseif (a <= 2.3e-196) tmp = (y * z) / t; elseif (a <= 3.65e+50) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.4e-193], N[(y + x), $MachinePrecision], If[LessEqual[a, 1.3e-289], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.55e-223], x, If[LessEqual[a, 2.3e-196], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[a, 3.65e+50], x, N[(y + x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.4 \cdot 10^{-193}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 1.3 \cdot 10^{-289}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{-223}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-196}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\mathbf{elif}\;a \leq 3.65 \cdot 10^{+50}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -2.4e-193 or 3.6500000000000002e50 < a Initial program 76.1%
associate--l+77.6%
sub-neg77.6%
+-commutative77.6%
associate-/l*87.7%
distribute-neg-frac87.7%
associate-/r/89.1%
fma-def89.1%
sub-neg89.1%
+-commutative89.1%
distribute-neg-in89.1%
unsub-neg89.1%
remove-double-neg89.1%
Simplified89.1%
Taylor expanded in a around inf 67.3%
if -2.4e-193 < a < 1.2999999999999999e-289Initial program 68.3%
associate--l+73.9%
associate-/l*68.8%
Simplified68.8%
Taylor expanded in t around -inf 88.2%
+-commutative88.2%
sub-neg88.2%
mul-1-neg88.2%
mul-1-neg88.2%
unsub-neg88.2%
mul-1-neg88.2%
sub-neg88.2%
distribute-lft-out--88.2%
Simplified88.2%
Taylor expanded in z around inf 63.6%
associate-/l*55.2%
Simplified55.2%
associate-/r/63.8%
Applied egg-rr63.8%
if 1.2999999999999999e-289 < a < 1.55000000000000009e-223 or 2.3000000000000002e-196 < a < 3.6500000000000002e50Initial program 80.0%
associate--l+88.5%
sub-neg88.5%
+-commutative88.5%
associate-/l*88.5%
distribute-neg-frac88.5%
associate-/r/92.2%
fma-def92.2%
sub-neg92.2%
+-commutative92.2%
distribute-neg-in92.2%
unsub-neg92.2%
remove-double-neg92.2%
Simplified92.2%
Taylor expanded in x around inf 64.6%
if 1.55000000000000009e-223 < a < 2.3000000000000002e-196Initial program 68.2%
associate--l+68.2%
associate-/l*68.8%
Simplified68.8%
Taylor expanded in t around -inf 99.7%
+-commutative99.7%
sub-neg99.7%
mul-1-neg99.7%
mul-1-neg99.7%
unsub-neg99.7%
mul-1-neg99.7%
sub-neg99.7%
distribute-lft-out--99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Final simplification66.7%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3.7e-38)
(+ y x)
(if (<= a 2.3e-38)
(+ x (/ (* y z) t))
(if (<= a 1.55e+161) (- x (* z (/ y a))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.7e-38) {
tmp = y + x;
} else if (a <= 2.3e-38) {
tmp = x + ((y * z) / t);
} else if (a <= 1.55e+161) {
tmp = x - (z * (y / 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 <= (-3.7d-38)) then
tmp = y + x
else if (a <= 2.3d-38) then
tmp = x + ((y * z) / t)
else if (a <= 1.55d+161) then
tmp = x - (z * (y / 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 <= -3.7e-38) {
tmp = y + x;
} else if (a <= 2.3e-38) {
tmp = x + ((y * z) / t);
} else if (a <= 1.55e+161) {
tmp = x - (z * (y / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.7e-38: tmp = y + x elif a <= 2.3e-38: tmp = x + ((y * z) / t) elif a <= 1.55e+161: tmp = x - (z * (y / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.7e-38) tmp = Float64(y + x); elseif (a <= 2.3e-38) tmp = Float64(x + Float64(Float64(y * z) / t)); elseif (a <= 1.55e+161) tmp = Float64(x - Float64(z * Float64(y / a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.7e-38) tmp = y + x; elseif (a <= 2.3e-38) tmp = x + ((y * z) / t); elseif (a <= 1.55e+161) tmp = x - (z * (y / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.7e-38], N[(y + x), $MachinePrecision], If[LessEqual[a, 2.3e-38], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.55e+161], N[(x - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.7 \cdot 10^{-38}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-38}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{+161}:\\
\;\;\;\;x - z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -3.7e-38 or 1.55000000000000003e161 < a Initial program 73.3%
associate--l+74.5%
sub-neg74.5%
+-commutative74.5%
associate-/l*88.1%
distribute-neg-frac88.1%
associate-/r/89.1%
fma-def89.1%
sub-neg89.1%
+-commutative89.1%
distribute-neg-in89.1%
unsub-neg89.1%
remove-double-neg89.1%
Simplified89.1%
Taylor expanded in a around inf 73.2%
if -3.7e-38 < a < 2.30000000000000002e-38Initial program 75.1%
associate--l+81.4%
sub-neg81.4%
+-commutative81.4%
associate-/l*80.8%
distribute-neg-frac80.8%
associate-/r/80.1%
fma-def80.2%
sub-neg80.2%
+-commutative80.2%
distribute-neg-in80.2%
unsub-neg80.2%
remove-double-neg80.2%
Simplified80.2%
Taylor expanded in y around 0 88.4%
Taylor expanded in a around 0 83.2%
if 2.30000000000000002e-38 < a < 1.55000000000000003e161Initial program 85.1%
associate--l+89.6%
sub-neg89.6%
+-commutative89.6%
associate-/l*89.7%
distribute-neg-frac89.7%
associate-/r/94.1%
fma-def94.1%
sub-neg94.1%
+-commutative94.1%
distribute-neg-in94.1%
unsub-neg94.1%
remove-double-neg94.1%
Simplified94.1%
Taylor expanded in y around 0 94.1%
Taylor expanded in t around inf 85.8%
Taylor expanded in a around inf 79.0%
+-commutative79.0%
mul-1-neg79.0%
associate-/l*79.0%
sub-neg79.0%
associate-/r/79.0%
*-commutative79.0%
Simplified79.0%
Final simplification78.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.7e-38) (- (+ y x) (* y (/ z a))) (if (<= a 1.42e+162) (- x (* z (/ y (- a t)))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.7e-38) {
tmp = (y + x) - (y * (z / a));
} else if (a <= 1.42e+162) {
tmp = x - (z * (y / (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.7d-38)) then
tmp = (y + x) - (y * (z / a))
else if (a <= 1.42d+162) then
tmp = x - (z * (y / (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.7e-38) {
tmp = (y + x) - (y * (z / a));
} else if (a <= 1.42e+162) {
tmp = x - (z * (y / (a - t)));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.7e-38: tmp = (y + x) - (y * (z / a)) elif a <= 1.42e+162: tmp = x - (z * (y / (a - t))) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.7e-38) tmp = Float64(Float64(y + x) - Float64(y * Float64(z / a))); elseif (a <= 1.42e+162) tmp = Float64(x - Float64(z * Float64(y / Float64(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.7e-38) tmp = (y + x) - (y * (z / a)); elseif (a <= 1.42e+162) tmp = x - (z * (y / (a - t))); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.7e-38], N[(N[(y + x), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.42e+162], N[(x - N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.7 \cdot 10^{-38}:\\
\;\;\;\;\left(y + x\right) - y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq 1.42 \cdot 10^{+162}:\\
\;\;\;\;x - z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -3.7e-38Initial program 70.3%
associate-*l/84.7%
Simplified84.7%
Taylor expanded in t around 0 75.9%
if -3.7e-38 < a < 1.4199999999999999e162Initial program 77.8%
associate--l+83.6%
sub-neg83.6%
+-commutative83.6%
associate-/l*83.2%
distribute-neg-frac83.2%
associate-/r/83.8%
fma-def83.9%
sub-neg83.9%
+-commutative83.9%
distribute-neg-in83.9%
unsub-neg83.9%
remove-double-neg83.9%
Simplified83.9%
Taylor expanded in y around 0 89.9%
Taylor expanded in t around inf 86.0%
Taylor expanded in y around 0 89.5%
+-commutative89.5%
mul-1-neg89.5%
associate-*r/86.0%
sub-neg86.0%
associate-*r/89.5%
associate-/l*86.5%
Simplified86.5%
associate-/r/90.7%
Applied egg-rr90.7%
if 1.4199999999999999e162 < a Initial program 81.6%
associate--l+81.6%
sub-neg81.6%
+-commutative81.6%
associate-/l*96.2%
distribute-neg-frac96.2%
associate-/r/96.2%
fma-def96.2%
sub-neg96.2%
+-commutative96.2%
distribute-neg-in96.2%
unsub-neg96.2%
remove-double-neg96.2%
Simplified96.2%
Taylor expanded in a around inf 92.7%
Final simplification86.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -7.3e-41) (+ y x) (if (<= a 1.55e+161) (+ x (/ y (/ t z))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.3e-41) {
tmp = y + x;
} else if (a <= 1.55e+161) {
tmp = x + (y / (t / z));
} 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 <= (-7.3d-41)) then
tmp = y + x
else if (a <= 1.55d+161) then
tmp = x + (y / (t / z))
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 <= -7.3e-41) {
tmp = y + x;
} else if (a <= 1.55e+161) {
tmp = x + (y / (t / z));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -7.3e-41: tmp = y + x elif a <= 1.55e+161: tmp = x + (y / (t / z)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.3e-41) tmp = Float64(y + x); elseif (a <= 1.55e+161) tmp = Float64(x + Float64(y / Float64(t / z))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -7.3e-41) tmp = y + x; elseif (a <= 1.55e+161) tmp = x + (y / (t / z)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.3e-41], N[(y + x), $MachinePrecision], If[LessEqual[a, 1.55e+161], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.3 \cdot 10^{-41}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{+161}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -7.30000000000000026e-41 or 1.55000000000000003e161 < a Initial program 73.3%
associate--l+74.5%
sub-neg74.5%
+-commutative74.5%
associate-/l*88.1%
distribute-neg-frac88.1%
associate-/r/89.1%
fma-def89.1%
sub-neg89.1%
+-commutative89.1%
distribute-neg-in89.1%
unsub-neg89.1%
remove-double-neg89.1%
Simplified89.1%
Taylor expanded in a around inf 73.2%
if -7.30000000000000026e-41 < a < 1.55000000000000003e161Initial program 77.8%
associate--l+83.6%
sub-neg83.6%
+-commutative83.6%
associate-/l*83.2%
distribute-neg-frac83.2%
associate-/r/83.8%
fma-def83.9%
sub-neg83.9%
+-commutative83.9%
distribute-neg-in83.9%
unsub-neg83.9%
remove-double-neg83.9%
Simplified83.9%
Taylor expanded in y around 0 89.9%
Taylor expanded in a around 0 78.4%
associate-/l*76.0%
Simplified76.0%
Final simplification74.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -5.8e-46) (+ y x) (if (<= a 1.55e+161) (+ x (/ (* y z) t)) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.8e-46) {
tmp = y + x;
} else if (a <= 1.55e+161) {
tmp = x + ((y * z) / 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 <= (-5.8d-46)) then
tmp = y + x
else if (a <= 1.55d+161) then
tmp = x + ((y * z) / 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 <= -5.8e-46) {
tmp = y + x;
} else if (a <= 1.55e+161) {
tmp = x + ((y * z) / t);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.8e-46: tmp = y + x elif a <= 1.55e+161: tmp = x + ((y * z) / t) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.8e-46) tmp = Float64(y + x); elseif (a <= 1.55e+161) tmp = Float64(x + Float64(Float64(y * z) / t)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5.8e-46) tmp = y + x; elseif (a <= 1.55e+161) tmp = x + ((y * z) / t); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.8e-46], N[(y + x), $MachinePrecision], If[LessEqual[a, 1.55e+161], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.8 \cdot 10^{-46}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{+161}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -5.80000000000000009e-46 or 1.55000000000000003e161 < a Initial program 73.3%
associate--l+74.5%
sub-neg74.5%
+-commutative74.5%
associate-/l*88.1%
distribute-neg-frac88.1%
associate-/r/89.1%
fma-def89.1%
sub-neg89.1%
+-commutative89.1%
distribute-neg-in89.1%
unsub-neg89.1%
remove-double-neg89.1%
Simplified89.1%
Taylor expanded in a around inf 73.2%
if -5.80000000000000009e-46 < a < 1.55000000000000003e161Initial program 77.8%
associate--l+83.6%
sub-neg83.6%
+-commutative83.6%
associate-/l*83.2%
distribute-neg-frac83.2%
associate-/r/83.8%
fma-def83.9%
sub-neg83.9%
+-commutative83.9%
distribute-neg-in83.9%
unsub-neg83.9%
remove-double-neg83.9%
Simplified83.9%
Taylor expanded in y around 0 89.9%
Taylor expanded in a around 0 78.4%
Final simplification76.4%
(FPCore (x y z t a) :precision binary64 (if (<= a 9.5e+166) (- x (* z (/ y (- a t)))) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 9.5e+166) {
tmp = x - (z * (y / (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 <= 9.5d+166) then
tmp = x - (z * (y / (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 <= 9.5e+166) {
tmp = x - (z * (y / (a - t)));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 9.5e+166: tmp = x - (z * (y / (a - t))) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 9.5e+166) tmp = Float64(x - Float64(z * Float64(y / Float64(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 <= 9.5e+166) tmp = x - (z * (y / (a - t))); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 9.5e+166], N[(x - N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 9.5 \cdot 10^{+166}:\\
\;\;\;\;x - z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < 9.49999999999999984e166Initial program 75.4%
associate--l+80.0%
sub-neg80.0%
+-commutative80.0%
associate-/l*83.8%
distribute-neg-frac83.8%
associate-/r/84.6%
fma-def84.7%
sub-neg84.7%
+-commutative84.7%
distribute-neg-in84.7%
unsub-neg84.7%
remove-double-neg84.7%
Simplified84.7%
Taylor expanded in y around 0 89.7%
Taylor expanded in t around inf 79.5%
Taylor expanded in y around 0 79.0%
+-commutative79.0%
mul-1-neg79.0%
associate-*r/79.5%
sub-neg79.5%
associate-*r/79.0%
associate-/l*79.9%
Simplified79.9%
associate-/r/82.7%
Applied egg-rr82.7%
if 9.49999999999999984e166 < a Initial program 81.6%
associate--l+81.6%
sub-neg81.6%
+-commutative81.6%
associate-/l*96.2%
distribute-neg-frac96.2%
associate-/r/96.2%
fma-def96.2%
sub-neg96.2%
+-commutative96.2%
distribute-neg-in96.2%
unsub-neg96.2%
remove-double-neg96.2%
Simplified96.2%
Taylor expanded in a around inf 92.7%
Final simplification83.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -8e-236) (not (<= x 2.5e-184))) (+ y x) (* y (/ z t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -8e-236) || !(x <= 2.5e-184)) {
tmp = y + x;
} else {
tmp = 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 ((x <= (-8d-236)) .or. (.not. (x <= 2.5d-184))) then
tmp = y + x
else
tmp = 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 ((x <= -8e-236) || !(x <= 2.5e-184)) {
tmp = y + x;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -8e-236) or not (x <= 2.5e-184): tmp = y + x else: tmp = y * (z / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -8e-236) || !(x <= 2.5e-184)) tmp = Float64(y + x); else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -8e-236) || ~((x <= 2.5e-184))) tmp = y + x; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -8e-236], N[Not[LessEqual[x, 2.5e-184]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{-236} \lor \neg \left(x \leq 2.5 \cdot 10^{-184}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if x < -8.0000000000000004e-236 or 2.50000000000000001e-184 < x Initial program 80.2%
associate--l+83.7%
sub-neg83.7%
+-commutative83.7%
associate-/l*90.2%
distribute-neg-frac90.2%
associate-/r/88.9%
fma-def88.9%
sub-neg88.9%
+-commutative88.9%
distribute-neg-in88.9%
unsub-neg88.9%
remove-double-neg88.9%
Simplified88.9%
Taylor expanded in a around inf 63.2%
if -8.0000000000000004e-236 < x < 2.50000000000000001e-184Initial program 47.7%
associate--l+55.9%
associate-/l*50.5%
Simplified50.5%
Taylor expanded in t around -inf 72.8%
+-commutative72.8%
sub-neg72.8%
mul-1-neg72.8%
mul-1-neg72.8%
unsub-neg72.8%
mul-1-neg72.8%
sub-neg72.8%
distribute-lft-out--72.9%
Simplified72.9%
Taylor expanded in z around inf 54.5%
associate-/l*51.6%
Simplified51.6%
Taylor expanded in y around 0 54.5%
associate-*r/51.8%
Simplified51.8%
Final simplification61.8%
(FPCore (x y z t a) :precision binary64 (if (<= y 2.25e+174) x y))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 2.25e+174) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= 2.25d+174) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 2.25e+174) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 2.25e+174: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 2.25e+174) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 2.25e+174) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 2.25e+174], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.25 \cdot 10^{+174}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 2.25000000000000021e174Initial program 79.5%
associate--l+84.3%
sub-neg84.3%
+-commutative84.3%
associate-/l*87.8%
distribute-neg-frac87.8%
associate-/r/88.3%
fma-def88.4%
sub-neg88.4%
+-commutative88.4%
distribute-neg-in88.4%
unsub-neg88.4%
remove-double-neg88.4%
Simplified88.4%
Taylor expanded in x around inf 57.9%
if 2.25000000000000021e174 < y Initial program 56.1%
associate-*l/71.2%
Simplified71.2%
Taylor expanded in t around 0 55.1%
Taylor expanded in x around 0 45.2%
Taylor expanded in z around 0 28.2%
Final simplification53.5%
(FPCore (x y z t a) :precision binary64 (+ y x))
double code(double x, double y, double z, double t, double a) {
return y + x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = y + x
end function
public static double code(double x, double y, double z, double t, double a) {
return y + x;
}
def code(x, y, z, t, a): return y + x
function code(x, y, z, t, a) return Float64(y + x) end
function tmp = code(x, y, z, t, a) tmp = y + x; end
code[x_, y_, z_, t_, a_] := N[(y + x), $MachinePrecision]
\begin{array}{l}
\\
y + x
\end{array}
Initial program 76.0%
associate--l+80.1%
sub-neg80.1%
+-commutative80.1%
associate-/l*85.0%
distribute-neg-frac85.0%
associate-/r/85.8%
fma-def85.9%
sub-neg85.9%
+-commutative85.9%
distribute-neg-in85.9%
unsub-neg85.9%
remove-double-neg85.9%
Simplified85.9%
Taylor expanded in a around inf 56.7%
Final simplification56.7%
(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 76.0%
associate--l+80.1%
sub-neg80.1%
+-commutative80.1%
associate-/l*85.0%
distribute-neg-frac85.0%
associate-/r/85.8%
fma-def85.9%
sub-neg85.9%
+-commutative85.9%
distribute-neg-in85.9%
unsub-neg85.9%
remove-double-neg85.9%
Simplified85.9%
Taylor expanded in x around inf 50.8%
Final simplification50.8%
(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 2023224
(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))))