
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))
(t_2 (sqrt (+ y 1.0)))
(t_3 (- t_2 (sqrt y)))
(t_4 (sqrt (+ 1.0 x))))
(if (<= t_3 0.9998)
(+ (+ (/ 1.0 (+ (sqrt y) t_2)) t_1) (/ 1.0 (+ t_4 (sqrt x))))
(+
(- t_4 (sqrt x))
(+ t_3 (+ t_1 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (sqrt((1.0 + z)) + sqrt(z));
double t_2 = sqrt((y + 1.0));
double t_3 = t_2 - sqrt(y);
double t_4 = sqrt((1.0 + x));
double tmp;
if (t_3 <= 0.9998) {
tmp = ((1.0 / (sqrt(y) + t_2)) + t_1) + (1.0 / (t_4 + sqrt(x)));
} else {
tmp = (t_4 - sqrt(x)) + (t_3 + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = 1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))
t_2 = sqrt((y + 1.0d0))
t_3 = t_2 - sqrt(y)
t_4 = sqrt((1.0d0 + x))
if (t_3 <= 0.9998d0) then
tmp = ((1.0d0 / (sqrt(y) + t_2)) + t_1) + (1.0d0 / (t_4 + sqrt(x)))
else
tmp = (t_4 - sqrt(x)) + (t_3 + (t_1 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z));
double t_2 = Math.sqrt((y + 1.0));
double t_3 = t_2 - Math.sqrt(y);
double t_4 = Math.sqrt((1.0 + x));
double tmp;
if (t_3 <= 0.9998) {
tmp = ((1.0 / (Math.sqrt(y) + t_2)) + t_1) + (1.0 / (t_4 + Math.sqrt(x)));
} else {
tmp = (t_4 - Math.sqrt(x)) + (t_3 + (t_1 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z)) t_2 = math.sqrt((y + 1.0)) t_3 = t_2 - math.sqrt(y) t_4 = math.sqrt((1.0 + x)) tmp = 0 if t_3 <= 0.9998: tmp = ((1.0 / (math.sqrt(y) + t_2)) + t_1) + (1.0 / (t_4 + math.sqrt(x))) else: tmp = (t_4 - math.sqrt(x)) + (t_3 + (t_1 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) t_2 = sqrt(Float64(y + 1.0)) t_3 = Float64(t_2 - sqrt(y)) t_4 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (t_3 <= 0.9998) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(y) + t_2)) + t_1) + Float64(1.0 / Float64(t_4 + sqrt(x)))); else tmp = Float64(Float64(t_4 - sqrt(x)) + Float64(t_3 + Float64(t_1 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 / (sqrt((1.0 + z)) + sqrt(z));
t_2 = sqrt((y + 1.0));
t_3 = t_2 - sqrt(y);
t_4 = sqrt((1.0 + x));
tmp = 0.0;
if (t_3 <= 0.9998)
tmp = ((1.0 / (sqrt(y) + t_2)) + t_1) + (1.0 / (t_4 + sqrt(x)));
else
tmp = (t_4 - sqrt(x)) + (t_3 + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.9998], N[(N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(1.0 / N[(t$95$4 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$4 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
t_2 := \sqrt{y + 1}\\
t_3 := t\_2 - \sqrt{y}\\
t_4 := \sqrt{1 + x}\\
\mathbf{if}\;t\_3 \leq 0.9998:\\
\;\;\;\;\left(\frac{1}{\sqrt{y} + t\_2} + t\_1\right) + \frac{1}{t\_4 + \sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_4 - \sqrt{x}\right) + \left(t\_3 + \left(t\_1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) < 0.99980000000000002Initial program 83.4%
associate-+l+83.4%
associate-+l+83.4%
+-commutative83.4%
+-commutative83.4%
associate-+l-65.4%
+-commutative65.4%
+-commutative65.4%
Simplified65.4%
flip--65.7%
div-inv65.7%
add-sqr-sqrt54.3%
+-commutative54.3%
add-sqr-sqrt65.7%
+-commutative65.7%
Applied egg-rr65.7%
associate-*r/65.7%
*-rgt-identity65.7%
remove-double-neg65.7%
sub-neg65.7%
div-sub65.5%
rem-square-sqrt54.0%
sqr-neg54.0%
div-sub54.3%
sqr-neg54.3%
rem-square-sqrt65.7%
associate--l+70.5%
+-inverses70.5%
metadata-eval70.5%
sub-neg70.5%
remove-double-neg70.5%
Simplified70.5%
flip--70.9%
div-inv70.9%
add-sqr-sqrt45.4%
add-sqr-sqrt71.4%
Applied egg-rr71.4%
associate-*r/71.4%
*-rgt-identity71.4%
remove-double-neg71.4%
sub-neg71.4%
div-sub70.6%
rem-square-sqrt47.0%
sqr-neg47.0%
div-sub45.4%
sqr-neg45.4%
rem-square-sqrt71.4%
associate--l+74.4%
+-inverses74.4%
metadata-eval74.4%
sub-neg74.4%
remove-double-neg74.4%
Simplified74.4%
Taylor expanded in t around inf 51.3%
flip--51.3%
div-inv51.3%
add-sqr-sqrt39.9%
add-sqr-sqrt51.3%
Applied egg-rr51.3%
associate-*r/51.3%
*-rgt-identity51.3%
remove-double-neg51.3%
sub-neg51.3%
div-sub51.3%
rem-square-sqrt40.5%
sqr-neg40.5%
div-sub39.9%
sqr-neg39.9%
rem-square-sqrt51.3%
associate--l+54.6%
+-inverses54.6%
metadata-eval54.6%
sub-neg54.6%
remove-double-neg54.6%
Simplified54.6%
if 0.99980000000000002 < (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) Initial program 96.9%
associate-+l+96.9%
associate-+l+96.9%
+-commutative96.9%
add096.9%
+-commutative96.9%
add096.9%
+-commutative96.9%
Simplified96.9%
flip--62.7%
div-inv62.7%
add-sqr-sqrt50.4%
add-sqr-sqrt62.7%
Applied egg-rr97.4%
associate-*r/62.7%
*-rgt-identity62.7%
remove-double-neg62.7%
sub-neg62.7%
div-sub62.7%
rem-square-sqrt50.5%
sqr-neg50.5%
div-sub50.4%
sqr-neg50.4%
rem-square-sqrt62.7%
associate--l+63.3%
+-inverses63.3%
metadata-eval63.3%
sub-neg63.3%
remove-double-neg63.3%
Simplified97.9%
flip--97.9%
div-inv97.9%
add-sqr-sqrt71.3%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate-*r/97.9%
*-rgt-identity97.9%
remove-double-neg97.9%
sub-neg97.9%
div-sub97.9%
rem-square-sqrt73.9%
sqr-neg73.9%
div-sub71.3%
sqr-neg71.3%
rem-square-sqrt97.9%
associate--l+98.7%
+-inverses98.7%
metadata-eval98.7%
sub-neg98.7%
remove-double-neg98.7%
Simplified98.7%
Final simplification73.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0)))
(t_2 (- t_1 (sqrt y)))
(t_3 (sqrt (+ 1.0 z)))
(t_4 (- t_3 (sqrt z)))
(t_5 (sqrt (+ 1.0 x)))
(t_6 (- t_5 (sqrt x))))
(if (<= (+ t_4 (+ t_6 t_2)) 2.5)
(+
(+ (/ 1.0 (+ (sqrt y) t_1)) (/ 1.0 (+ t_3 (sqrt z))))
(/ 1.0 (+ t_5 (sqrt x))))
(+ t_6 (+ t_2 (+ (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))) t_4))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double t_2 = t_1 - sqrt(y);
double t_3 = sqrt((1.0 + z));
double t_4 = t_3 - sqrt(z);
double t_5 = sqrt((1.0 + x));
double t_6 = t_5 - sqrt(x);
double tmp;
if ((t_4 + (t_6 + t_2)) <= 2.5) {
tmp = ((1.0 / (sqrt(y) + t_1)) + (1.0 / (t_3 + sqrt(z)))) + (1.0 / (t_5 + sqrt(x)));
} else {
tmp = t_6 + (t_2 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + t_4));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
t_2 = t_1 - sqrt(y)
t_3 = sqrt((1.0d0 + z))
t_4 = t_3 - sqrt(z)
t_5 = sqrt((1.0d0 + x))
t_6 = t_5 - sqrt(x)
if ((t_4 + (t_6 + t_2)) <= 2.5d0) then
tmp = ((1.0d0 / (sqrt(y) + t_1)) + (1.0d0 / (t_3 + sqrt(z)))) + (1.0d0 / (t_5 + sqrt(x)))
else
tmp = t_6 + (t_2 + ((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + t_4))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double t_2 = t_1 - Math.sqrt(y);
double t_3 = Math.sqrt((1.0 + z));
double t_4 = t_3 - Math.sqrt(z);
double t_5 = Math.sqrt((1.0 + x));
double t_6 = t_5 - Math.sqrt(x);
double tmp;
if ((t_4 + (t_6 + t_2)) <= 2.5) {
tmp = ((1.0 / (Math.sqrt(y) + t_1)) + (1.0 / (t_3 + Math.sqrt(z)))) + (1.0 / (t_5 + Math.sqrt(x)));
} else {
tmp = t_6 + (t_2 + ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + t_4));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) t_2 = t_1 - math.sqrt(y) t_3 = math.sqrt((1.0 + z)) t_4 = t_3 - math.sqrt(z) t_5 = math.sqrt((1.0 + x)) t_6 = t_5 - math.sqrt(x) tmp = 0 if (t_4 + (t_6 + t_2)) <= 2.5: tmp = ((1.0 / (math.sqrt(y) + t_1)) + (1.0 / (t_3 + math.sqrt(z)))) + (1.0 / (t_5 + math.sqrt(x))) else: tmp = t_6 + (t_2 + ((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + t_4)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) t_2 = Float64(t_1 - sqrt(y)) t_3 = sqrt(Float64(1.0 + z)) t_4 = Float64(t_3 - sqrt(z)) t_5 = sqrt(Float64(1.0 + x)) t_6 = Float64(t_5 - sqrt(x)) tmp = 0.0 if (Float64(t_4 + Float64(t_6 + t_2)) <= 2.5) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(y) + t_1)) + Float64(1.0 / Float64(t_3 + sqrt(z)))) + Float64(1.0 / Float64(t_5 + sqrt(x)))); else tmp = Float64(t_6 + Float64(t_2 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + t_4))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
t_2 = t_1 - sqrt(y);
t_3 = sqrt((1.0 + z));
t_4 = t_3 - sqrt(z);
t_5 = sqrt((1.0 + x));
t_6 = t_5 - sqrt(x);
tmp = 0.0;
if ((t_4 + (t_6 + t_2)) <= 2.5)
tmp = ((1.0 / (sqrt(y) + t_1)) + (1.0 / (t_3 + sqrt(z)))) + (1.0 / (t_5 + sqrt(x)));
else
tmp = t_6 + (t_2 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + t_4));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$4 + N[(t$95$6 + t$95$2), $MachinePrecision]), $MachinePrecision], 2.5], N[(N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$5 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$6 + N[(t$95$2 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
t_2 := t\_1 - \sqrt{y}\\
t_3 := \sqrt{1 + z}\\
t_4 := t\_3 - \sqrt{z}\\
t_5 := \sqrt{1 + x}\\
t_6 := t\_5 - \sqrt{x}\\
\mathbf{if}\;t\_4 + \left(t\_6 + t\_2\right) \leq 2.5:\\
\;\;\;\;\left(\frac{1}{\sqrt{y} + t\_1} + \frac{1}{t\_3 + \sqrt{z}}\right) + \frac{1}{t\_5 + \sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;t\_6 + \left(t\_2 + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + t\_4\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))) < 2.5Initial program 87.4%
associate-+l+87.4%
associate-+l+87.4%
+-commutative87.4%
+-commutative87.4%
associate-+l-70.3%
+-commutative70.3%
+-commutative70.3%
Simplified70.3%
flip--70.6%
div-inv70.6%
add-sqr-sqrt55.2%
+-commutative55.2%
add-sqr-sqrt70.6%
+-commutative70.6%
Applied egg-rr70.6%
associate-*r/70.6%
*-rgt-identity70.6%
remove-double-neg70.6%
sub-neg70.6%
div-sub70.4%
rem-square-sqrt55.0%
sqr-neg55.0%
div-sub55.2%
sqr-neg55.2%
rem-square-sqrt70.6%
associate--l+74.0%
+-inverses74.0%
metadata-eval74.0%
sub-neg74.0%
remove-double-neg74.0%
Simplified74.0%
flip--74.3%
div-inv74.3%
add-sqr-sqrt57.2%
add-sqr-sqrt74.6%
Applied egg-rr74.6%
associate-*r/74.6%
*-rgt-identity74.6%
remove-double-neg74.6%
sub-neg74.6%
div-sub74.1%
rem-square-sqrt58.3%
sqr-neg58.3%
div-sub57.2%
sqr-neg57.2%
rem-square-sqrt74.6%
associate--l+76.6%
+-inverses76.6%
metadata-eval76.6%
sub-neg76.6%
remove-double-neg76.6%
Simplified76.6%
Taylor expanded in t around inf 54.9%
flip--54.9%
div-inv54.9%
add-sqr-sqrt41.3%
add-sqr-sqrt54.9%
Applied egg-rr54.9%
associate-*r/54.9%
*-rgt-identity54.9%
remove-double-neg54.9%
sub-neg54.9%
div-sub54.9%
rem-square-sqrt41.8%
sqr-neg41.8%
div-sub41.3%
sqr-neg41.3%
rem-square-sqrt54.9%
associate--l+57.4%
+-inverses57.4%
metadata-eval57.4%
sub-neg57.4%
remove-double-neg57.4%
Simplified57.4%
if 2.5 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))) Initial program 100.0%
associate-+l+100.0%
associate-+l+100.0%
+-commutative100.0%
add0100.0%
+-commutative100.0%
add0100.0%
+-commutative100.0%
Simplified100.0%
flip--100.0%
div-inv100.0%
add-sqr-sqrt68.0%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
associate-*r/100.0%
*-rgt-identity100.0%
remove-double-neg100.0%
sub-neg100.0%
div-sub100.0%
rem-square-sqrt70.6%
sqr-neg70.6%
div-sub68.0%
sqr-neg68.0%
rem-square-sqrt100.0%
associate--l+100.0%
+-inverses100.0%
metadata-eval100.0%
sub-neg100.0%
remove-double-neg100.0%
Simplified100.0%
Final simplification62.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))) (t_2 (sqrt (+ 1.0 z))) (t_3 (sqrt (+ 1.0 x))))
(if (<= (- t_2 (sqrt z)) 0.9999999999999994)
(+
(+ (/ 1.0 (+ (sqrt y) t_1)) (/ 1.0 (+ t_2 (sqrt z))))
(/ 1.0 (+ t_3 (sqrt x))))
(+
(- t_3 (sqrt x))
(+ (- t_1 (sqrt y)) (+ 1.0 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double t_2 = sqrt((1.0 + z));
double t_3 = sqrt((1.0 + x));
double tmp;
if ((t_2 - sqrt(z)) <= 0.9999999999999994) {
tmp = ((1.0 / (sqrt(y) + t_1)) + (1.0 / (t_2 + sqrt(z)))) + (1.0 / (t_3 + sqrt(x)));
} else {
tmp = (t_3 - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0 + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
t_2 = sqrt((1.0d0 + z))
t_3 = sqrt((1.0d0 + x))
if ((t_2 - sqrt(z)) <= 0.9999999999999994d0) then
tmp = ((1.0d0 / (sqrt(y) + t_1)) + (1.0d0 / (t_2 + sqrt(z)))) + (1.0d0 / (t_3 + sqrt(x)))
else
tmp = (t_3 - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0d0 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = Math.sqrt((1.0 + x));
double tmp;
if ((t_2 - Math.sqrt(z)) <= 0.9999999999999994) {
tmp = ((1.0 / (Math.sqrt(y) + t_1)) + (1.0 / (t_2 + Math.sqrt(z)))) + (1.0 / (t_3 + Math.sqrt(x)));
} else {
tmp = (t_3 - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + (1.0 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) t_2 = math.sqrt((1.0 + z)) t_3 = math.sqrt((1.0 + x)) tmp = 0 if (t_2 - math.sqrt(z)) <= 0.9999999999999994: tmp = ((1.0 / (math.sqrt(y) + t_1)) + (1.0 / (t_2 + math.sqrt(z)))) + (1.0 / (t_3 + math.sqrt(x))) else: tmp = (t_3 - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + (1.0 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) t_2 = sqrt(Float64(1.0 + z)) t_3 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (Float64(t_2 - sqrt(z)) <= 0.9999999999999994) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(y) + t_1)) + Float64(1.0 / Float64(t_2 + sqrt(z)))) + Float64(1.0 / Float64(t_3 + sqrt(x)))); else tmp = Float64(Float64(t_3 - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
t_2 = sqrt((1.0 + z));
t_3 = sqrt((1.0 + x));
tmp = 0.0;
if ((t_2 - sqrt(z)) <= 0.9999999999999994)
tmp = ((1.0 / (sqrt(y) + t_1)) + (1.0 / (t_2 + sqrt(z)))) + (1.0 / (t_3 + sqrt(x)));
else
tmp = (t_3 - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0 + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], 0.9999999999999994], N[(N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
t_2 := \sqrt{1 + z}\\
t_3 := \sqrt{1 + x}\\
\mathbf{if}\;t\_2 - \sqrt{z} \leq 0.9999999999999994:\\
\;\;\;\;\left(\frac{1}{\sqrt{y} + t\_1} + \frac{1}{t\_2 + \sqrt{z}}\right) + \frac{1}{t\_3 + \sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_3 - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{y}\right) + \left(1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) < 0.999999999999999445Initial program 81.6%
associate-+l+81.6%
associate-+l+81.6%
+-commutative81.6%
+-commutative81.6%
associate-+l-77.8%
+-commutative77.8%
+-commutative77.8%
Simplified77.8%
flip--78.0%
div-inv78.0%
add-sqr-sqrt59.8%
+-commutative59.8%
add-sqr-sqrt78.0%
+-commutative78.0%
Applied egg-rr78.0%
associate-*r/78.0%
*-rgt-identity78.0%
remove-double-neg78.0%
sub-neg78.0%
div-sub77.9%
rem-square-sqrt59.8%
sqr-neg59.8%
div-sub59.8%
sqr-neg59.8%
rem-square-sqrt78.0%
associate--l+83.4%
+-inverses83.4%
metadata-eval83.4%
sub-neg83.4%
remove-double-neg83.4%
Simplified83.4%
flip--83.6%
div-inv83.6%
add-sqr-sqrt68.9%
add-sqr-sqrt83.9%
Applied egg-rr83.9%
associate-*r/83.9%
*-rgt-identity83.9%
remove-double-neg83.9%
sub-neg83.9%
div-sub83.4%
rem-square-sqrt69.3%
sqr-neg69.3%
div-sub68.9%
sqr-neg68.9%
rem-square-sqrt83.9%
associate--l+87.1%
+-inverses87.1%
metadata-eval87.1%
sub-neg87.1%
remove-double-neg87.1%
Simplified87.1%
Taylor expanded in t around inf 52.2%
flip--52.2%
div-inv52.2%
add-sqr-sqrt28.8%
add-sqr-sqrt52.2%
Applied egg-rr52.2%
associate-*r/52.2%
*-rgt-identity52.2%
remove-double-neg52.2%
sub-neg52.2%
div-sub52.2%
rem-square-sqrt29.6%
sqr-neg29.6%
div-sub28.8%
sqr-neg28.8%
rem-square-sqrt52.2%
associate--l+56.5%
+-inverses56.5%
metadata-eval56.5%
sub-neg56.5%
remove-double-neg56.5%
Simplified56.5%
if 0.999999999999999445 < (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l-59.1%
+-commutative59.1%
+-commutative59.1%
Simplified59.1%
Taylor expanded in z around 0 59.1%
associate--l+96.6%
Simplified96.6%
flip--96.8%
div-inv96.8%
add-sqr-sqrt70.7%
add-sqr-sqrt97.2%
Applied egg-rr97.2%
associate-*r/97.2%
*-rgt-identity97.2%
remove-double-neg97.2%
sub-neg97.2%
div-sub96.6%
rem-square-sqrt71.2%
sqr-neg71.2%
div-sub70.7%
sqr-neg70.7%
rem-square-sqrt97.2%
associate--l+97.7%
+-inverses97.7%
metadata-eval97.7%
sub-neg97.7%
remove-double-neg97.7%
Simplified97.7%
Final simplification77.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x)))
(t_2 (- t_1 (sqrt x)))
(t_3 (sqrt (+ y 1.0)))
(t_4 (/ 1.0 (+ (sqrt y) t_3))))
(if (<= z 2.15e-32)
(+ t_2 (+ (- t_3 (sqrt y)) (+ 1.0 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))))))
(if (<= z 8.2e+30)
(+ (+ t_4 (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z)))) t_2)
(+ t_4 (/ 1.0 (+ t_1 (sqrt x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = t_1 - sqrt(x);
double t_3 = sqrt((y + 1.0));
double t_4 = 1.0 / (sqrt(y) + t_3);
double tmp;
if (z <= 2.15e-32) {
tmp = t_2 + ((t_3 - sqrt(y)) + (1.0 + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
} else if (z <= 8.2e+30) {
tmp = (t_4 + (1.0 / (sqrt((1.0 + z)) + sqrt(z)))) + t_2;
} else {
tmp = t_4 + (1.0 / (t_1 + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = t_1 - sqrt(x)
t_3 = sqrt((y + 1.0d0))
t_4 = 1.0d0 / (sqrt(y) + t_3)
if (z <= 2.15d-32) then
tmp = t_2 + ((t_3 - sqrt(y)) + (1.0d0 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t)))))
else if (z <= 8.2d+30) then
tmp = (t_4 + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z)))) + t_2
else
tmp = t_4 + (1.0d0 / (t_1 + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = t_1 - Math.sqrt(x);
double t_3 = Math.sqrt((y + 1.0));
double t_4 = 1.0 / (Math.sqrt(y) + t_3);
double tmp;
if (z <= 2.15e-32) {
tmp = t_2 + ((t_3 - Math.sqrt(y)) + (1.0 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))));
} else if (z <= 8.2e+30) {
tmp = (t_4 + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z)))) + t_2;
} else {
tmp = t_4 + (1.0 / (t_1 + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = t_1 - math.sqrt(x) t_3 = math.sqrt((y + 1.0)) t_4 = 1.0 / (math.sqrt(y) + t_3) tmp = 0 if z <= 2.15e-32: tmp = t_2 + ((t_3 - math.sqrt(y)) + (1.0 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))))) elif z <= 8.2e+30: tmp = (t_4 + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z)))) + t_2 else: tmp = t_4 + (1.0 / (t_1 + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = Float64(t_1 - sqrt(x)) t_3 = sqrt(Float64(y + 1.0)) t_4 = Float64(1.0 / Float64(sqrt(y) + t_3)) tmp = 0.0 if (z <= 2.15e-32) tmp = Float64(t_2 + Float64(Float64(t_3 - sqrt(y)) + Float64(1.0 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))))); elseif (z <= 8.2e+30) tmp = Float64(Float64(t_4 + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))) + t_2); else tmp = Float64(t_4 + Float64(1.0 / Float64(t_1 + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = t_1 - sqrt(x);
t_3 = sqrt((y + 1.0));
t_4 = 1.0 / (sqrt(y) + t_3);
tmp = 0.0;
if (z <= 2.15e-32)
tmp = t_2 + ((t_3 - sqrt(y)) + (1.0 + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
elseif (z <= 8.2e+30)
tmp = (t_4 + (1.0 / (sqrt((1.0 + z)) + sqrt(z)))) + t_2;
else
tmp = t_4 + (1.0 / (t_1 + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 2.15e-32], N[(t$95$2 + N[(N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e+30], N[(N[(t$95$4 + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], N[(t$95$4 + N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := t\_1 - \sqrt{x}\\
t_3 := \sqrt{y + 1}\\
t_4 := \frac{1}{\sqrt{y} + t\_3}\\
\mathbf{if}\;z \leq 2.15 \cdot 10^{-32}:\\
\;\;\;\;t\_2 + \left(\left(t\_3 - \sqrt{y}\right) + \left(1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+30}:\\
\;\;\;\;\left(t\_4 + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right) + t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_4 + \frac{1}{t\_1 + \sqrt{x}}\\
\end{array}
\end{array}
if z < 2.14999999999999995e-32Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l-58.8%
+-commutative58.8%
+-commutative58.8%
Simplified58.8%
Taylor expanded in z around 0 58.8%
associate--l+96.6%
Simplified96.6%
flip--96.8%
div-inv96.8%
add-sqr-sqrt70.5%
add-sqr-sqrt97.2%
Applied egg-rr97.2%
associate-*r/97.2%
*-rgt-identity97.2%
remove-double-neg97.2%
sub-neg97.2%
div-sub96.6%
rem-square-sqrt71.0%
sqr-neg71.0%
div-sub70.5%
sqr-neg70.5%
rem-square-sqrt97.2%
associate--l+97.7%
+-inverses97.7%
metadata-eval97.7%
sub-neg97.7%
remove-double-neg97.7%
Simplified97.7%
if 2.14999999999999995e-32 < z < 8.20000000000000011e30Initial program 82.8%
associate-+l+82.8%
associate-+l+82.8%
+-commutative82.8%
add082.8%
+-commutative82.8%
add082.8%
+-commutative82.8%
Simplified82.8%
flip--41.2%
div-inv41.2%
add-sqr-sqrt38.9%
add-sqr-sqrt41.3%
Applied egg-rr84.2%
associate-*r/41.3%
*-rgt-identity41.3%
remove-double-neg41.3%
sub-neg41.3%
div-sub41.3%
rem-square-sqrt38.8%
sqr-neg38.8%
div-sub38.9%
sqr-neg38.9%
rem-square-sqrt41.3%
associate--l+51.5%
+-inverses51.5%
metadata-eval51.5%
sub-neg51.5%
remove-double-neg51.5%
Simplified96.6%
Taylor expanded in t around inf 50.6%
flip--68.7%
div-inv68.7%
add-sqr-sqrt54.8%
add-sqr-sqrt68.7%
Applied egg-rr51.0%
associate-*r/68.7%
*-rgt-identity68.7%
remove-double-neg68.7%
sub-neg68.7%
div-sub68.7%
rem-square-sqrt57.0%
sqr-neg57.0%
div-sub54.8%
sqr-neg54.8%
rem-square-sqrt68.7%
associate--l+68.8%
+-inverses68.8%
metadata-eval68.8%
sub-neg68.8%
remove-double-neg68.8%
Simplified51.0%
if 8.20000000000000011e30 < z Initial program 81.4%
associate-+l+81.4%
associate-+l+81.4%
+-commutative81.4%
+-commutative81.4%
associate-+l-81.4%
+-commutative81.4%
+-commutative81.4%
Simplified81.4%
flip--81.6%
div-inv81.6%
add-sqr-sqrt63.8%
+-commutative63.8%
add-sqr-sqrt81.7%
+-commutative81.7%
Applied egg-rr81.7%
associate-*r/81.7%
*-rgt-identity81.7%
remove-double-neg81.7%
sub-neg81.7%
div-sub81.5%
rem-square-sqrt63.8%
sqr-neg63.8%
div-sub63.8%
sqr-neg63.8%
rem-square-sqrt81.7%
associate--l+88.2%
+-inverses88.2%
metadata-eval88.2%
sub-neg88.2%
remove-double-neg88.2%
Simplified88.2%
flip--88.5%
div-inv88.5%
add-sqr-sqrt73.7%
add-sqr-sqrt88.8%
Applied egg-rr88.8%
associate-*r/88.8%
*-rgt-identity88.8%
remove-double-neg88.8%
sub-neg88.8%
div-sub88.2%
rem-square-sqrt73.4%
sqr-neg73.4%
div-sub73.7%
sqr-neg73.7%
rem-square-sqrt88.8%
associate--l+93.0%
+-inverses93.0%
metadata-eval93.0%
sub-neg93.0%
remove-double-neg93.0%
Simplified93.0%
Taylor expanded in t around inf 55.3%
Taylor expanded in z around inf 55.3%
Final simplification75.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0)))
(t_2 (- t_1 (sqrt y)))
(t_3 (sqrt (+ 1.0 x)))
(t_4 (- t_3 (sqrt x))))
(if (<= z 2.15e-32)
(+ t_4 (+ t_2 (+ 1.0 (- (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= z 1.35e+36)
(+ (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))) (+ t_4 t_2))
(+ (/ 1.0 (+ (sqrt y) t_1)) (/ 1.0 (+ t_3 (sqrt x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double t_2 = t_1 - sqrt(y);
double t_3 = sqrt((1.0 + x));
double t_4 = t_3 - sqrt(x);
double tmp;
if (z <= 2.15e-32) {
tmp = t_4 + (t_2 + (1.0 + (sqrt((1.0 + t)) - sqrt(t))));
} else if (z <= 1.35e+36) {
tmp = (1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (t_4 + t_2);
} else {
tmp = (1.0 / (sqrt(y) + t_1)) + (1.0 / (t_3 + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
t_2 = t_1 - sqrt(y)
t_3 = sqrt((1.0d0 + x))
t_4 = t_3 - sqrt(x)
if (z <= 2.15d-32) then
tmp = t_4 + (t_2 + (1.0d0 + (sqrt((1.0d0 + t)) - sqrt(t))))
else if (z <= 1.35d+36) then
tmp = (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + (t_4 + t_2)
else
tmp = (1.0d0 / (sqrt(y) + t_1)) + (1.0d0 / (t_3 + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double t_2 = t_1 - Math.sqrt(y);
double t_3 = Math.sqrt((1.0 + x));
double t_4 = t_3 - Math.sqrt(x);
double tmp;
if (z <= 2.15e-32) {
tmp = t_4 + (t_2 + (1.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))));
} else if (z <= 1.35e+36) {
tmp = (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (t_4 + t_2);
} else {
tmp = (1.0 / (Math.sqrt(y) + t_1)) + (1.0 / (t_3 + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) t_2 = t_1 - math.sqrt(y) t_3 = math.sqrt((1.0 + x)) t_4 = t_3 - math.sqrt(x) tmp = 0 if z <= 2.15e-32: tmp = t_4 + (t_2 + (1.0 + (math.sqrt((1.0 + t)) - math.sqrt(t)))) elif z <= 1.35e+36: tmp = (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (t_4 + t_2) else: tmp = (1.0 / (math.sqrt(y) + t_1)) + (1.0 / (t_3 + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) t_2 = Float64(t_1 - sqrt(y)) t_3 = sqrt(Float64(1.0 + x)) t_4 = Float64(t_3 - sqrt(x)) tmp = 0.0 if (z <= 2.15e-32) tmp = Float64(t_4 + Float64(t_2 + Float64(1.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))))); elseif (z <= 1.35e+36) tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(t_4 + t_2)); else tmp = Float64(Float64(1.0 / Float64(sqrt(y) + t_1)) + Float64(1.0 / Float64(t_3 + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
t_2 = t_1 - sqrt(y);
t_3 = sqrt((1.0 + x));
t_4 = t_3 - sqrt(x);
tmp = 0.0;
if (z <= 2.15e-32)
tmp = t_4 + (t_2 + (1.0 + (sqrt((1.0 + t)) - sqrt(t))));
elseif (z <= 1.35e+36)
tmp = (1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (t_4 + t_2);
else
tmp = (1.0 / (sqrt(y) + t_1)) + (1.0 / (t_3 + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 2.15e-32], N[(t$95$4 + N[(t$95$2 + N[(1.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e+36], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
t_2 := t\_1 - \sqrt{y}\\
t_3 := \sqrt{1 + x}\\
t_4 := t\_3 - \sqrt{x}\\
\mathbf{if}\;z \leq 2.15 \cdot 10^{-32}:\\
\;\;\;\;t\_4 + \left(t\_2 + \left(1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+36}:\\
\;\;\;\;\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(t\_4 + t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{y} + t\_1} + \frac{1}{t\_3 + \sqrt{x}}\\
\end{array}
\end{array}
if z < 2.14999999999999995e-32Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l-58.8%
+-commutative58.8%
+-commutative58.8%
Simplified58.8%
Taylor expanded in z around 0 58.8%
associate--l+96.6%
Simplified96.6%
if 2.14999999999999995e-32 < z < 1.35e36Initial program 82.8%
associate-+l+82.8%
associate-+l+82.8%
+-commutative82.8%
add082.8%
+-commutative82.8%
add082.8%
+-commutative82.8%
Simplified82.8%
flip--41.2%
div-inv41.2%
add-sqr-sqrt38.9%
add-sqr-sqrt41.3%
Applied egg-rr84.2%
associate-*r/41.3%
*-rgt-identity41.3%
remove-double-neg41.3%
sub-neg41.3%
div-sub41.3%
rem-square-sqrt38.8%
sqr-neg38.8%
div-sub38.9%
sqr-neg38.9%
rem-square-sqrt41.3%
associate--l+51.5%
+-inverses51.5%
metadata-eval51.5%
sub-neg51.5%
remove-double-neg51.5%
Simplified96.6%
Taylor expanded in t around inf 50.6%
*-un-lft-identity50.6%
add050.6%
associate-+r+50.6%
+-commutative50.6%
Applied egg-rr50.6%
if 1.35e36 < z Initial program 81.4%
associate-+l+81.4%
associate-+l+81.4%
+-commutative81.4%
+-commutative81.4%
associate-+l-81.4%
+-commutative81.4%
+-commutative81.4%
Simplified81.4%
flip--81.6%
div-inv81.6%
add-sqr-sqrt63.8%
+-commutative63.8%
add-sqr-sqrt81.7%
+-commutative81.7%
Applied egg-rr81.7%
associate-*r/81.7%
*-rgt-identity81.7%
remove-double-neg81.7%
sub-neg81.7%
div-sub81.5%
rem-square-sqrt63.8%
sqr-neg63.8%
div-sub63.8%
sqr-neg63.8%
rem-square-sqrt81.7%
associate--l+88.2%
+-inverses88.2%
metadata-eval88.2%
sub-neg88.2%
remove-double-neg88.2%
Simplified88.2%
flip--88.5%
div-inv88.5%
add-sqr-sqrt73.7%
add-sqr-sqrt88.8%
Applied egg-rr88.8%
associate-*r/88.8%
*-rgt-identity88.8%
remove-double-neg88.8%
sub-neg88.8%
div-sub88.2%
rem-square-sqrt73.4%
sqr-neg73.4%
div-sub73.7%
sqr-neg73.7%
rem-square-sqrt88.8%
associate--l+93.0%
+-inverses93.0%
metadata-eval93.0%
sub-neg93.0%
remove-double-neg93.0%
Simplified93.0%
Taylor expanded in t around inf 55.3%
Taylor expanded in z around inf 55.3%
Final simplification75.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0)))
(t_2 (- t_1 (sqrt y)))
(t_3 (sqrt (+ 1.0 x)))
(t_4 (- t_3 (sqrt x))))
(if (<= z 5e-33)
(+ t_4 (+ t_2 (+ 1.0 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))))))
(if (<= z 6.5e+36)
(+ (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))) (+ t_4 t_2))
(+ (/ 1.0 (+ (sqrt y) t_1)) (/ 1.0 (+ t_3 (sqrt x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double t_2 = t_1 - sqrt(y);
double t_3 = sqrt((1.0 + x));
double t_4 = t_3 - sqrt(x);
double tmp;
if (z <= 5e-33) {
tmp = t_4 + (t_2 + (1.0 + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
} else if (z <= 6.5e+36) {
tmp = (1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (t_4 + t_2);
} else {
tmp = (1.0 / (sqrt(y) + t_1)) + (1.0 / (t_3 + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
t_2 = t_1 - sqrt(y)
t_3 = sqrt((1.0d0 + x))
t_4 = t_3 - sqrt(x)
if (z <= 5d-33) then
tmp = t_4 + (t_2 + (1.0d0 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t)))))
else if (z <= 6.5d+36) then
tmp = (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + (t_4 + t_2)
else
tmp = (1.0d0 / (sqrt(y) + t_1)) + (1.0d0 / (t_3 + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double t_2 = t_1 - Math.sqrt(y);
double t_3 = Math.sqrt((1.0 + x));
double t_4 = t_3 - Math.sqrt(x);
double tmp;
if (z <= 5e-33) {
tmp = t_4 + (t_2 + (1.0 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))));
} else if (z <= 6.5e+36) {
tmp = (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (t_4 + t_2);
} else {
tmp = (1.0 / (Math.sqrt(y) + t_1)) + (1.0 / (t_3 + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) t_2 = t_1 - math.sqrt(y) t_3 = math.sqrt((1.0 + x)) t_4 = t_3 - math.sqrt(x) tmp = 0 if z <= 5e-33: tmp = t_4 + (t_2 + (1.0 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))))) elif z <= 6.5e+36: tmp = (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (t_4 + t_2) else: tmp = (1.0 / (math.sqrt(y) + t_1)) + (1.0 / (t_3 + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) t_2 = Float64(t_1 - sqrt(y)) t_3 = sqrt(Float64(1.0 + x)) t_4 = Float64(t_3 - sqrt(x)) tmp = 0.0 if (z <= 5e-33) tmp = Float64(t_4 + Float64(t_2 + Float64(1.0 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))))); elseif (z <= 6.5e+36) tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(t_4 + t_2)); else tmp = Float64(Float64(1.0 / Float64(sqrt(y) + t_1)) + Float64(1.0 / Float64(t_3 + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
t_2 = t_1 - sqrt(y);
t_3 = sqrt((1.0 + x));
t_4 = t_3 - sqrt(x);
tmp = 0.0;
if (z <= 5e-33)
tmp = t_4 + (t_2 + (1.0 + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
elseif (z <= 6.5e+36)
tmp = (1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (t_4 + t_2);
else
tmp = (1.0 / (sqrt(y) + t_1)) + (1.0 / (t_3 + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 5e-33], N[(t$95$4 + N[(t$95$2 + N[(1.0 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e+36], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
t_2 := t\_1 - \sqrt{y}\\
t_3 := \sqrt{1 + x}\\
t_4 := t\_3 - \sqrt{x}\\
\mathbf{if}\;z \leq 5 \cdot 10^{-33}:\\
\;\;\;\;t\_4 + \left(t\_2 + \left(1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+36}:\\
\;\;\;\;\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(t\_4 + t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{y} + t\_1} + \frac{1}{t\_3 + \sqrt{x}}\\
\end{array}
\end{array}
if z < 5.00000000000000028e-33Initial program 96.5%
associate-+l+96.5%
associate-+l+96.5%
+-commutative96.5%
+-commutative96.5%
associate-+l-59.1%
+-commutative59.1%
+-commutative59.1%
Simplified59.1%
Taylor expanded in z around 0 59.1%
associate--l+96.5%
Simplified96.5%
flip--96.7%
div-inv96.7%
add-sqr-sqrt71.1%
add-sqr-sqrt97.1%
Applied egg-rr97.1%
associate-*r/97.1%
*-rgt-identity97.1%
remove-double-neg97.1%
sub-neg97.1%
div-sub96.6%
rem-square-sqrt71.5%
sqr-neg71.5%
div-sub71.1%
sqr-neg71.1%
rem-square-sqrt97.1%
associate--l+97.7%
+-inverses97.7%
metadata-eval97.7%
sub-neg97.7%
remove-double-neg97.7%
Simplified97.7%
if 5.00000000000000028e-33 < z < 6.4999999999999998e36Initial program 83.3%
associate-+l+83.3%
associate-+l+83.3%
+-commutative83.3%
add083.3%
+-commutative83.3%
add083.3%
+-commutative83.3%
Simplified83.3%
flip--43.1%
div-inv43.1%
add-sqr-sqrt40.8%
add-sqr-sqrt43.1%
Applied egg-rr84.7%
associate-*r/43.1%
*-rgt-identity43.1%
remove-double-neg43.1%
sub-neg43.1%
div-sub43.1%
rem-square-sqrt40.7%
sqr-neg40.7%
div-sub40.8%
sqr-neg40.8%
rem-square-sqrt43.1%
associate--l+53.0%
+-inverses53.0%
metadata-eval53.0%
sub-neg53.0%
remove-double-neg53.0%
Simplified96.7%
Taylor expanded in t around inf 52.1%
*-un-lft-identity52.1%
add052.1%
associate-+r+52.2%
+-commutative52.2%
Applied egg-rr52.2%
if 6.4999999999999998e36 < z Initial program 81.4%
associate-+l+81.4%
associate-+l+81.4%
+-commutative81.4%
+-commutative81.4%
associate-+l-81.4%
+-commutative81.4%
+-commutative81.4%
Simplified81.4%
flip--81.6%
div-inv81.6%
add-sqr-sqrt63.8%
+-commutative63.8%
add-sqr-sqrt81.7%
+-commutative81.7%
Applied egg-rr81.7%
associate-*r/81.7%
*-rgt-identity81.7%
remove-double-neg81.7%
sub-neg81.7%
div-sub81.5%
rem-square-sqrt63.8%
sqr-neg63.8%
div-sub63.8%
sqr-neg63.8%
rem-square-sqrt81.7%
associate--l+88.2%
+-inverses88.2%
metadata-eval88.2%
sub-neg88.2%
remove-double-neg88.2%
Simplified88.2%
flip--88.5%
div-inv88.5%
add-sqr-sqrt73.7%
add-sqr-sqrt88.8%
Applied egg-rr88.8%
associate-*r/88.8%
*-rgt-identity88.8%
remove-double-neg88.8%
sub-neg88.8%
div-sub88.2%
rem-square-sqrt73.4%
sqr-neg73.4%
div-sub73.7%
sqr-neg73.7%
rem-square-sqrt88.8%
associate--l+93.0%
+-inverses93.0%
metadata-eval93.0%
sub-neg93.0%
remove-double-neg93.0%
Simplified93.0%
Taylor expanded in t around inf 55.3%
Taylor expanded in z around inf 55.3%
Final simplification75.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))) (t_2 (sqrt (+ 1.0 x))))
(if (<= z 2.15e-32)
(+
(- t_2 (sqrt x))
(+ (- t_1 (sqrt y)) (+ 1.0 (- (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= z 3e+30)
(+ (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))) (- (+ 1.0 t_1) (sqrt y)))
(+ (/ 1.0 (+ (sqrt y) t_1)) (/ 1.0 (+ t_2 (sqrt x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double t_2 = sqrt((1.0 + x));
double tmp;
if (z <= 2.15e-32) {
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0 + (sqrt((1.0 + t)) - sqrt(t))));
} else if (z <= 3e+30) {
tmp = (1.0 / (sqrt((1.0 + z)) + sqrt(z))) + ((1.0 + t_1) - sqrt(y));
} else {
tmp = (1.0 / (sqrt(y) + t_1)) + (1.0 / (t_2 + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
t_2 = sqrt((1.0d0 + x))
if (z <= 2.15d-32) then
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0d0 + (sqrt((1.0d0 + t)) - sqrt(t))))
else if (z <= 3d+30) then
tmp = (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + ((1.0d0 + t_1) - sqrt(y))
else
tmp = (1.0d0 / (sqrt(y) + t_1)) + (1.0d0 / (t_2 + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 2.15e-32) {
tmp = (t_2 - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + (1.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))));
} else if (z <= 3e+30) {
tmp = (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + ((1.0 + t_1) - Math.sqrt(y));
} else {
tmp = (1.0 / (Math.sqrt(y) + t_1)) + (1.0 / (t_2 + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if z <= 2.15e-32: tmp = (t_2 - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + (1.0 + (math.sqrt((1.0 + t)) - math.sqrt(t)))) elif z <= 3e+30: tmp = (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + ((1.0 + t_1) - math.sqrt(y)) else: tmp = (1.0 / (math.sqrt(y) + t_1)) + (1.0 / (t_2 + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (z <= 2.15e-32) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))))); elseif (z <= 3e+30) tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(Float64(1.0 + t_1) - sqrt(y))); else tmp = Float64(Float64(1.0 / Float64(sqrt(y) + t_1)) + Float64(1.0 / Float64(t_2 + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 2.15e-32)
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0 + (sqrt((1.0 + t)) - sqrt(t))));
elseif (z <= 3e+30)
tmp = (1.0 / (sqrt((1.0 + z)) + sqrt(z))) + ((1.0 + t_1) - sqrt(y));
else
tmp = (1.0 / (sqrt(y) + t_1)) + (1.0 / (t_2 + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.15e-32], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+30], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + t$95$1), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;z \leq 2.15 \cdot 10^{-32}:\\
\;\;\;\;\left(t\_2 - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{y}\right) + \left(1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+30}:\\
\;\;\;\;\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\left(1 + t\_1\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{y} + t\_1} + \frac{1}{t\_2 + \sqrt{x}}\\
\end{array}
\end{array}
if z < 2.14999999999999995e-32Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l-58.8%
+-commutative58.8%
+-commutative58.8%
Simplified58.8%
Taylor expanded in z around 0 58.8%
associate--l+96.6%
Simplified96.6%
if 2.14999999999999995e-32 < z < 2.99999999999999978e30Initial program 82.8%
associate-+l+82.8%
associate-+l+82.8%
+-commutative82.8%
add082.8%
+-commutative82.8%
add082.8%
+-commutative82.8%
Simplified82.8%
flip--41.2%
div-inv41.2%
add-sqr-sqrt38.9%
add-sqr-sqrt41.3%
Applied egg-rr84.2%
associate-*r/41.3%
*-rgt-identity41.3%
remove-double-neg41.3%
sub-neg41.3%
div-sub41.3%
rem-square-sqrt38.8%
sqr-neg38.8%
div-sub38.9%
sqr-neg38.9%
rem-square-sqrt41.3%
associate--l+51.5%
+-inverses51.5%
metadata-eval51.5%
sub-neg51.5%
remove-double-neg51.5%
Simplified96.6%
Taylor expanded in t around inf 50.6%
*-un-lft-identity50.6%
add050.6%
associate-+r+50.6%
+-commutative50.6%
Applied egg-rr50.6%
Taylor expanded in x around 0 49.1%
if 2.99999999999999978e30 < z Initial program 81.4%
associate-+l+81.4%
associate-+l+81.4%
+-commutative81.4%
+-commutative81.4%
associate-+l-81.4%
+-commutative81.4%
+-commutative81.4%
Simplified81.4%
flip--81.6%
div-inv81.6%
add-sqr-sqrt63.8%
+-commutative63.8%
add-sqr-sqrt81.7%
+-commutative81.7%
Applied egg-rr81.7%
associate-*r/81.7%
*-rgt-identity81.7%
remove-double-neg81.7%
sub-neg81.7%
div-sub81.5%
rem-square-sqrt63.8%
sqr-neg63.8%
div-sub63.8%
sqr-neg63.8%
rem-square-sqrt81.7%
associate--l+88.2%
+-inverses88.2%
metadata-eval88.2%
sub-neg88.2%
remove-double-neg88.2%
Simplified88.2%
flip--88.5%
div-inv88.5%
add-sqr-sqrt73.7%
add-sqr-sqrt88.8%
Applied egg-rr88.8%
associate-*r/88.8%
*-rgt-identity88.8%
remove-double-neg88.8%
sub-neg88.8%
div-sub88.2%
rem-square-sqrt73.4%
sqr-neg73.4%
div-sub73.7%
sqr-neg73.7%
rem-square-sqrt88.8%
associate--l+93.0%
+-inverses93.0%
metadata-eval93.0%
sub-neg93.0%
remove-double-neg93.0%
Simplified93.0%
Taylor expanded in t around inf 55.3%
Taylor expanded in z around inf 55.3%
Final simplification74.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ y 1.0)) (sqrt y))))
(if (<= x 2.8e-27)
(+ 1.0 (+ (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))) t_1))
(+ t_1 (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0)) - sqrt(y);
double tmp;
if (x <= 2.8e-27) {
tmp = 1.0 + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + t_1);
} else {
tmp = t_1 + (1.0 / (sqrt((1.0 + x)) + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0)) - sqrt(y)
if (x <= 2.8d-27) then
tmp = 1.0d0 + ((1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + t_1)
else
tmp = t_1 + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0)) - Math.sqrt(y);
double tmp;
if (x <= 2.8e-27) {
tmp = 1.0 + ((1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + t_1);
} else {
tmp = t_1 + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) - math.sqrt(y) tmp = 0 if x <= 2.8e-27: tmp = 1.0 + ((1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + t_1) else: tmp = t_1 + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) tmp = 0.0 if (x <= 2.8e-27) tmp = Float64(1.0 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + t_1)); else tmp = Float64(t_1 + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0)) - sqrt(y);
tmp = 0.0;
if (x <= 2.8e-27)
tmp = 1.0 + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + t_1);
else
tmp = t_1 + (1.0 / (sqrt((1.0 + x)) + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 2.8e-27], N[(1.0 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1} - \sqrt{y}\\
\mathbf{if}\;x \leq 2.8 \cdot 10^{-27}:\\
\;\;\;\;1 + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if x < 2.8e-27Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
add096.6%
+-commutative96.6%
add096.6%
+-commutative96.6%
Simplified96.6%
flip--59.2%
div-inv59.2%
add-sqr-sqrt48.1%
add-sqr-sqrt59.2%
Applied egg-rr96.7%
associate-*r/59.2%
*-rgt-identity59.2%
remove-double-neg59.2%
sub-neg59.2%
div-sub59.2%
rem-square-sqrt48.1%
sqr-neg48.1%
div-sub48.1%
sqr-neg48.1%
rem-square-sqrt59.2%
associate--l+60.1%
+-inverses60.1%
metadata-eval60.1%
sub-neg60.1%
remove-double-neg60.1%
Simplified97.8%
Taylor expanded in t around inf 59.6%
Taylor expanded in x around 0 32.7%
associate--l+48.2%
+-commutative48.2%
+-commutative48.2%
associate-+r-59.6%
+-commutative59.6%
Simplified59.6%
if 2.8e-27 < x Initial program 82.3%
associate-+l+82.3%
associate-+l+82.3%
+-commutative82.3%
+-commutative82.3%
associate-+l-61.8%
+-commutative61.8%
+-commutative61.8%
Simplified61.8%
flip--62.2%
div-inv62.2%
add-sqr-sqrt36.7%
+-commutative36.7%
add-sqr-sqrt62.2%
+-commutative62.2%
Applied egg-rr62.2%
associate-*r/62.2%
*-rgt-identity62.2%
remove-double-neg62.2%
sub-neg62.2%
div-sub61.9%
rem-square-sqrt36.4%
sqr-neg36.4%
div-sub36.7%
sqr-neg36.7%
rem-square-sqrt62.2%
associate--l+67.9%
+-inverses67.9%
metadata-eval67.9%
sub-neg67.9%
remove-double-neg67.9%
Simplified67.9%
Taylor expanded in t around inf 19.8%
associate--l+27.7%
+-commutative27.7%
+-commutative27.7%
Simplified27.7%
Taylor expanded in z around inf 17.6%
+-commutative17.6%
associate--l+25.5%
Simplified25.5%
Final simplification41.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))))
(if (<= z 3.3e+35)
(+ 1.0 (+ (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))) (- t_1 (sqrt y))))
(+ (/ 1.0 (+ (sqrt y) t_1)) (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double tmp;
if (z <= 3.3e+35) {
tmp = 1.0 + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (t_1 - sqrt(y)));
} else {
tmp = (1.0 / (sqrt(y) + t_1)) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
if (z <= 3.3d+35) then
tmp = 1.0d0 + ((1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + (t_1 - sqrt(y)))
else
tmp = (1.0d0 / (sqrt(y) + t_1)) + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double tmp;
if (z <= 3.3e+35) {
tmp = 1.0 + ((1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (t_1 - Math.sqrt(y)));
} else {
tmp = (1.0 / (Math.sqrt(y) + t_1)) + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if z <= 3.3e+35: tmp = 1.0 + ((1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (t_1 - math.sqrt(y))) else: tmp = (1.0 / (math.sqrt(y) + t_1)) + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 3.3e+35) tmp = Float64(1.0 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(t_1 - sqrt(y)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(y) + t_1)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
tmp = 0.0;
if (z <= 3.3e+35)
tmp = 1.0 + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (t_1 - sqrt(y)));
else
tmp = (1.0 / (sqrt(y) + t_1)) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 3.3e+35], N[(1.0 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 3.3 \cdot 10^{+35}:\\
\;\;\;\;1 + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(t\_1 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{y} + t\_1} + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if z < 3.3000000000000002e35Initial program 93.8%
associate-+l+93.8%
associate-+l+93.8%
+-commutative93.8%
add093.8%
+-commutative93.8%
add093.8%
+-commutative93.8%
Simplified93.8%
flip--56.5%
div-inv56.5%
add-sqr-sqrt56.1%
add-sqr-sqrt56.6%
Applied egg-rr94.1%
associate-*r/56.6%
*-rgt-identity56.6%
remove-double-neg56.6%
sub-neg56.6%
div-sub56.6%
rem-square-sqrt56.1%
sqr-neg56.1%
div-sub56.1%
sqr-neg56.1%
rem-square-sqrt56.6%
associate--l+58.6%
+-inverses58.6%
metadata-eval58.6%
sub-neg58.6%
remove-double-neg58.6%
Simplified96.6%
Taylor expanded in t around inf 57.6%
Taylor expanded in x around 0 30.3%
associate--l+46.5%
+-commutative46.5%
+-commutative46.5%
associate-+r-56.3%
+-commutative56.3%
Simplified56.3%
if 3.3000000000000002e35 < z Initial program 81.4%
associate-+l+81.4%
associate-+l+81.4%
+-commutative81.4%
+-commutative81.4%
associate-+l-81.4%
+-commutative81.4%
+-commutative81.4%
Simplified81.4%
flip--81.6%
div-inv81.6%
add-sqr-sqrt63.8%
+-commutative63.8%
add-sqr-sqrt81.7%
+-commutative81.7%
Applied egg-rr81.7%
associate-*r/81.7%
*-rgt-identity81.7%
remove-double-neg81.7%
sub-neg81.7%
div-sub81.5%
rem-square-sqrt63.8%
sqr-neg63.8%
div-sub63.8%
sqr-neg63.8%
rem-square-sqrt81.7%
associate--l+88.2%
+-inverses88.2%
metadata-eval88.2%
sub-neg88.2%
remove-double-neg88.2%
Simplified88.2%
flip--88.5%
div-inv88.5%
add-sqr-sqrt73.7%
add-sqr-sqrt88.8%
Applied egg-rr88.8%
associate-*r/88.8%
*-rgt-identity88.8%
remove-double-neg88.8%
sub-neg88.8%
div-sub88.2%
rem-square-sqrt73.4%
sqr-neg73.4%
div-sub73.7%
sqr-neg73.7%
rem-square-sqrt88.8%
associate--l+93.0%
+-inverses93.0%
metadata-eval93.0%
sub-neg93.0%
remove-double-neg93.0%
Simplified93.0%
Taylor expanded in t around inf 55.3%
Taylor expanded in z around inf 55.3%
Final simplification55.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))))
(if (<= z 3e+30)
(+ (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))) (- (+ 1.0 t_1) (sqrt y)))
(+ (/ 1.0 (+ (sqrt y) t_1)) (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double tmp;
if (z <= 3e+30) {
tmp = (1.0 / (sqrt((1.0 + z)) + sqrt(z))) + ((1.0 + t_1) - sqrt(y));
} else {
tmp = (1.0 / (sqrt(y) + t_1)) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
if (z <= 3d+30) then
tmp = (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + ((1.0d0 + t_1) - sqrt(y))
else
tmp = (1.0d0 / (sqrt(y) + t_1)) + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double tmp;
if (z <= 3e+30) {
tmp = (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + ((1.0 + t_1) - Math.sqrt(y));
} else {
tmp = (1.0 / (Math.sqrt(y) + t_1)) + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if z <= 3e+30: tmp = (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + ((1.0 + t_1) - math.sqrt(y)) else: tmp = (1.0 / (math.sqrt(y) + t_1)) + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 3e+30) tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(Float64(1.0 + t_1) - sqrt(y))); else tmp = Float64(Float64(1.0 / Float64(sqrt(y) + t_1)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
tmp = 0.0;
if (z <= 3e+30)
tmp = (1.0 / (sqrt((1.0 + z)) + sqrt(z))) + ((1.0 + t_1) - sqrt(y));
else
tmp = (1.0 / (sqrt(y) + t_1)) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 3e+30], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + t$95$1), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 3 \cdot 10^{+30}:\\
\;\;\;\;\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\left(1 + t\_1\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{y} + t\_1} + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if z < 2.99999999999999978e30Initial program 93.8%
associate-+l+93.8%
associate-+l+93.8%
+-commutative93.8%
add093.8%
+-commutative93.8%
add093.8%
+-commutative93.8%
Simplified93.8%
flip--56.5%
div-inv56.5%
add-sqr-sqrt56.1%
add-sqr-sqrt56.6%
Applied egg-rr94.1%
associate-*r/56.6%
*-rgt-identity56.6%
remove-double-neg56.6%
sub-neg56.6%
div-sub56.6%
rem-square-sqrt56.1%
sqr-neg56.1%
div-sub56.1%
sqr-neg56.1%
rem-square-sqrt56.6%
associate--l+58.6%
+-inverses58.6%
metadata-eval58.6%
sub-neg58.6%
remove-double-neg58.6%
Simplified96.6%
Taylor expanded in t around inf 57.6%
*-un-lft-identity57.6%
add057.6%
associate-+r+57.6%
+-commutative57.6%
Applied egg-rr57.6%
Taylor expanded in x around 0 46.2%
if 2.99999999999999978e30 < z Initial program 81.4%
associate-+l+81.4%
associate-+l+81.4%
+-commutative81.4%
+-commutative81.4%
associate-+l-81.4%
+-commutative81.4%
+-commutative81.4%
Simplified81.4%
flip--81.6%
div-inv81.6%
add-sqr-sqrt63.8%
+-commutative63.8%
add-sqr-sqrt81.7%
+-commutative81.7%
Applied egg-rr81.7%
associate-*r/81.7%
*-rgt-identity81.7%
remove-double-neg81.7%
sub-neg81.7%
div-sub81.5%
rem-square-sqrt63.8%
sqr-neg63.8%
div-sub63.8%
sqr-neg63.8%
rem-square-sqrt81.7%
associate--l+88.2%
+-inverses88.2%
metadata-eval88.2%
sub-neg88.2%
remove-double-neg88.2%
Simplified88.2%
flip--88.5%
div-inv88.5%
add-sqr-sqrt73.7%
add-sqr-sqrt88.8%
Applied egg-rr88.8%
associate-*r/88.8%
*-rgt-identity88.8%
remove-double-neg88.8%
sub-neg88.8%
div-sub88.2%
rem-square-sqrt73.4%
sqr-neg73.4%
div-sub73.7%
sqr-neg73.7%
rem-square-sqrt88.8%
associate--l+93.0%
+-inverses93.0%
metadata-eval93.0%
sub-neg93.0%
remove-double-neg93.0%
Simplified93.0%
Taylor expanded in t around inf 55.3%
Taylor expanded in z around inf 55.3%
Final simplification49.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 4.7e-39)
(+ 2.0 (- (+ t_1 (sqrt (+ 1.0 t))) (+ (sqrt x) (sqrt t))))
(if (<= y 5e+18)
(+ 1.0 (- (sqrt (+ y 1.0)) (sqrt y)))
(/ 1.0 (+ t_1 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 4.7e-39) {
tmp = 2.0 + ((t_1 + sqrt((1.0 + t))) - (sqrt(x) + sqrt(t)));
} else if (y <= 5e+18) {
tmp = 1.0 + (sqrt((y + 1.0)) - sqrt(y));
} else {
tmp = 1.0 / (t_1 + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 4.7d-39) then
tmp = 2.0d0 + ((t_1 + sqrt((1.0d0 + t))) - (sqrt(x) + sqrt(t)))
else if (y <= 5d+18) then
tmp = 1.0d0 + (sqrt((y + 1.0d0)) - sqrt(y))
else
tmp = 1.0d0 / (t_1 + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 4.7e-39) {
tmp = 2.0 + ((t_1 + Math.sqrt((1.0 + t))) - (Math.sqrt(x) + Math.sqrt(t)));
} else if (y <= 5e+18) {
tmp = 1.0 + (Math.sqrt((y + 1.0)) - Math.sqrt(y));
} else {
tmp = 1.0 / (t_1 + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if y <= 4.7e-39: tmp = 2.0 + ((t_1 + math.sqrt((1.0 + t))) - (math.sqrt(x) + math.sqrt(t))) elif y <= 5e+18: tmp = 1.0 + (math.sqrt((y + 1.0)) - math.sqrt(y)) else: tmp = 1.0 / (t_1 + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 4.7e-39) tmp = Float64(2.0 + Float64(Float64(t_1 + sqrt(Float64(1.0 + t))) - Float64(sqrt(x) + sqrt(t)))); elseif (y <= 5e+18) tmp = Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))); else tmp = Float64(1.0 / Float64(t_1 + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 4.7e-39)
tmp = 2.0 + ((t_1 + sqrt((1.0 + t))) - (sqrt(x) + sqrt(t)));
elseif (y <= 5e+18)
tmp = 1.0 + (sqrt((y + 1.0)) - sqrt(y));
else
tmp = 1.0 / (t_1 + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.7e-39], N[(2.0 + N[(N[(t$95$1 + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+18], N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 4.7 \cdot 10^{-39}:\\
\;\;\;\;2 + \left(\left(t\_1 + \sqrt{1 + t}\right) - \left(\sqrt{x} + \sqrt{t}\right)\right)\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+18}:\\
\;\;\;\;1 + \left(\sqrt{y + 1} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 4.7000000000000002e-39Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l-70.6%
+-commutative70.6%
+-commutative70.6%
Simplified70.6%
Taylor expanded in z around 0 52.1%
associate--l+62.2%
Simplified62.2%
Taylor expanded in y around 0 17.8%
associate--l+58.9%
Simplified58.9%
if 4.7000000000000002e-39 < y < 5e18Initial program 88.7%
associate-+l+88.7%
associate-+l+88.7%
+-commutative88.7%
+-commutative88.7%
associate-+l-76.9%
+-commutative76.9%
+-commutative76.9%
Simplified76.9%
Taylor expanded in z around inf 48.6%
Taylor expanded in t around inf 18.3%
associate--l+18.3%
+-commutative18.3%
Simplified18.3%
Taylor expanded in x around 0 48.3%
associate--l+48.3%
Simplified48.3%
if 5e18 < y Initial program 83.7%
associate-+l+83.7%
associate-+l+83.7%
+-commutative83.7%
+-commutative83.7%
associate-+l-65.4%
+-commutative65.4%
+-commutative65.4%
Simplified65.4%
Taylor expanded in z around inf 40.6%
Taylor expanded in t around inf 3.2%
associate--l+18.6%
+-commutative18.6%
Simplified18.6%
Taylor expanded in y around inf 19.2%
flip--19.2%
add-sqr-sqrt19.6%
add-sqr-sqrt19.2%
Applied egg-rr19.2%
associate--l+25.2%
+-inverses25.2%
metadata-eval25.2%
+-commutative25.2%
Simplified25.2%
Final simplification40.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))))
(if (<= y 4.7e-39)
(+ t_1 (+ 1.0 (- (sqrt (+ 1.0 z)) (+ (sqrt y) (sqrt z)))))
(if (<= y 1.5e+19)
(+ 1.0 (- t_1 (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double tmp;
if (y <= 4.7e-39) {
tmp = t_1 + (1.0 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
} else if (y <= 1.5e+19) {
tmp = 1.0 + (t_1 - sqrt(y));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
if (y <= 4.7d-39) then
tmp = t_1 + (1.0d0 + (sqrt((1.0d0 + z)) - (sqrt(y) + sqrt(z))))
else if (y <= 1.5d+19) then
tmp = 1.0d0 + (t_1 - sqrt(y))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double tmp;
if (y <= 4.7e-39) {
tmp = t_1 + (1.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(y) + Math.sqrt(z))));
} else if (y <= 1.5e+19) {
tmp = 1.0 + (t_1 - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if y <= 4.7e-39: tmp = t_1 + (1.0 + (math.sqrt((1.0 + z)) - (math.sqrt(y) + math.sqrt(z)))) elif y <= 1.5e+19: tmp = 1.0 + (t_1 - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (y <= 4.7e-39) tmp = Float64(t_1 + Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(y) + sqrt(z))))); elseif (y <= 1.5e+19) tmp = Float64(1.0 + Float64(t_1 - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
tmp = 0.0;
if (y <= 4.7e-39)
tmp = t_1 + (1.0 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
elseif (y <= 1.5e+19)
tmp = 1.0 + (t_1 - sqrt(y));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.7e-39], N[(t$95$1 + N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e+19], N[(1.0 + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;y \leq 4.7 \cdot 10^{-39}:\\
\;\;\;\;t\_1 + \left(1 + \left(\sqrt{1 + z} - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+19}:\\
\;\;\;\;1 + \left(t\_1 - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 4.7000000000000002e-39Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l-70.6%
+-commutative70.6%
+-commutative70.6%
Simplified70.6%
flip--70.9%
div-inv70.9%
add-sqr-sqrt55.9%
+-commutative55.9%
add-sqr-sqrt70.9%
+-commutative70.9%
Applied egg-rr70.9%
associate-*r/70.9%
*-rgt-identity70.9%
remove-double-neg70.9%
sub-neg70.9%
div-sub70.7%
rem-square-sqrt55.9%
sqr-neg55.9%
div-sub55.9%
sqr-neg55.9%
rem-square-sqrt70.9%
associate--l+71.3%
+-inverses71.3%
metadata-eval71.3%
sub-neg71.3%
remove-double-neg71.3%
Simplified71.3%
Taylor expanded in t around inf 42.5%
associate--l+52.7%
+-commutative52.7%
+-commutative52.7%
Simplified52.7%
Taylor expanded in x around 0 49.9%
associate--l+62.2%
Simplified62.2%
if 4.7000000000000002e-39 < y < 1.5e19Initial program 88.7%
associate-+l+88.7%
associate-+l+88.7%
+-commutative88.7%
+-commutative88.7%
associate-+l-76.9%
+-commutative76.9%
+-commutative76.9%
Simplified76.9%
Taylor expanded in z around inf 48.6%
Taylor expanded in t around inf 18.3%
associate--l+18.3%
+-commutative18.3%
Simplified18.3%
Taylor expanded in x around 0 48.3%
associate--l+48.3%
Simplified48.3%
if 1.5e19 < y Initial program 83.7%
associate-+l+83.7%
associate-+l+83.7%
+-commutative83.7%
+-commutative83.7%
associate-+l-65.4%
+-commutative65.4%
+-commutative65.4%
Simplified65.4%
Taylor expanded in z around inf 40.6%
Taylor expanded in t around inf 3.2%
associate--l+18.6%
+-commutative18.6%
Simplified18.6%
Taylor expanded in y around inf 19.2%
flip--19.2%
add-sqr-sqrt19.6%
add-sqr-sqrt19.2%
Applied egg-rr19.2%
associate--l+25.2%
+-inverses25.2%
metadata-eval25.2%
+-commutative25.2%
Simplified25.2%
Final simplification41.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))))
(if (<= z 2.55e+15)
(+ t_1 (+ 1.0 (- (sqrt (+ 1.0 z)) (+ (sqrt y) (sqrt z)))))
(+ (- t_1 (sqrt y)) (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double tmp;
if (z <= 2.55e+15) {
tmp = t_1 + (1.0 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
} else {
tmp = (t_1 - sqrt(y)) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
if (z <= 2.55d+15) then
tmp = t_1 + (1.0d0 + (sqrt((1.0d0 + z)) - (sqrt(y) + sqrt(z))))
else
tmp = (t_1 - sqrt(y)) + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double tmp;
if (z <= 2.55e+15) {
tmp = t_1 + (1.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = (t_1 - Math.sqrt(y)) + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if z <= 2.55e+15: tmp = t_1 + (1.0 + (math.sqrt((1.0 + z)) - (math.sqrt(y) + math.sqrt(z)))) else: tmp = (t_1 - math.sqrt(y)) + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 2.55e+15) tmp = Float64(t_1 + Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
tmp = 0.0;
if (z <= 2.55e+15)
tmp = t_1 + (1.0 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
else
tmp = (t_1 - sqrt(y)) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.55e+15], N[(t$95$1 + N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 2.55 \cdot 10^{+15}:\\
\;\;\;\;t\_1 + \left(1 + \left(\sqrt{1 + z} - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - \sqrt{y}\right) + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if z < 2.55e15Initial program 96.5%
associate-+l+96.5%
associate-+l+96.5%
+-commutative96.5%
+-commutative96.5%
associate-+l-59.8%
+-commutative59.8%
+-commutative59.8%
Simplified59.8%
flip--60.1%
div-inv60.1%
add-sqr-sqrt51.0%
+-commutative51.0%
add-sqr-sqrt60.1%
+-commutative60.1%
Applied egg-rr60.1%
associate-*r/60.1%
*-rgt-identity60.1%
remove-double-neg60.1%
sub-neg60.1%
div-sub59.8%
rem-square-sqrt50.7%
sqr-neg50.7%
div-sub51.0%
sqr-neg51.0%
rem-square-sqrt60.1%
associate--l+60.6%
+-inverses60.6%
metadata-eval60.6%
sub-neg60.6%
remove-double-neg60.6%
Simplified60.6%
Taylor expanded in t around inf 32.4%
associate--l+32.4%
+-commutative32.4%
+-commutative32.4%
Simplified32.4%
Taylor expanded in x around 0 29.6%
associate--l+29.6%
Simplified29.6%
if 2.55e15 < z Initial program 79.6%
associate-+l+79.6%
associate-+l+79.6%
+-commutative79.6%
+-commutative79.6%
associate-+l-79.6%
+-commutative79.6%
+-commutative79.6%
Simplified79.6%
flip--79.8%
div-inv79.8%
add-sqr-sqrt60.8%
+-commutative60.8%
add-sqr-sqrt79.8%
+-commutative79.8%
Applied egg-rr79.8%
associate-*r/79.8%
*-rgt-identity79.8%
remove-double-neg79.8%
sub-neg79.8%
div-sub79.7%
rem-square-sqrt60.8%
sqr-neg60.8%
div-sub60.8%
sqr-neg60.8%
rem-square-sqrt79.8%
associate--l+85.9%
+-inverses85.9%
metadata-eval85.9%
sub-neg85.9%
remove-double-neg85.9%
Simplified85.9%
Taylor expanded in t around inf 5.8%
associate--l+18.2%
+-commutative18.2%
+-commutative18.2%
Simplified18.2%
Taylor expanded in z around inf 28.7%
+-commutative28.7%
associate--l+48.7%
Simplified48.7%
Final simplification38.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (let* ((t_1 (- (sqrt (+ 1.0 x)) (sqrt x)))) (if (<= y 135.0) (+ 1.0 t_1) t_1)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double tmp;
if (y <= 135.0) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x)) - sqrt(x)
if (y <= 135.0d0) then
tmp = 1.0d0 + t_1
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double tmp;
if (y <= 135.0) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) tmp = 0 if y <= 135.0: tmp = 1.0 + t_1 else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) tmp = 0.0 if (y <= 135.0) tmp = Float64(1.0 + t_1); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x)) - sqrt(x);
tmp = 0.0;
if (y <= 135.0)
tmp = 1.0 + t_1;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 135.0], N[(1.0 + t$95$1), $MachinePrecision], t$95$1]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
\mathbf{if}\;y \leq 135:\\
\;\;\;\;1 + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < 135Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l-72.9%
+-commutative72.9%
+-commutative72.9%
Simplified72.9%
Taylor expanded in z around inf 52.0%
Taylor expanded in t around inf 24.1%
associate--l+24.1%
+-commutative24.1%
Simplified24.1%
Taylor expanded in y around 0 23.5%
associate--l+35.4%
Simplified35.4%
if 135 < y Initial program 83.2%
associate-+l+83.2%
associate-+l+83.2%
+-commutative83.2%
+-commutative83.2%
associate-+l-65.2%
+-commutative65.2%
+-commutative65.2%
Simplified65.2%
Taylor expanded in z around inf 40.0%
Taylor expanded in t around inf 4.5%
associate--l+18.9%
+-commutative18.9%
Simplified18.9%
Taylor expanded in y around inf 19.1%
Final simplification26.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 3.2e-27) (+ 1.0 (- (sqrt (+ y 1.0)) (sqrt y))) (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 3.2e-27) {
tmp = 1.0 + (sqrt((y + 1.0)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 3.2d-27) then
tmp = 1.0d0 + (sqrt((y + 1.0d0)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 3.2e-27) {
tmp = 1.0 + (Math.sqrt((y + 1.0)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 3.2e-27: tmp = 1.0 + (math.sqrt((y + 1.0)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 3.2e-27) tmp = Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 3.2e-27)
tmp = 1.0 + (sqrt((y + 1.0)) - sqrt(y));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 3.2e-27], N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.2 \cdot 10^{-27}:\\
\;\;\;\;1 + \left(\sqrt{y + 1} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if x < 3.19999999999999991e-27Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l-76.1%
+-commutative76.1%
+-commutative76.1%
Simplified76.1%
Taylor expanded in z around inf 51.0%
Taylor expanded in t around inf 20.2%
associate--l+35.7%
+-commutative35.7%
Simplified35.7%
Taylor expanded in x around 0 20.2%
associate--l+35.7%
Simplified35.7%
if 3.19999999999999991e-27 < x Initial program 82.3%
associate-+l+82.3%
associate-+l+82.3%
+-commutative82.3%
+-commutative82.3%
associate-+l-61.8%
+-commutative61.8%
+-commutative61.8%
Simplified61.8%
Taylor expanded in z around inf 40.1%
Taylor expanded in t around inf 6.7%
associate--l+8.2%
+-commutative8.2%
Simplified8.2%
Taylor expanded in y around inf 6.0%
flip--6.1%
add-sqr-sqrt6.7%
add-sqr-sqrt6.1%
Applied egg-rr6.1%
associate--l+13.3%
+-inverses13.3%
metadata-eval13.3%
+-commutative13.3%
Simplified13.3%
Final simplification23.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 1.0 (- (sqrt (+ y 1.0)) (sqrt y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (sqrt((y + 1.0)) - sqrt(y));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + (sqrt((y + 1.0d0)) - sqrt(y))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + (Math.sqrt((y + 1.0)) - Math.sqrt(y));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (math.sqrt((y + 1.0)) - math.sqrt(y))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (sqrt((y + 1.0)) - sqrt(y));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \left(\sqrt{y + 1} - \sqrt{y}\right)
\end{array}
Initial program 89.0%
associate-+l+89.0%
associate-+l+89.0%
+-commutative89.0%
+-commutative89.0%
associate-+l-68.5%
+-commutative68.5%
+-commutative68.5%
Simplified68.5%
Taylor expanded in z around inf 45.3%
Taylor expanded in t around inf 13.1%
associate--l+21.2%
+-commutative21.2%
Simplified21.2%
Taylor expanded in x around 0 25.2%
associate--l+44.0%
Simplified44.0%
Final simplification44.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt (+ 1.0 x)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt((1.0 + x)) - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt((1.0d0 + x)) - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt((1.0 + x)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt((1.0 + x)) - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{1 + x} - \sqrt{x}
\end{array}
Initial program 89.0%
associate-+l+89.0%
associate-+l+89.0%
+-commutative89.0%
+-commutative89.0%
associate-+l-68.5%
+-commutative68.5%
+-commutative68.5%
Simplified68.5%
Taylor expanded in z around inf 45.3%
Taylor expanded in t around inf 13.1%
associate--l+21.2%
+-commutative21.2%
Simplified21.2%
Taylor expanded in y around inf 15.5%
Final simplification15.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (+ 1.0 (* x 0.5)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 + (x * 0.5)) - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 + (x * 0.5d0)) - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 + (x * 0.5)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 + (x * 0.5)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 + (x * 0.5)) - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(1 + x \cdot 0.5\right) - \sqrt{x}
\end{array}
Initial program 89.0%
associate-+l+89.0%
associate-+l+89.0%
+-commutative89.0%
+-commutative89.0%
associate-+l-68.5%
+-commutative68.5%
+-commutative68.5%
Simplified68.5%
Taylor expanded in z around inf 45.3%
Taylor expanded in t around inf 13.1%
associate--l+21.2%
+-commutative21.2%
Simplified21.2%
Taylor expanded in y around inf 15.5%
Taylor expanded in x around 0 15.4%
*-commutative15.4%
Simplified15.4%
Final simplification15.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 1.0)
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return 1.0 end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1
\end{array}
Initial program 89.0%
associate-+l+89.0%
associate-+l+89.0%
+-commutative89.0%
+-commutative89.0%
associate-+l-68.5%
+-commutative68.5%
+-commutative68.5%
Simplified68.5%
Taylor expanded in z around inf 45.3%
Taylor expanded in t around inf 13.1%
associate--l+21.2%
+-commutative21.2%
Simplified21.2%
Taylor expanded in y around inf 15.5%
Taylor expanded in x around 0 32.7%
Final simplification32.7%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024046
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))