
(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 24 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 y) (sqrt (+ 1.0 y)))))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (- t_2 (sqrt x)))
(t_4 (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))))
(if (<= t_3 0.4)
(+ (+ t_1 (/ 1.0 (+ t_2 (sqrt x)))) t_4)
(+ (+ t_1 t_3) (+ t_4 (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (sqrt(y) + sqrt((1.0 + y)));
double t_2 = sqrt((1.0 + x));
double t_3 = t_2 - sqrt(x);
double t_4 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
double tmp;
if (t_3 <= 0.4) {
tmp = (t_1 + (1.0 / (t_2 + sqrt(x)))) + t_4;
} else {
tmp = (t_1 + t_3) + (t_4 + (1.0 / (sqrt(t) + sqrt((1.0 + 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(y) + sqrt((1.0d0 + y)))
t_2 = sqrt((1.0d0 + x))
t_3 = t_2 - sqrt(x)
t_4 = 1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))
if (t_3 <= 0.4d0) then
tmp = (t_1 + (1.0d0 / (t_2 + sqrt(x)))) + t_4
else
tmp = (t_1 + t_3) + (t_4 + (1.0d0 / (sqrt(t) + sqrt((1.0d0 + 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(y) + Math.sqrt((1.0 + y)));
double t_2 = Math.sqrt((1.0 + x));
double t_3 = t_2 - Math.sqrt(x);
double t_4 = 1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)));
double tmp;
if (t_3 <= 0.4) {
tmp = (t_1 + (1.0 / (t_2 + Math.sqrt(x)))) + t_4;
} else {
tmp = (t_1 + t_3) + (t_4 + (1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))) t_2 = math.sqrt((1.0 + x)) t_3 = t_2 - math.sqrt(x) t_4 = 1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))) tmp = 0 if t_3 <= 0.4: tmp = (t_1 + (1.0 / (t_2 + math.sqrt(x)))) + t_4 else: tmp = (t_1 + t_3) + (t_4 + (1.0 / (math.sqrt(t) + math.sqrt((1.0 + 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(y) + sqrt(Float64(1.0 + y)))) t_2 = sqrt(Float64(1.0 + x)) t_3 = Float64(t_2 - sqrt(x)) t_4 = Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) tmp = 0.0 if (t_3 <= 0.4) tmp = Float64(Float64(t_1 + Float64(1.0 / Float64(t_2 + sqrt(x)))) + t_4); else tmp = Float64(Float64(t_1 + t_3) + Float64(t_4 + Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + 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(y) + sqrt((1.0 + y)));
t_2 = sqrt((1.0 + x));
t_3 = t_2 - sqrt(x);
t_4 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
tmp = 0.0;
if (t_3 <= 0.4)
tmp = (t_1 + (1.0 / (t_2 + sqrt(x)))) + t_4;
else
tmp = (t_1 + t_3) + (t_4 + (1.0 / (sqrt(t) + sqrt((1.0 + 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[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 0.4], N[(N[(t$95$1 + N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision], N[(N[(t$95$1 + t$95$3), $MachinePrecision] + N[(t$95$4 + N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + 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{y} + \sqrt{1 + y}}\\
t_2 := \sqrt{1 + x}\\
t_3 := t\_2 - \sqrt{x}\\
t_4 := \frac{1}{\sqrt{z} + \sqrt{1 + z}}\\
\mathbf{if}\;t\_3 \leq 0.4:\\
\;\;\;\;\left(t\_1 + \frac{1}{t\_2 + \sqrt{x}}\right) + t\_4\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 + t\_3\right) + \left(t\_4 + \frac{1}{\sqrt{t} + \sqrt{1 + t}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.40000000000000002Initial program 85.9%
associate-+l+85.9%
+-commutative85.9%
+-commutative85.9%
+-commutative85.9%
Simplified85.9%
flip--85.9%
add-sqr-sqrt70.6%
add-sqr-sqrt85.9%
Applied egg-rr85.9%
associate--l+86.9%
+-inverses86.9%
metadata-eval86.9%
+-commutative86.9%
Simplified86.9%
flip--87.2%
add-sqr-sqrt70.8%
add-sqr-sqrt87.2%
Applied egg-rr87.2%
associate--l+90.8%
+-inverses90.8%
metadata-eval90.8%
+-commutative90.8%
Simplified90.8%
flip--91.1%
add-sqr-sqrt60.1%
+-commutative60.1%
add-sqr-sqrt91.7%
+-commutative91.7%
Applied egg-rr91.7%
associate--l+95.3%
+-inverses95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in t around inf 53.4%
if 0.40000000000000002 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.4%
associate-+l+97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
flip--97.4%
add-sqr-sqrt81.3%
add-sqr-sqrt97.4%
Applied egg-rr97.4%
associate--l+98.3%
+-inverses98.3%
metadata-eval98.3%
+-commutative98.3%
Simplified98.3%
flip--98.4%
add-sqr-sqrt72.5%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
associate--l+98.8%
+-inverses98.8%
metadata-eval98.8%
+-commutative98.8%
Simplified98.8%
flip--98.8%
add-sqr-sqrt80.9%
+-commutative80.9%
add-sqr-sqrt99.2%
+-commutative99.2%
Applied egg-rr99.2%
sub-neg99.2%
+-commutative99.2%
associate-+l+99.9%
sub-neg99.9%
+-inverses99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Final simplification75.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 (+ 1.0 x)))
(t_2 (sqrt (+ 1.0 y)))
(t_3 (- t_2 (sqrt y)))
(t_4 (sqrt (+ 1.0 t)))
(t_5 (sqrt (+ 1.0 z))))
(if (<=
(+ (- t_4 (sqrt t)) (+ (+ (- t_1 (sqrt x)) t_3) (- t_5 (sqrt z))))
3.5)
(+
(+ (/ 1.0 (+ (sqrt y) t_2)) (/ 1.0 (+ t_1 (sqrt x))))
(+ (/ 1.0 (+ (sqrt z) t_5)) (* 0.5 (sqrt (/ 1.0 t)))))
(+ (+ (- 1.0 (sqrt x)) t_3) (- (+ 1.0 t_4) (+ (sqrt z) (sqrt t)))))))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 = sqrt((1.0 + y));
double t_3 = t_2 - sqrt(y);
double t_4 = sqrt((1.0 + t));
double t_5 = sqrt((1.0 + z));
double tmp;
if (((t_4 - sqrt(t)) + (((t_1 - sqrt(x)) + t_3) + (t_5 - sqrt(z)))) <= 3.5) {
tmp = ((1.0 / (sqrt(y) + t_2)) + (1.0 / (t_1 + sqrt(x)))) + ((1.0 / (sqrt(z) + t_5)) + (0.5 * sqrt((1.0 / t))));
} else {
tmp = ((1.0 - sqrt(x)) + t_3) + ((1.0 + t_4) - (sqrt(z) + 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) :: t_5
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + y))
t_3 = t_2 - sqrt(y)
t_4 = sqrt((1.0d0 + t))
t_5 = sqrt((1.0d0 + z))
if (((t_4 - sqrt(t)) + (((t_1 - sqrt(x)) + t_3) + (t_5 - sqrt(z)))) <= 3.5d0) then
tmp = ((1.0d0 / (sqrt(y) + t_2)) + (1.0d0 / (t_1 + sqrt(x)))) + ((1.0d0 / (sqrt(z) + t_5)) + (0.5d0 * sqrt((1.0d0 / t))))
else
tmp = ((1.0d0 - sqrt(x)) + t_3) + ((1.0d0 + t_4) - (sqrt(z) + 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((1.0 + x));
double t_2 = Math.sqrt((1.0 + y));
double t_3 = t_2 - Math.sqrt(y);
double t_4 = Math.sqrt((1.0 + t));
double t_5 = Math.sqrt((1.0 + z));
double tmp;
if (((t_4 - Math.sqrt(t)) + (((t_1 - Math.sqrt(x)) + t_3) + (t_5 - Math.sqrt(z)))) <= 3.5) {
tmp = ((1.0 / (Math.sqrt(y) + t_2)) + (1.0 / (t_1 + Math.sqrt(x)))) + ((1.0 / (Math.sqrt(z) + t_5)) + (0.5 * Math.sqrt((1.0 / t))));
} else {
tmp = ((1.0 - Math.sqrt(x)) + t_3) + ((1.0 + t_4) - (Math.sqrt(z) + Math.sqrt(t)));
}
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 = math.sqrt((1.0 + y)) t_3 = t_2 - math.sqrt(y) t_4 = math.sqrt((1.0 + t)) t_5 = math.sqrt((1.0 + z)) tmp = 0 if ((t_4 - math.sqrt(t)) + (((t_1 - math.sqrt(x)) + t_3) + (t_5 - math.sqrt(z)))) <= 3.5: tmp = ((1.0 / (math.sqrt(y) + t_2)) + (1.0 / (t_1 + math.sqrt(x)))) + ((1.0 / (math.sqrt(z) + t_5)) + (0.5 * math.sqrt((1.0 / t)))) else: tmp = ((1.0 - math.sqrt(x)) + t_3) + ((1.0 + t_4) - (math.sqrt(z) + math.sqrt(t))) 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 = sqrt(Float64(1.0 + y)) t_3 = Float64(t_2 - sqrt(y)) t_4 = sqrt(Float64(1.0 + t)) t_5 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (Float64(Float64(t_4 - sqrt(t)) + Float64(Float64(Float64(t_1 - sqrt(x)) + t_3) + Float64(t_5 - sqrt(z)))) <= 3.5) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(y) + t_2)) + Float64(1.0 / Float64(t_1 + sqrt(x)))) + Float64(Float64(1.0 / Float64(sqrt(z) + t_5)) + Float64(0.5 * sqrt(Float64(1.0 / t))))); else tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + t_3) + Float64(Float64(1.0 + t_4) - Float64(sqrt(z) + 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((1.0 + x));
t_2 = sqrt((1.0 + y));
t_3 = t_2 - sqrt(y);
t_4 = sqrt((1.0 + t));
t_5 = sqrt((1.0 + z));
tmp = 0.0;
if (((t_4 - sqrt(t)) + (((t_1 - sqrt(x)) + t_3) + (t_5 - sqrt(z)))) <= 3.5)
tmp = ((1.0 / (sqrt(y) + t_2)) + (1.0 / (t_1 + sqrt(x)))) + ((1.0 / (sqrt(z) + t_5)) + (0.5 * sqrt((1.0 / t))));
else
tmp = ((1.0 - sqrt(x)) + t_3) + ((1.0 + t_4) - (sqrt(z) + 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[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(t$95$4 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + N[(t$95$5 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.5], N[(N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + N[(N[(1.0 + t$95$4), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $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 := \sqrt{1 + y}\\
t_3 := t\_2 - \sqrt{y}\\
t_4 := \sqrt{1 + t}\\
t_5 := \sqrt{1 + z}\\
\mathbf{if}\;\left(t\_4 - \sqrt{t}\right) + \left(\left(\left(t\_1 - \sqrt{x}\right) + t\_3\right) + \left(t\_5 - \sqrt{z}\right)\right) \leq 3.5:\\
\;\;\;\;\left(\frac{1}{\sqrt{y} + t\_2} + \frac{1}{t\_1 + \sqrt{x}}\right) + \left(\frac{1}{\sqrt{z} + t\_5} + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + t\_3\right) + \left(\left(1 + t\_4\right) - \left(\sqrt{z} + \sqrt{t}\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t))) < 3.5Initial program 90.7%
associate-+l+90.7%
+-commutative90.7%
+-commutative90.7%
+-commutative90.7%
Simplified90.7%
flip--90.7%
add-sqr-sqrt73.9%
add-sqr-sqrt90.7%
Applied egg-rr90.7%
associate--l+91.7%
+-inverses91.7%
metadata-eval91.7%
+-commutative91.7%
Simplified91.7%
flip--91.9%
add-sqr-sqrt69.6%
add-sqr-sqrt92.0%
Applied egg-rr92.0%
associate--l+94.2%
+-inverses94.2%
metadata-eval94.2%
+-commutative94.2%
Simplified94.2%
flip--94.4%
add-sqr-sqrt76.7%
+-commutative76.7%
add-sqr-sqrt94.7%
+-commutative94.7%
Applied egg-rr94.7%
associate--l+96.7%
+-inverses96.7%
metadata-eval96.7%
Simplified96.7%
Taylor expanded in t around inf 55.0%
if 3.5 < (+.f64 (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t))) Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in z around 0 100.0%
Final simplification57.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 (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))))
(if (<= (- t_2 (sqrt x)) 0.999998)
(+ (+ t_1 (/ 1.0 (+ t_2 (sqrt x)))) t_3)
(+ (+ t_3 (- (sqrt (+ 1.0 t)) (sqrt t))) (+ t_1 (- 1.0 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (sqrt(y) + sqrt((1.0 + y)));
double t_2 = sqrt((1.0 + x));
double t_3 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
double tmp;
if ((t_2 - sqrt(x)) <= 0.999998) {
tmp = (t_1 + (1.0 / (t_2 + sqrt(x)))) + t_3;
} else {
tmp = (t_3 + (sqrt((1.0 + t)) - sqrt(t))) + (t_1 + (1.0 - 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) :: tmp
t_1 = 1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))
t_2 = sqrt((1.0d0 + x))
t_3 = 1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))
if ((t_2 - sqrt(x)) <= 0.999998d0) then
tmp = (t_1 + (1.0d0 / (t_2 + sqrt(x)))) + t_3
else
tmp = (t_3 + (sqrt((1.0d0 + t)) - sqrt(t))) + (t_1 + (1.0d0 - 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 = 1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)));
double t_2 = Math.sqrt((1.0 + x));
double t_3 = 1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)));
double tmp;
if ((t_2 - Math.sqrt(x)) <= 0.999998) {
tmp = (t_1 + (1.0 / (t_2 + Math.sqrt(x)))) + t_3;
} else {
tmp = (t_3 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (t_1 + (1.0 - Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))) t_2 = math.sqrt((1.0 + x)) t_3 = 1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))) tmp = 0 if (t_2 - math.sqrt(x)) <= 0.999998: tmp = (t_1 + (1.0 / (t_2 + math.sqrt(x)))) + t_3 else: tmp = (t_3 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (t_1 + (1.0 - math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) t_2 = sqrt(Float64(1.0 + x)) t_3 = Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) tmp = 0.0 if (Float64(t_2 - sqrt(x)) <= 0.999998) tmp = Float64(Float64(t_1 + Float64(1.0 / Float64(t_2 + sqrt(x)))) + t_3); else tmp = Float64(Float64(t_3 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(t_1 + Float64(1.0 - 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 = 1.0 / (sqrt(y) + sqrt((1.0 + y)));
t_2 = sqrt((1.0 + x));
t_3 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
tmp = 0.0;
if ((t_2 - sqrt(x)) <= 0.999998)
tmp = (t_1 + (1.0 / (t_2 + sqrt(x)))) + t_3;
else
tmp = (t_3 + (sqrt((1.0 + t)) - sqrt(t))) + (t_1 + (1.0 - 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[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.999998], N[(N[(t$95$1 + N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision], N[(N[(t$95$3 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 - 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 := \frac{1}{\sqrt{y} + \sqrt{1 + y}}\\
t_2 := \sqrt{1 + x}\\
t_3 := \frac{1}{\sqrt{z} + \sqrt{1 + z}}\\
\mathbf{if}\;t\_2 - \sqrt{x} \leq 0.999998:\\
\;\;\;\;\left(t\_1 + \frac{1}{t\_2 + \sqrt{x}}\right) + t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(t\_3 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(t\_1 + \left(1 - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.999998000000000054Initial program 86.0%
associate-+l+86.0%
+-commutative86.0%
+-commutative86.0%
+-commutative86.0%
Simplified86.0%
flip--86.0%
add-sqr-sqrt70.8%
add-sqr-sqrt86.0%
Applied egg-rr86.0%
associate--l+87.0%
+-inverses87.0%
metadata-eval87.0%
+-commutative87.0%
Simplified87.0%
flip--87.3%
add-sqr-sqrt71.0%
add-sqr-sqrt87.3%
Applied egg-rr87.3%
associate--l+90.9%
+-inverses90.9%
metadata-eval90.9%
+-commutative90.9%
Simplified90.9%
flip--91.2%
add-sqr-sqrt60.4%
+-commutative60.4%
add-sqr-sqrt91.7%
+-commutative91.7%
Applied egg-rr91.7%
associate--l+95.3%
+-inverses95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in t around inf 53.1%
if 0.999998000000000054 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.4%
associate-+l+97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
flip--97.4%
add-sqr-sqrt81.2%
add-sqr-sqrt97.4%
Applied egg-rr97.4%
associate--l+98.3%
+-inverses98.3%
metadata-eval98.3%
+-commutative98.3%
Simplified98.3%
flip--98.3%
add-sqr-sqrt72.2%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
associate--l+98.8%
+-inverses98.8%
metadata-eval98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in x around 0 98.8%
Final simplification74.3%
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) (sqrt (+ 1.0 y)))) (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))) (+ (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) (- (sqrt (+ 1.0 t)) (sqrt t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)))) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t)));
}
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) + sqrt((1.0d0 + y)))) + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x)))) + ((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + (sqrt((1.0d0 + t)) - sqrt(t)))
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) + Math.sqrt((1.0 + y)))) + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x)))) + ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)))) + ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + (math.sqrt((1.0 + t)) - math.sqrt(t)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x)))) + Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)))) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{y} + \sqrt{1 + y}} + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) + \left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\end{array}
Initial program 91.3%
associate-+l+91.3%
+-commutative91.3%
+-commutative91.3%
+-commutative91.3%
Simplified91.3%
flip--91.3%
add-sqr-sqrt75.6%
add-sqr-sqrt91.3%
Applied egg-rr91.3%
associate--l+92.2%
+-inverses92.2%
metadata-eval92.2%
+-commutative92.2%
Simplified92.2%
flip--92.4%
add-sqr-sqrt71.6%
add-sqr-sqrt92.5%
Applied egg-rr92.5%
associate--l+94.6%
+-inverses94.6%
metadata-eval94.6%
+-commutative94.6%
Simplified94.6%
flip--94.7%
add-sqr-sqrt78.3%
+-commutative78.3%
add-sqr-sqrt95.0%
+-commutative95.0%
Applied egg-rr95.0%
associate--l+96.9%
+-inverses96.9%
metadata-eval96.9%
Simplified96.9%
Final simplification96.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 (+ 1.0 z))))
(if (<= z 1.04e-10)
(+
(+ (- 1.0 (sqrt x)) (+ 1.0 (- (* y (+ 0.5 (* y -0.125))) (sqrt y))))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- t_1 (sqrt z))))
(+
(+
(/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y))))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))
(/ 1.0 (+ (sqrt z) 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 + z));
double tmp;
if (z <= 1.04e-10) {
tmp = ((1.0 - sqrt(x)) + (1.0 + ((y * (0.5 + (y * -0.125))) - sqrt(y)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (t_1 - sqrt(z)));
} else {
tmp = ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)))) + (1.0 / (sqrt(z) + 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 + z))
if (z <= 1.04d-10) then
tmp = ((1.0d0 - sqrt(x)) + (1.0d0 + ((y * (0.5d0 + (y * (-0.125d0)))) - sqrt(y)))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (t_1 - sqrt(z)))
else
tmp = ((1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))) + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x)))) + (1.0d0 / (sqrt(z) + 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 + z));
double tmp;
if (z <= 1.04e-10) {
tmp = ((1.0 - Math.sqrt(x)) + (1.0 + ((y * (0.5 + (y * -0.125))) - Math.sqrt(y)))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (t_1 - Math.sqrt(z)));
} else {
tmp = ((1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))) + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x)))) + (1.0 / (Math.sqrt(z) + 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 + z)) tmp = 0 if z <= 1.04e-10: tmp = ((1.0 - math.sqrt(x)) + (1.0 + ((y * (0.5 + (y * -0.125))) - math.sqrt(y)))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (t_1 - math.sqrt(z))) else: tmp = ((1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)))) + (1.0 / (math.sqrt(z) + t_1)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (z <= 1.04e-10) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 + Float64(Float64(y * Float64(0.5 + Float64(y * -0.125))) - sqrt(y)))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(t_1 - sqrt(z)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x)))) + Float64(1.0 / Float64(sqrt(z) + 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 + z));
tmp = 0.0;
if (z <= 1.04e-10)
tmp = ((1.0 - sqrt(x)) + (1.0 + ((y * (0.5 + (y * -0.125))) - sqrt(y)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (t_1 - sqrt(z)));
else
tmp = ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)))) + (1.0 / (sqrt(z) + 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[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.04e-10], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(y * N[(0.5 + N[(y * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 1.04 \cdot 10^{-10}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(1 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(t\_1 - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{y} + \sqrt{1 + y}} + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) + \frac{1}{\sqrt{z} + t\_1}\\
\end{array}
\end{array}
if z < 1.04e-10Initial program 97.5%
associate-+l+97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 46.2%
Taylor expanded in y around 0 27.0%
associate--l+16.6%
Simplified27.0%
if 1.04e-10 < z Initial program 84.8%
associate-+l+84.8%
+-commutative84.8%
+-commutative84.8%
+-commutative84.8%
Simplified84.8%
flip--84.9%
add-sqr-sqrt71.9%
add-sqr-sqrt84.9%
Applied egg-rr84.9%
associate--l+86.3%
+-inverses86.3%
metadata-eval86.3%
+-commutative86.3%
Simplified86.3%
flip--86.6%
add-sqr-sqrt44.0%
add-sqr-sqrt86.8%
Applied egg-rr86.8%
associate--l+91.1%
+-inverses91.1%
metadata-eval91.1%
+-commutative91.1%
Simplified91.1%
flip--91.2%
add-sqr-sqrt76.4%
+-commutative76.4%
add-sqr-sqrt91.3%
+-commutative91.3%
Applied egg-rr91.3%
associate--l+94.7%
+-inverses94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in t around inf 53.6%
Final simplification40.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 y))))
(if (<= t 4e+15)
(+
(+ (- 1.0 (sqrt x)) (- t_1 (sqrt y)))
(- (+ 1.0 (sqrt (+ 1.0 t))) (+ (sqrt z) (sqrt t))))
(+
(+ (/ 1.0 (+ (sqrt y) t_1)) (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (t <= 4e+15) {
tmp = ((1.0 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0 + sqrt((1.0 + t))) - (sqrt(z) + sqrt(t)));
} else {
tmp = ((1.0 / (sqrt(y) + t_1)) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)))) + (1.0 / (sqrt(z) + sqrt((1.0 + z))));
}
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 + y))
if (t <= 4d+15) then
tmp = ((1.0d0 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0d0 + sqrt((1.0d0 + t))) - (sqrt(z) + sqrt(t)))
else
tmp = ((1.0d0 / (sqrt(y) + t_1)) + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x)))) + (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z))))
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 + y));
double tmp;
if (t <= 4e+15) {
tmp = ((1.0 - Math.sqrt(x)) + (t_1 - Math.sqrt(y))) + ((1.0 + Math.sqrt((1.0 + t))) - (Math.sqrt(z) + Math.sqrt(t)));
} else {
tmp = ((1.0 / (Math.sqrt(y) + t_1)) + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x)))) + (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if t <= 4e+15: tmp = ((1.0 - math.sqrt(x)) + (t_1 - math.sqrt(y))) + ((1.0 + math.sqrt((1.0 + t))) - (math.sqrt(z) + math.sqrt(t))) else: tmp = ((1.0 / (math.sqrt(y) + t_1)) + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)))) + (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t <= 4e+15) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(t_1 - sqrt(y))) + Float64(Float64(1.0 + sqrt(Float64(1.0 + t))) - Float64(sqrt(z) + sqrt(t)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(y) + t_1)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x)))) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z))))); 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 + y));
tmp = 0.0;
if (t <= 4e+15)
tmp = ((1.0 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0 + sqrt((1.0 + t))) - (sqrt(z) + sqrt(t)));
else
tmp = ((1.0 / (sqrt(y) + t_1)) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)))) + (1.0 / (sqrt(z) + sqrt((1.0 + z))));
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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 4e+15], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;t \leq 4 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(t\_1 - \sqrt{y}\right)\right) + \left(\left(1 + \sqrt{1 + t}\right) - \left(\sqrt{z} + \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{y} + t\_1} + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\\
\end{array}
\end{array}
if t < 4e15Initial program 96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 47.7%
Taylor expanded in z around 0 25.0%
if 4e15 < t Initial program 85.0%
associate-+l+85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
flip--85.0%
add-sqr-sqrt71.7%
add-sqr-sqrt85.0%
Applied egg-rr85.0%
associate--l+85.9%
+-inverses85.9%
metadata-eval85.9%
+-commutative85.9%
Simplified85.9%
flip--86.1%
add-sqr-sqrt70.2%
add-sqr-sqrt86.3%
Applied egg-rr86.3%
associate--l+90.5%
+-inverses90.5%
metadata-eval90.5%
+-commutative90.5%
Simplified90.5%
flip--90.7%
add-sqr-sqrt75.9%
+-commutative75.9%
add-sqr-sqrt91.0%
+-commutative91.0%
Applied egg-rr91.0%
associate--l+94.9%
+-inverses94.9%
metadata-eval94.9%
Simplified94.9%
Taylor expanded in t around inf 94.9%
Final simplification56.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 (+ 1.0 y))))
(if (<= t 4e+15)
(+
(+ (- 1.0 (sqrt x)) (- t_1 (sqrt y)))
(- (+ 1.0 (sqrt (+ 1.0 t))) (+ (sqrt z) (sqrt t))))
(+
(+ (/ 1.0 (+ (sqrt y) t_1)) (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))
(- (sqrt (+ 1.0 z)) (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (t <= 4e+15) {
tmp = ((1.0 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0 + sqrt((1.0 + t))) - (sqrt(z) + sqrt(t)));
} else {
tmp = ((1.0 / (sqrt(y) + t_1)) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)))) + (sqrt((1.0 + z)) - sqrt(z));
}
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 + y))
if (t <= 4d+15) then
tmp = ((1.0d0 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0d0 + sqrt((1.0d0 + t))) - (sqrt(z) + sqrt(t)))
else
tmp = ((1.0d0 / (sqrt(y) + t_1)) + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x)))) + (sqrt((1.0d0 + z)) - sqrt(z))
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 + y));
double tmp;
if (t <= 4e+15) {
tmp = ((1.0 - Math.sqrt(x)) + (t_1 - Math.sqrt(y))) + ((1.0 + Math.sqrt((1.0 + t))) - (Math.sqrt(z) + Math.sqrt(t)));
} else {
tmp = ((1.0 / (Math.sqrt(y) + t_1)) + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x)))) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if t <= 4e+15: tmp = ((1.0 - math.sqrt(x)) + (t_1 - math.sqrt(y))) + ((1.0 + math.sqrt((1.0 + t))) - (math.sqrt(z) + math.sqrt(t))) else: tmp = ((1.0 / (math.sqrt(y) + t_1)) + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)))) + (math.sqrt((1.0 + z)) - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t <= 4e+15) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(t_1 - sqrt(y))) + Float64(Float64(1.0 + sqrt(Float64(1.0 + t))) - Float64(sqrt(z) + sqrt(t)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(y) + t_1)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x)))) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); 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 + y));
tmp = 0.0;
if (t <= 4e+15)
tmp = ((1.0 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0 + sqrt((1.0 + t))) - (sqrt(z) + sqrt(t)));
else
tmp = ((1.0 / (sqrt(y) + t_1)) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)))) + (sqrt((1.0 + z)) - sqrt(z));
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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 4e+15], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;t \leq 4 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(t\_1 - \sqrt{y}\right)\right) + \left(\left(1 + \sqrt{1 + t}\right) - \left(\sqrt{z} + \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{y} + t\_1} + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if t < 4e15Initial program 96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 47.7%
Taylor expanded in z around 0 25.0%
if 4e15 < t Initial program 85.0%
associate-+l+85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
flip--85.0%
add-sqr-sqrt71.7%
add-sqr-sqrt85.0%
Applied egg-rr85.0%
associate--l+85.9%
+-inverses85.9%
metadata-eval85.9%
+-commutative85.9%
Simplified85.9%
Taylor expanded in t around inf 85.9%
flip--90.7%
add-sqr-sqrt75.9%
+-commutative75.9%
add-sqr-sqrt91.0%
+-commutative91.0%
Applied egg-rr86.4%
associate--l+94.9%
+-inverses94.9%
metadata-eval94.9%
Simplified90.2%
Final simplification54.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 y))))
(if (<= t 4e+15)
(+
(+ (- 1.0 (sqrt x)) (- t_1 (sqrt y)))
(- (+ 1.0 (sqrt (+ 1.0 t))) (+ (sqrt z) (sqrt t))))
(+
(+ (/ 1.0 (+ (sqrt y) t_1)) (- (sqrt (+ 1.0 x)) (sqrt x)))
(- (sqrt (+ 1.0 z)) (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (t <= 4e+15) {
tmp = ((1.0 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0 + sqrt((1.0 + t))) - (sqrt(z) + sqrt(t)));
} else {
tmp = ((1.0 / (sqrt(y) + t_1)) + (sqrt((1.0 + x)) - sqrt(x))) + (sqrt((1.0 + z)) - sqrt(z));
}
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 + y))
if (t <= 4d+15) then
tmp = ((1.0d0 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0d0 + sqrt((1.0d0 + t))) - (sqrt(z) + sqrt(t)))
else
tmp = ((1.0d0 / (sqrt(y) + t_1)) + (sqrt((1.0d0 + x)) - sqrt(x))) + (sqrt((1.0d0 + z)) - sqrt(z))
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 + y));
double tmp;
if (t <= 4e+15) {
tmp = ((1.0 - Math.sqrt(x)) + (t_1 - Math.sqrt(y))) + ((1.0 + Math.sqrt((1.0 + t))) - (Math.sqrt(z) + Math.sqrt(t)));
} else {
tmp = ((1.0 / (Math.sqrt(y) + t_1)) + (Math.sqrt((1.0 + x)) - Math.sqrt(x))) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if t <= 4e+15: tmp = ((1.0 - math.sqrt(x)) + (t_1 - math.sqrt(y))) + ((1.0 + math.sqrt((1.0 + t))) - (math.sqrt(z) + math.sqrt(t))) else: tmp = ((1.0 / (math.sqrt(y) + t_1)) + (math.sqrt((1.0 + x)) - math.sqrt(x))) + (math.sqrt((1.0 + z)) - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t <= 4e+15) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(t_1 - sqrt(y))) + Float64(Float64(1.0 + sqrt(Float64(1.0 + t))) - Float64(sqrt(z) + sqrt(t)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(y) + t_1)) + Float64(sqrt(Float64(1.0 + x)) - sqrt(x))) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); 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 + y));
tmp = 0.0;
if (t <= 4e+15)
tmp = ((1.0 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0 + sqrt((1.0 + t))) - (sqrt(z) + sqrt(t)));
else
tmp = ((1.0 / (sqrt(y) + t_1)) + (sqrt((1.0 + x)) - sqrt(x))) + (sqrt((1.0 + z)) - sqrt(z));
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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 4e+15], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;t \leq 4 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(t\_1 - \sqrt{y}\right)\right) + \left(\left(1 + \sqrt{1 + t}\right) - \left(\sqrt{z} + \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{y} + t\_1} + \left(\sqrt{1 + x} - \sqrt{x}\right)\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if t < 4e15Initial program 96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 47.7%
Taylor expanded in z around 0 25.0%
if 4e15 < t Initial program 85.0%
associate-+l+85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
flip--85.0%
add-sqr-sqrt71.7%
add-sqr-sqrt85.0%
Applied egg-rr85.0%
associate--l+85.9%
+-inverses85.9%
metadata-eval85.9%
+-commutative85.9%
Simplified85.9%
Taylor expanded in t around inf 85.9%
Final simplification52.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 y)) (sqrt y))))
(if (<= t 4e+15)
(+
(+ (- 1.0 (sqrt x)) t_1)
(- (+ 1.0 (sqrt (+ 1.0 t))) (+ (sqrt z) (sqrt t))))
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+ 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((1.0 + y)) - sqrt(y);
double tmp;
if (t <= 4e+15) {
tmp = ((1.0 - sqrt(x)) + t_1) + ((1.0 + sqrt((1.0 + t))) - (sqrt(z) + sqrt(t)));
} else {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (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((1.0d0 + y)) - sqrt(y)
if (t <= 4d+15) then
tmp = ((1.0d0 - sqrt(x)) + t_1) + ((1.0d0 + sqrt((1.0d0 + t))) - (sqrt(z) + sqrt(t)))
else
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + (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((1.0 + y)) - Math.sqrt(y);
double tmp;
if (t <= 4e+15) {
tmp = ((1.0 - Math.sqrt(x)) + t_1) + ((1.0 + Math.sqrt((1.0 + t))) - (Math.sqrt(z) + Math.sqrt(t)));
} else {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (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((1.0 + y)) - math.sqrt(y) tmp = 0 if t <= 4e+15: tmp = ((1.0 - math.sqrt(x)) + t_1) + ((1.0 + math.sqrt((1.0 + t))) - (math.sqrt(z) + math.sqrt(t))) else: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (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(1.0 + y)) - sqrt(y)) tmp = 0.0 if (t <= 4e+15) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + t_1) + Float64(Float64(1.0 + sqrt(Float64(1.0 + t))) - Float64(sqrt(z) + sqrt(t)))); else tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 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((1.0 + y)) - sqrt(y);
tmp = 0.0;
if (t <= 4e+15)
tmp = ((1.0 - sqrt(x)) + t_1) + ((1.0 + sqrt((1.0 + t))) - (sqrt(z) + sqrt(t)));
else
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (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[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 4e+15], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(1.0 + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $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]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y} - \sqrt{y}\\
\mathbf{if}\;t \leq 4 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + t\_1\right) + \left(\left(1 + \sqrt{1 + t}\right) - \left(\sqrt{z} + \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(t\_1 + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)\\
\end{array}
\end{array}
if t < 4e15Initial program 96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 47.7%
Taylor expanded in z around 0 25.0%
if 4e15 < t Initial program 85.0%
associate-+l+85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
flip--90.7%
add-sqr-sqrt75.9%
+-commutative75.9%
add-sqr-sqrt91.0%
+-commutative91.0%
Applied egg-rr85.5%
associate--l+94.9%
+-inverses94.9%
metadata-eval94.9%
Simplified89.7%
Taylor expanded in t around inf 89.7%
Final simplification54.5%
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 (* 0.5 (sqrt (/ 1.0 z)))) (t_2 (sqrt (+ 1.0 y))))
(if (<= x 6.6e-83)
(+
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))
(+ (- 1.0 (sqrt x)) (- t_2 (sqrt y))))
(if (<= x 16000000000000.0)
(+ (+ (/ 1.0 (+ (sqrt y) t_2)) (- (sqrt (+ 1.0 x)) (sqrt x))) t_1)
(+
(+ (* 0.5 (sqrt (/ 1.0 x))) (* 0.5 (sqrt (/ 1.0 y))))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 0.5 * sqrt((1.0 / z));
double t_2 = sqrt((1.0 + y));
double tmp;
if (x <= 6.6e-83) {
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 - sqrt(x)) + (t_2 - sqrt(y)));
} else if (x <= 16000000000000.0) {
tmp = ((1.0 / (sqrt(y) + t_2)) + (sqrt((1.0 + x)) - sqrt(x))) + t_1;
} else {
tmp = ((0.5 * sqrt((1.0 / x))) + (0.5 * sqrt((1.0 / y)))) + ((sqrt((1.0 + t)) - sqrt(t)) + 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) :: t_2
real(8) :: tmp
t_1 = 0.5d0 * sqrt((1.0d0 / z))
t_2 = sqrt((1.0d0 + y))
if (x <= 6.6d-83) then
tmp = (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + ((1.0d0 - sqrt(x)) + (t_2 - sqrt(y)))
else if (x <= 16000000000000.0d0) then
tmp = ((1.0d0 / (sqrt(y) + t_2)) + (sqrt((1.0d0 + x)) - sqrt(x))) + t_1
else
tmp = ((0.5d0 * sqrt((1.0d0 / x))) + (0.5d0 * sqrt((1.0d0 / y)))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + 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 = 0.5 * Math.sqrt((1.0 / z));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (x <= 6.6e-83) {
tmp = (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + ((1.0 - Math.sqrt(x)) + (t_2 - Math.sqrt(y)));
} else if (x <= 16000000000000.0) {
tmp = ((1.0 / (Math.sqrt(y) + t_2)) + (Math.sqrt((1.0 + x)) - Math.sqrt(x))) + t_1;
} else {
tmp = ((0.5 * Math.sqrt((1.0 / x))) + (0.5 * Math.sqrt((1.0 / y)))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 0.5 * math.sqrt((1.0 / z)) t_2 = math.sqrt((1.0 + y)) tmp = 0 if x <= 6.6e-83: tmp = (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + ((1.0 - math.sqrt(x)) + (t_2 - math.sqrt(y))) elif x <= 16000000000000.0: tmp = ((1.0 / (math.sqrt(y) + t_2)) + (math.sqrt((1.0 + x)) - math.sqrt(x))) + t_1 else: tmp = ((0.5 * math.sqrt((1.0 / x))) + (0.5 * math.sqrt((1.0 / y)))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(0.5 * sqrt(Float64(1.0 / z))) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (x <= 6.6e-83) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(Float64(1.0 - sqrt(x)) + Float64(t_2 - sqrt(y)))); elseif (x <= 16000000000000.0) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(y) + t_2)) + Float64(sqrt(Float64(1.0 + x)) - sqrt(x))) + t_1); else tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 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 = 0.5 * sqrt((1.0 / z));
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (x <= 6.6e-83)
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 - sqrt(x)) + (t_2 - sqrt(y)));
elseif (x <= 16000000000000.0)
tmp = ((1.0 / (sqrt(y) + t_2)) + (sqrt((1.0 + x)) - sqrt(x))) + t_1;
else
tmp = ((0.5 * sqrt((1.0 / x))) + (0.5 * sqrt((1.0 / y)))) + ((sqrt((1.0 + t)) - sqrt(t)) + 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[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 6.6e-83], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 16000000000000.0], N[(N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 0.5 \cdot \sqrt{\frac{1}{z}}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;x \leq 6.6 \cdot 10^{-83}:\\
\;\;\;\;\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\left(1 - \sqrt{x}\right) + \left(t\_2 - \sqrt{y}\right)\right)\\
\mathbf{elif}\;x \leq 16000000000000:\\
\;\;\;\;\left(\frac{1}{\sqrt{y} + t\_2} + \left(\sqrt{1 + x} - \sqrt{x}\right)\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + t\_1\right)\\
\end{array}
\end{array}
if x < 6.5999999999999999e-83Initial program 98.2%
associate-+l+98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 98.2%
Taylor expanded in t around inf 56.0%
flip--98.6%
add-sqr-sqrt71.3%
add-sqr-sqrt98.6%
Applied egg-rr56.0%
associate--l+99.0%
+-inverses99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified56.0%
if 6.5999999999999999e-83 < x < 1.6e13Initial program 91.9%
associate-+l+91.9%
+-commutative91.9%
+-commutative91.9%
+-commutative91.9%
Simplified91.9%
flip--91.9%
add-sqr-sqrt77.9%
add-sqr-sqrt91.9%
Applied egg-rr91.9%
associate--l+94.4%
+-inverses94.4%
metadata-eval94.4%
+-commutative94.4%
Simplified94.4%
Taylor expanded in t around inf 50.7%
Taylor expanded in z around inf 23.4%
if 1.6e13 < x Initial program 86.2%
associate-+l+86.2%
+-commutative86.2%
+-commutative86.2%
+-commutative86.2%
Simplified86.2%
Taylor expanded in z around inf 39.0%
Taylor expanded in x around inf 42.0%
Taylor expanded in y around inf 24.1%
Final simplification35.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 (+ 1.0 y)))
(t_2 (/ 1.0 (+ (sqrt y) t_1)))
(t_3 (sqrt (+ 1.0 z))))
(if (<= x 6.6e-83)
(+ (/ 1.0 (+ (sqrt z) t_3)) (+ (- 1.0 (sqrt x)) (- t_1 (sqrt y))))
(if (<= x 115000.0)
(+ (+ t_2 (- (sqrt (+ 1.0 x)) (sqrt x))) (* 0.5 (sqrt (/ 1.0 z))))
(+ (- t_3 (sqrt z)) (+ t_2 (* 0.5 (sqrt (/ 1.0 x)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = 1.0 / (sqrt(y) + t_1);
double t_3 = sqrt((1.0 + z));
double tmp;
if (x <= 6.6e-83) {
tmp = (1.0 / (sqrt(z) + t_3)) + ((1.0 - sqrt(x)) + (t_1 - sqrt(y)));
} else if (x <= 115000.0) {
tmp = (t_2 + (sqrt((1.0 + x)) - sqrt(x))) + (0.5 * sqrt((1.0 / z)));
} else {
tmp = (t_3 - sqrt(z)) + (t_2 + (0.5 * sqrt((1.0 / 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) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = 1.0d0 / (sqrt(y) + t_1)
t_3 = sqrt((1.0d0 + z))
if (x <= 6.6d-83) then
tmp = (1.0d0 / (sqrt(z) + t_3)) + ((1.0d0 - sqrt(x)) + (t_1 - sqrt(y)))
else if (x <= 115000.0d0) then
tmp = (t_2 + (sqrt((1.0d0 + x)) - sqrt(x))) + (0.5d0 * sqrt((1.0d0 / z)))
else
tmp = (t_3 - sqrt(z)) + (t_2 + (0.5d0 * sqrt((1.0d0 / 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 + y));
double t_2 = 1.0 / (Math.sqrt(y) + t_1);
double t_3 = Math.sqrt((1.0 + z));
double tmp;
if (x <= 6.6e-83) {
tmp = (1.0 / (Math.sqrt(z) + t_3)) + ((1.0 - Math.sqrt(x)) + (t_1 - Math.sqrt(y)));
} else if (x <= 115000.0) {
tmp = (t_2 + (Math.sqrt((1.0 + x)) - Math.sqrt(x))) + (0.5 * Math.sqrt((1.0 / z)));
} else {
tmp = (t_3 - Math.sqrt(z)) + (t_2 + (0.5 * Math.sqrt((1.0 / x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = 1.0 / (math.sqrt(y) + t_1) t_3 = math.sqrt((1.0 + z)) tmp = 0 if x <= 6.6e-83: tmp = (1.0 / (math.sqrt(z) + t_3)) + ((1.0 - math.sqrt(x)) + (t_1 - math.sqrt(y))) elif x <= 115000.0: tmp = (t_2 + (math.sqrt((1.0 + x)) - math.sqrt(x))) + (0.5 * math.sqrt((1.0 / z))) else: tmp = (t_3 - math.sqrt(z)) + (t_2 + (0.5 * math.sqrt((1.0 / x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = Float64(1.0 / Float64(sqrt(y) + t_1)) t_3 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (x <= 6.6e-83) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + t_3)) + Float64(Float64(1.0 - sqrt(x)) + Float64(t_1 - sqrt(y)))); elseif (x <= 115000.0) tmp = Float64(Float64(t_2 + Float64(sqrt(Float64(1.0 + x)) - sqrt(x))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); else tmp = Float64(Float64(t_3 - sqrt(z)) + Float64(t_2 + Float64(0.5 * sqrt(Float64(1.0 / 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 + y));
t_2 = 1.0 / (sqrt(y) + t_1);
t_3 = sqrt((1.0 + z));
tmp = 0.0;
if (x <= 6.6e-83)
tmp = (1.0 / (sqrt(z) + t_3)) + ((1.0 - sqrt(x)) + (t_1 - sqrt(y)));
elseif (x <= 115000.0)
tmp = (t_2 + (sqrt((1.0 + x)) - sqrt(x))) + (0.5 * sqrt((1.0 / z)));
else
tmp = (t_3 - sqrt(z)) + (t_2 + (0.5 * sqrt((1.0 / 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 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 6.6e-83], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 115000.0], N[(N[(t$95$2 + N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \frac{1}{\sqrt{y} + t\_1}\\
t_3 := \sqrt{1 + z}\\
\mathbf{if}\;x \leq 6.6 \cdot 10^{-83}:\\
\;\;\;\;\frac{1}{\sqrt{z} + t\_3} + \left(\left(1 - \sqrt{x}\right) + \left(t\_1 - \sqrt{y}\right)\right)\\
\mathbf{elif}\;x \leq 115000:\\
\;\;\;\;\left(t\_2 + \left(\sqrt{1 + x} - \sqrt{x}\right)\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_3 - \sqrt{z}\right) + \left(t\_2 + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\\
\end{array}
\end{array}
if x < 6.5999999999999999e-83Initial program 98.2%
associate-+l+98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 98.2%
Taylor expanded in t around inf 56.0%
flip--98.6%
add-sqr-sqrt71.3%
add-sqr-sqrt98.6%
Applied egg-rr56.0%
associate--l+99.0%
+-inverses99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified56.0%
if 6.5999999999999999e-83 < x < 115000Initial program 92.9%
associate-+l+92.9%
+-commutative92.9%
+-commutative92.9%
+-commutative92.9%
Simplified92.9%
flip--92.9%
add-sqr-sqrt80.3%
add-sqr-sqrt92.9%
Applied egg-rr92.9%
associate--l+95.5%
+-inverses95.5%
metadata-eval95.5%
+-commutative95.5%
Simplified95.5%
Taylor expanded in t around inf 50.8%
Taylor expanded in z around inf 24.5%
if 115000 < x Initial program 86.1%
associate-+l+86.1%
+-commutative86.1%
+-commutative86.1%
+-commutative86.1%
Simplified86.1%
flip--86.1%
add-sqr-sqrt70.3%
add-sqr-sqrt86.1%
Applied egg-rr86.1%
associate--l+87.0%
+-inverses87.0%
metadata-eval87.0%
+-commutative87.0%
Simplified87.0%
Taylor expanded in t around inf 45.0%
Taylor expanded in x around inf 48.8%
Final simplification48.6%
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 1e-11)
(+
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 y)) (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 <= 1e-11) {
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - 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 <= 1d-11) then
tmp = (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + ((1.0d0 - sqrt(x)) + (sqrt((1.0d0 + y)) - 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 <= 1e-11) {
tmp = (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + ((1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - 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 <= 1e-11: tmp = (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + ((1.0 - math.sqrt(x)) + (math.sqrt((1.0 + y)) - 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 <= 1e-11) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - 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 <= 1e-11)
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - 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, 1e-11], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $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 10^{-11}:\\
\;\;\;\;\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if x < 9.99999999999999939e-12Initial program 97.4%
associate-+l+97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in x around 0 97.4%
Taylor expanded in t around inf 54.5%
flip--98.3%
add-sqr-sqrt72.2%
add-sqr-sqrt98.5%
Applied egg-rr54.7%
associate--l+98.8%
+-inverses98.8%
metadata-eval98.8%
+-commutative98.8%
Simplified54.7%
if 9.99999999999999939e-12 < x Initial program 86.0%
+-commutative86.0%
associate-+r+86.0%
associate-+r-84.5%
associate-+l-62.2%
associate-+r-47.0%
Simplified46.8%
Taylor expanded in t around inf 7.1%
associate--l+9.0%
+-commutative9.0%
+-commutative9.0%
+-commutative9.0%
associate-+l+9.0%
+-commutative9.0%
Simplified9.0%
Taylor expanded in x around inf 4.7%
mul-1-neg4.7%
Simplified4.7%
pow1/24.7%
pow-to-exp6.0%
log1p-define6.0%
Applied egg-rr6.0%
flip-+6.0%
log1p-undefine6.0%
+-commutative6.0%
pow-to-exp6.1%
pow1/26.1%
log1p-undefine6.1%
+-commutative6.1%
pow-to-exp4.8%
pow1/24.8%
add-sqr-sqrt5.3%
+-commutative5.3%
pow25.3%
Applied egg-rr5.3%
associate--l+8.8%
unpow28.7%
sqr-neg8.7%
rem-square-sqrt11.0%
+-inverses11.0%
metadata-eval11.0%
sub-neg11.0%
remove-double-neg11.0%
+-commutative11.0%
hypot-undefine11.0%
metadata-eval11.0%
rem-square-sqrt11.0%
Simplified11.0%
Final simplification31.3%
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 1e-11)
(+
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 y)) (sqrt y)))
(- (sqrt (+ 1.0 z)) (sqrt z)))
(/ 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 <= 1e-11) {
tmp = ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y))) + (sqrt((1.0 + z)) - sqrt(z));
} 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 <= 1d-11) then
tmp = ((1.0d0 - sqrt(x)) + (sqrt((1.0d0 + y)) - sqrt(y))) + (sqrt((1.0d0 + z)) - sqrt(z))
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 <= 1e-11) {
tmp = ((1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y))) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
} 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 <= 1e-11: tmp = ((1.0 - math.sqrt(x)) + (math.sqrt((1.0 + y)) - math.sqrt(y))) + (math.sqrt((1.0 + z)) - math.sqrt(z)) 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 <= 1e-11) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); 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 <= 1e-11)
tmp = ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y))) + (sqrt((1.0 + z)) - sqrt(z));
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, 1e-11], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $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 10^{-11}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if x < 9.99999999999999939e-12Initial program 97.4%
associate-+l+97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in x around 0 97.4%
Taylor expanded in t around inf 54.5%
if 9.99999999999999939e-12 < x Initial program 86.0%
+-commutative86.0%
associate-+r+86.0%
associate-+r-84.5%
associate-+l-62.2%
associate-+r-47.0%
Simplified46.8%
Taylor expanded in t around inf 7.1%
associate--l+9.0%
+-commutative9.0%
+-commutative9.0%
+-commutative9.0%
associate-+l+9.0%
+-commutative9.0%
Simplified9.0%
Taylor expanded in x around inf 4.7%
mul-1-neg4.7%
Simplified4.7%
pow1/24.7%
pow-to-exp6.0%
log1p-define6.0%
Applied egg-rr6.0%
flip-+6.0%
log1p-undefine6.0%
+-commutative6.0%
pow-to-exp6.1%
pow1/26.1%
log1p-undefine6.1%
+-commutative6.1%
pow-to-exp4.8%
pow1/24.8%
add-sqr-sqrt5.3%
+-commutative5.3%
pow25.3%
Applied egg-rr5.3%
associate--l+8.8%
unpow28.7%
sqr-neg8.7%
rem-square-sqrt11.0%
+-inverses11.0%
metadata-eval11.0%
sub-neg11.0%
remove-double-neg11.0%
+-commutative11.0%
hypot-undefine11.0%
metadata-eval11.0%
rem-square-sqrt11.0%
Simplified11.0%
Final simplification31.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 (+ 1.0 x))))
(if (<= y 0.00092)
(+
(+ (- 1.0 (sqrt x)) (+ 1.0 (- (* y (+ 0.5 (* y -0.125))) (sqrt y))))
(- (sqrt (+ 1.0 z)) (sqrt z)))
(if (<= y 1e+32)
(+ (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))) (- t_1 (sqrt x)))
(/ 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 <= 0.00092) {
tmp = ((1.0 - sqrt(x)) + (1.0 + ((y * (0.5 + (y * -0.125))) - sqrt(y)))) + (sqrt((1.0 + z)) - sqrt(z));
} else if (y <= 1e+32) {
tmp = (1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (t_1 - sqrt(x));
} 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 <= 0.00092d0) then
tmp = ((1.0d0 - sqrt(x)) + (1.0d0 + ((y * (0.5d0 + (y * (-0.125d0)))) - sqrt(y)))) + (sqrt((1.0d0 + z)) - sqrt(z))
else if (y <= 1d+32) then
tmp = (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))) + (t_1 - sqrt(x))
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 <= 0.00092) {
tmp = ((1.0 - Math.sqrt(x)) + (1.0 + ((y * (0.5 + (y * -0.125))) - Math.sqrt(y)))) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
} else if (y <= 1e+32) {
tmp = (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))) + (t_1 - Math.sqrt(x));
} 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 <= 0.00092: tmp = ((1.0 - math.sqrt(x)) + (1.0 + ((y * (0.5 + (y * -0.125))) - math.sqrt(y)))) + (math.sqrt((1.0 + z)) - math.sqrt(z)) elif y <= 1e+32: tmp = (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) + (t_1 - math.sqrt(x)) 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 <= 0.00092) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 + Float64(Float64(y * Float64(0.5 + Float64(y * -0.125))) - sqrt(y)))) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); elseif (y <= 1e+32) tmp = Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) + Float64(t_1 - sqrt(x))); 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 <= 0.00092)
tmp = ((1.0 - sqrt(x)) + (1.0 + ((y * (0.5 + (y * -0.125))) - sqrt(y)))) + (sqrt((1.0 + z)) - sqrt(z));
elseif (y <= 1e+32)
tmp = (1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (t_1 - sqrt(x));
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, 0.00092], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(y * N[(0.5 + N[(y * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+32], N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[x], $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 0.00092:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(1 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right)\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\mathbf{elif}\;y \leq 10^{+32}:\\
\;\;\;\;\frac{1}{\sqrt{y} + \sqrt{1 + y}} + \left(t\_1 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 9.2000000000000003e-4Initial program 97.7%
associate-+l+97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 52.5%
Taylor expanded in t around inf 30.3%
Taylor expanded in y around 0 30.3%
associate--l+30.3%
Simplified30.3%
if 9.2000000000000003e-4 < y < 1.00000000000000005e32Initial program 82.4%
associate-+l+82.4%
+-commutative82.4%
+-commutative82.4%
+-commutative82.4%
Simplified82.4%
flip--82.5%
add-sqr-sqrt78.6%
add-sqr-sqrt82.6%
Applied egg-rr82.6%
associate--l+95.0%
+-inverses95.0%
metadata-eval95.0%
+-commutative95.0%
Simplified95.0%
Taylor expanded in t around inf 40.0%
Taylor expanded in z around inf 20.9%
+-commutative20.9%
associate--l+32.6%
+-commutative32.6%
Simplified32.6%
if 1.00000000000000005e32 < y Initial program 85.6%
+-commutative85.6%
associate-+r+85.6%
associate-+r-51.0%
associate-+l-23.8%
associate-+r-3.3%
Simplified4.0%
Taylor expanded in t around inf 3.2%
associate--l+18.7%
+-commutative18.7%
+-commutative18.7%
+-commutative18.7%
associate-+l+18.7%
+-commutative18.7%
Simplified18.7%
Taylor expanded in x around inf 18.0%
mul-1-neg18.0%
Simplified18.0%
pow1/218.0%
pow-to-exp18.7%
log1p-define18.7%
Applied egg-rr18.7%
flip-+18.7%
log1p-undefine18.7%
+-commutative18.7%
pow-to-exp18.7%
pow1/218.7%
log1p-undefine18.7%
+-commutative18.7%
pow-to-exp18.2%
pow1/218.2%
add-sqr-sqrt18.4%
+-commutative18.4%
pow218.4%
Applied egg-rr18.5%
associate--l+21.3%
unpow221.3%
sqr-neg21.3%
rem-square-sqrt23.5%
+-inverses23.5%
metadata-eval23.5%
sub-neg23.5%
remove-double-neg23.5%
+-commutative23.5%
hypot-undefine23.5%
metadata-eval23.5%
rem-square-sqrt23.5%
Simplified23.5%
Final simplification27.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 (+ 1.0 x))))
(if (<= y 8e-23)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (- 2.0 (sqrt x)) (sqrt y)))
(if (<= y 5e+32)
(+ (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))) (- t_1 (sqrt x)))
(/ 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 <= 8e-23) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((2.0 - sqrt(x)) - sqrt(y));
} else if (y <= 5e+32) {
tmp = (1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (t_1 - sqrt(x));
} 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 <= 8d-23) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((2.0d0 - sqrt(x)) - sqrt(y))
else if (y <= 5d+32) then
tmp = (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))) + (t_1 - sqrt(x))
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 <= 8e-23) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((2.0 - Math.sqrt(x)) - Math.sqrt(y));
} else if (y <= 5e+32) {
tmp = (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))) + (t_1 - Math.sqrt(x));
} 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 <= 8e-23: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((2.0 - math.sqrt(x)) - math.sqrt(y)) elif y <= 5e+32: tmp = (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) + (t_1 - math.sqrt(x)) 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 <= 8e-23) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(2.0 - sqrt(x)) - sqrt(y))); elseif (y <= 5e+32) tmp = Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) + Float64(t_1 - sqrt(x))); 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 <= 8e-23)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((2.0 - sqrt(x)) - sqrt(y));
elseif (y <= 5e+32)
tmp = (1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (t_1 - sqrt(x));
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, 8e-23], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+32], N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[x], $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 8 \cdot 10^{-23}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(2 - \sqrt{x}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+32}:\\
\;\;\;\;\frac{1}{\sqrt{y} + \sqrt{1 + y}} + \left(t\_1 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 7.99999999999999968e-23Initial program 97.7%
associate-+l+97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 52.6%
Taylor expanded in t around inf 30.0%
Taylor expanded in y around 0 30.0%
associate--r+30.0%
Simplified30.0%
if 7.99999999999999968e-23 < y < 4.9999999999999997e32Initial program 88.6%
associate-+l+88.6%
+-commutative88.6%
+-commutative88.6%
+-commutative88.6%
Simplified88.6%
flip--88.6%
add-sqr-sqrt86.2%
add-sqr-sqrt88.8%
Applied egg-rr88.8%
associate--l+96.6%
+-inverses96.6%
metadata-eval96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in t around inf 45.2%
Taylor expanded in z around inf 21.2%
+-commutative21.2%
associate--l+31.4%
+-commutative31.4%
Simplified31.4%
if 4.9999999999999997e32 < y Initial program 85.5%
+-commutative85.5%
associate-+r+85.5%
associate-+r-50.6%
associate-+l-23.8%
associate-+r-3.2%
Simplified3.2%
Taylor expanded in t around inf 3.2%
associate--l+18.8%
+-commutative18.8%
+-commutative18.8%
+-commutative18.8%
associate-+l+18.8%
+-commutative18.8%
Simplified18.8%
Taylor expanded in x around inf 18.2%
mul-1-neg18.2%
Simplified18.2%
pow1/218.2%
pow-to-exp18.8%
log1p-define18.8%
Applied egg-rr18.8%
flip-+18.8%
log1p-undefine18.8%
+-commutative18.8%
pow-to-exp18.9%
pow1/218.9%
log1p-undefine18.9%
+-commutative18.9%
pow-to-exp18.3%
pow1/218.3%
add-sqr-sqrt18.6%
+-commutative18.6%
pow218.6%
Applied egg-rr18.6%
associate--l+21.5%
unpow221.5%
sqr-neg21.5%
rem-square-sqrt23.6%
+-inverses23.6%
metadata-eval23.6%
sub-neg23.6%
remove-double-neg23.6%
+-commutative23.6%
hypot-undefine23.6%
metadata-eval23.6%
rem-square-sqrt23.6%
Simplified23.6%
Final simplification27.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 (+ 1.0 x))))
(if (<= y 1.05e-13)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (- 2.0 (sqrt x)) (sqrt y)))
(if (<= y 3.3e+15)
(+ t_1 (- (sqrt (+ 1.0 y)) (+ (sqrt x) (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 <= 1.05e-13) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((2.0 - sqrt(x)) - sqrt(y));
} else if (y <= 3.3e+15) {
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + 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 <= 1.05d-13) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((2.0d0 - sqrt(x)) - sqrt(y))
else if (y <= 3.3d+15) then
tmp = t_1 + (sqrt((1.0d0 + y)) - (sqrt(x) + 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 <= 1.05e-13) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((2.0 - Math.sqrt(x)) - Math.sqrt(y));
} else if (y <= 3.3e+15) {
tmp = t_1 + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + 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 <= 1.05e-13: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((2.0 - math.sqrt(x)) - math.sqrt(y)) elif y <= 3.3e+15: tmp = t_1 + (math.sqrt((1.0 + y)) - (math.sqrt(x) + 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 <= 1.05e-13) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(2.0 - sqrt(x)) - sqrt(y))); elseif (y <= 3.3e+15) tmp = Float64(t_1 + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + 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 <= 1.05e-13)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((2.0 - sqrt(x)) - sqrt(y));
elseif (y <= 3.3e+15)
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + 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, 1.05e-13], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.3e+15], N[(t$95$1 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $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 1.05 \cdot 10^{-13}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(2 - \sqrt{x}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+15}:\\
\;\;\;\;t\_1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 1.04999999999999994e-13Initial program 97.7%
associate-+l+97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 53.4%
Taylor expanded in t around inf 31.1%
Taylor expanded in y around 0 31.1%
associate--r+31.1%
Simplified31.1%
if 1.04999999999999994e-13 < y < 3.3e15Initial program 96.6%
+-commutative96.6%
associate-+r+96.5%
associate-+r-96.6%
associate-+l-96.6%
associate-+r-96.6%
Simplified71.6%
Taylor expanded in t around inf 3.1%
associate--l+11.6%
+-commutative11.6%
+-commutative11.6%
+-commutative11.6%
associate-+l+11.6%
+-commutative11.6%
Simplified11.6%
Taylor expanded in z around inf 14.9%
if 3.3e15 < y Initial program 84.9%
+-commutative84.9%
associate-+r+84.9%
associate-+r-51.9%
associate-+l-26.1%
associate-+r-6.5%
Simplified6.2%
Taylor expanded in t around inf 3.7%
associate--l+18.7%
+-commutative18.7%
+-commutative18.7%
+-commutative18.7%
associate-+l+18.7%
+-commutative18.7%
Simplified18.7%
Taylor expanded in x around inf 18.2%
mul-1-neg18.2%
Simplified18.2%
pow1/218.2%
pow-to-exp18.8%
log1p-define18.8%
Applied egg-rr18.8%
flip-+18.8%
log1p-undefine18.8%
+-commutative18.8%
pow-to-exp18.8%
pow1/218.8%
log1p-undefine18.8%
+-commutative18.8%
pow-to-exp18.3%
pow1/218.3%
add-sqr-sqrt18.6%
+-commutative18.6%
pow218.6%
Applied egg-rr18.6%
associate--l+21.4%
unpow221.4%
sqr-neg21.4%
rem-square-sqrt23.4%
+-inverses23.4%
metadata-eval23.4%
sub-neg23.4%
remove-double-neg23.4%
+-commutative23.4%
hypot-undefine23.4%
metadata-eval23.4%
rem-square-sqrt23.4%
Simplified23.4%
Final simplification26.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 (+ 1.0 x))))
(if (<= y 3.3e+15)
(+ t_1 (- (sqrt (+ 1.0 y)) (+ (sqrt x) (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 <= 3.3e+15) {
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + 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 <= 3.3d+15) then
tmp = t_1 + (sqrt((1.0d0 + y)) - (sqrt(x) + 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 <= 3.3e+15) {
tmp = t_1 + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + 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 <= 3.3e+15: tmp = t_1 + (math.sqrt((1.0 + y)) - (math.sqrt(x) + 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 <= 3.3e+15) tmp = Float64(t_1 + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + 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 <= 3.3e+15)
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + 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, 3.3e+15], N[(t$95$1 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $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 3.3 \cdot 10^{+15}:\\
\;\;\;\;t\_1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 3.3e15Initial program 97.6%
+-commutative97.6%
associate-+r+97.6%
associate-+r-97.6%
associate-+l-97.6%
associate-+r-97.6%
Simplified78.6%
Taylor expanded in t around inf 23.5%
associate--l+27.7%
+-commutative27.7%
+-commutative27.7%
+-commutative27.7%
associate-+l+27.7%
+-commutative27.7%
Simplified27.7%
Taylor expanded in z around inf 22.6%
if 3.3e15 < y Initial program 84.9%
+-commutative84.9%
associate-+r+84.9%
associate-+r-51.9%
associate-+l-26.1%
associate-+r-6.5%
Simplified6.2%
Taylor expanded in t around inf 3.7%
associate--l+18.7%
+-commutative18.7%
+-commutative18.7%
+-commutative18.7%
associate-+l+18.7%
+-commutative18.7%
Simplified18.7%
Taylor expanded in x around inf 18.2%
mul-1-neg18.2%
Simplified18.2%
pow1/218.2%
pow-to-exp18.8%
log1p-define18.8%
Applied egg-rr18.8%
flip-+18.8%
log1p-undefine18.8%
+-commutative18.8%
pow-to-exp18.8%
pow1/218.8%
log1p-undefine18.8%
+-commutative18.8%
pow-to-exp18.3%
pow1/218.3%
add-sqr-sqrt18.6%
+-commutative18.6%
pow218.6%
Applied egg-rr18.6%
associate--l+21.4%
unpow221.4%
sqr-neg21.4%
rem-square-sqrt23.4%
+-inverses23.4%
metadata-eval23.4%
sub-neg23.4%
remove-double-neg23.4%
+-commutative23.4%
hypot-undefine23.4%
metadata-eval23.4%
rem-square-sqrt23.4%
Simplified23.4%
Final simplification23.0%
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 60000000.0) (- (sqrt (+ 1.0 x)) (sqrt x)) (* 0.5 (pow x -0.5))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 60000000.0) {
tmp = sqrt((1.0 + x)) - sqrt(x);
} else {
tmp = 0.5 * pow(x, -0.5);
}
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 <= 60000000.0d0) then
tmp = sqrt((1.0d0 + x)) - sqrt(x)
else
tmp = 0.5d0 * (x ** (-0.5d0))
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 <= 60000000.0) {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.pow(x, -0.5);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 60000000.0: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) else: tmp = 0.5 * math.pow(x, -0.5) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 60000000.0) tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); else tmp = Float64(0.5 * (x ^ -0.5)); 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 <= 60000000.0)
tmp = sqrt((1.0 + x)) - sqrt(x);
else
tmp = 0.5 * (x ^ -0.5);
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, 60000000.0], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 60000000:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot {x}^{-0.5}\\
\end{array}
\end{array}
if x < 6e7Initial program 96.9%
+-commutative96.9%
associate-+r+96.9%
associate-+r-63.5%
associate-+l-61.5%
associate-+r-58.1%
Simplified37.4%
Taylor expanded in t around inf 21.2%
associate--l+39.2%
+-commutative39.2%
+-commutative39.2%
+-commutative39.2%
associate-+l+39.2%
+-commutative39.2%
Simplified39.2%
Taylor expanded in x around inf 26.7%
mul-1-neg26.7%
Simplified26.7%
unsub-neg26.7%
Applied egg-rr26.7%
if 6e7 < x Initial program 86.1%
+-commutative86.1%
associate-+r+86.0%
associate-+r-85.7%
associate-+l-62.7%
associate-+r-47.0%
Simplified47.6%
Taylor expanded in t around inf 6.5%
associate--l+8.2%
+-commutative8.2%
+-commutative8.2%
+-commutative8.2%
associate-+l+8.2%
+-commutative8.2%
Simplified8.2%
Taylor expanded in x around inf 3.4%
mul-1-neg3.4%
Simplified3.4%
Taylor expanded in x around inf 9.9%
rem-exp-log9.7%
exp-neg9.7%
unpow1/29.7%
exp-prod9.7%
distribute-lft-neg-out9.7%
distribute-rgt-neg-in9.7%
metadata-eval9.7%
exp-to-pow9.9%
Simplified9.9%
Final simplification18.0%
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 (+ 1.0 x)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 / (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 = 1.0d0 / (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 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 / (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(1.0 / 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 = 1.0 / (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[(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])\\
\\
\frac{1}{\sqrt{1 + x} + \sqrt{x}}
\end{array}
Initial program 91.3%
+-commutative91.3%
associate-+r+91.3%
associate-+r-74.9%
associate-+l-62.1%
associate-+r-52.4%
Simplified42.7%
Taylor expanded in t around inf 13.7%
associate--l+23.2%
+-commutative23.2%
+-commutative23.2%
+-commutative23.2%
associate-+l+23.2%
+-commutative23.2%
Simplified23.2%
Taylor expanded in x around inf 14.7%
mul-1-neg14.7%
Simplified14.7%
pow1/214.7%
pow-to-exp15.4%
log1p-define15.4%
Applied egg-rr15.4%
flip-+15.4%
log1p-undefine15.4%
+-commutative15.4%
pow-to-exp15.5%
pow1/215.5%
log1p-undefine15.5%
+-commutative15.5%
pow-to-exp14.8%
pow1/214.8%
add-sqr-sqrt15.0%
+-commutative15.0%
pow215.0%
Applied egg-rr15.0%
associate--l+16.9%
unpow216.9%
sqr-neg16.9%
rem-square-sqrt18.1%
+-inverses18.1%
metadata-eval18.1%
sub-neg18.1%
remove-double-neg18.1%
+-commutative18.1%
hypot-undefine18.1%
metadata-eval18.1%
rem-square-sqrt18.1%
Simplified18.1%
Final simplification18.1%
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 1.3) (- (+ 1.0 (* x (+ 0.5 (* x (- (* x 0.0625) 0.125))))) (sqrt x)) (* 0.5 (pow x -0.5))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.3) {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
} else {
tmp = 0.5 * pow(x, -0.5);
}
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 <= 1.3d0) then
tmp = (1.0d0 + (x * (0.5d0 + (x * ((x * 0.0625d0) - 0.125d0))))) - sqrt(x)
else
tmp = 0.5d0 * (x ** (-0.5d0))
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 <= 1.3) {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.pow(x, -0.5);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 1.3: tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - math.sqrt(x) else: tmp = 0.5 * math.pow(x, -0.5) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 1.3) tmp = Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.0625) - 0.125))))) - sqrt(x)); else tmp = Float64(0.5 * (x ^ -0.5)); 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 <= 1.3)
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
else
tmp = 0.5 * (x ^ -0.5);
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, 1.3], N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.0625), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.3:\\
\;\;\;\;\left(1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.0625 - 0.125\right)\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot {x}^{-0.5}\\
\end{array}
\end{array}
if x < 1.30000000000000004Initial program 97.4%
+-commutative97.4%
associate-+r+97.4%
associate-+r-64.3%
associate-+l-62.3%
associate-+r-58.9%
Simplified37.7%
Taylor expanded in t around inf 21.0%
associate--l+39.4%
+-commutative39.4%
+-commutative39.4%
+-commutative39.4%
associate-+l+39.4%
+-commutative39.4%
Simplified39.4%
Taylor expanded in x around inf 26.2%
mul-1-neg26.2%
Simplified26.2%
Taylor expanded in x around 0 26.2%
if 1.30000000000000004 < x Initial program 85.9%
+-commutative85.9%
associate-+r+85.9%
associate-+r-84.3%
associate-+l-61.9%
associate-+r-46.6%
Simplified47.0%
Taylor expanded in t around inf 7.2%
associate--l+9.0%
+-commutative9.0%
+-commutative9.0%
+-commutative9.0%
associate-+l+9.0%
+-commutative9.0%
Simplified9.0%
Taylor expanded in x around inf 4.6%
mul-1-neg4.6%
Simplified4.6%
Taylor expanded in x around inf 10.4%
rem-exp-log10.2%
exp-neg10.2%
unpow1/210.2%
exp-prod10.2%
distribute-lft-neg-out10.2%
distribute-rgt-neg-in10.2%
metadata-eval10.2%
exp-to-pow10.4%
Simplified10.4%
Final simplification17.8%
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 0.99) (- (+ 1.0 (* x (+ 0.5 (* x -0.125)))) (sqrt x)) (* 0.5 (pow x -0.5))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.99) {
tmp = (1.0 + (x * (0.5 + (x * -0.125)))) - sqrt(x);
} else {
tmp = 0.5 * pow(x, -0.5);
}
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 <= 0.99d0) then
tmp = (1.0d0 + (x * (0.5d0 + (x * (-0.125d0))))) - sqrt(x)
else
tmp = 0.5d0 * (x ** (-0.5d0))
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 <= 0.99) {
tmp = (1.0 + (x * (0.5 + (x * -0.125)))) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.pow(x, -0.5);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 0.99: tmp = (1.0 + (x * (0.5 + (x * -0.125)))) - math.sqrt(x) else: tmp = 0.5 * math.pow(x, -0.5) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 0.99) tmp = Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * -0.125)))) - sqrt(x)); else tmp = Float64(0.5 * (x ^ -0.5)); 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 <= 0.99)
tmp = (1.0 + (x * (0.5 + (x * -0.125)))) - sqrt(x);
else
tmp = 0.5 * (x ^ -0.5);
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, 0.99], N[(N[(1.0 + N[(x * N[(0.5 + N[(x * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.99:\\
\;\;\;\;\left(1 + x \cdot \left(0.5 + x \cdot -0.125\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot {x}^{-0.5}\\
\end{array}
\end{array}
if x < 0.98999999999999999Initial program 97.4%
+-commutative97.4%
associate-+r+97.4%
associate-+r-64.3%
associate-+l-62.3%
associate-+r-58.9%
Simplified37.7%
Taylor expanded in t around inf 21.0%
associate--l+39.4%
+-commutative39.4%
+-commutative39.4%
+-commutative39.4%
associate-+l+39.4%
+-commutative39.4%
Simplified39.4%
Taylor expanded in x around inf 26.2%
mul-1-neg26.2%
Simplified26.2%
Taylor expanded in x around 0 26.2%
if 0.98999999999999999 < x Initial program 85.9%
+-commutative85.9%
associate-+r+85.9%
associate-+r-84.3%
associate-+l-61.9%
associate-+r-46.6%
Simplified47.0%
Taylor expanded in t around inf 7.2%
associate--l+9.0%
+-commutative9.0%
+-commutative9.0%
+-commutative9.0%
associate-+l+9.0%
+-commutative9.0%
Simplified9.0%
Taylor expanded in x around inf 4.6%
mul-1-neg4.6%
Simplified4.6%
Taylor expanded in x around inf 10.4%
rem-exp-log10.2%
exp-neg10.2%
unpow1/210.2%
exp-prod10.2%
distribute-lft-neg-out10.2%
distribute-rgt-neg-in10.2%
metadata-eval10.2%
exp-to-pow10.4%
Simplified10.4%
Final simplification17.8%
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 1.0) (+ 1.0 (- (* x 0.5) (sqrt x))) (* 0.5 (pow x -0.5))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.0) {
tmp = 1.0 + ((x * 0.5) - sqrt(x));
} else {
tmp = 0.5 * pow(x, -0.5);
}
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 <= 1.0d0) then
tmp = 1.0d0 + ((x * 0.5d0) - sqrt(x))
else
tmp = 0.5d0 * (x ** (-0.5d0))
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 <= 1.0) {
tmp = 1.0 + ((x * 0.5) - Math.sqrt(x));
} else {
tmp = 0.5 * Math.pow(x, -0.5);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 1.0: tmp = 1.0 + ((x * 0.5) - math.sqrt(x)) else: tmp = 0.5 * math.pow(x, -0.5) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 1.0) tmp = Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))); else tmp = Float64(0.5 * (x ^ -0.5)); 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 <= 1.0)
tmp = 1.0 + ((x * 0.5) - sqrt(x));
else
tmp = 0.5 * (x ^ -0.5);
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, 1.0], N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;1 + \left(x \cdot 0.5 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot {x}^{-0.5}\\
\end{array}
\end{array}
if x < 1Initial program 97.4%
+-commutative97.4%
associate-+r+97.4%
associate-+r-64.3%
associate-+l-62.3%
associate-+r-58.9%
Simplified37.7%
Taylor expanded in t around inf 21.0%
associate--l+39.4%
+-commutative39.4%
+-commutative39.4%
+-commutative39.4%
associate-+l+39.4%
+-commutative39.4%
Simplified39.4%
Taylor expanded in x around inf 26.2%
mul-1-neg26.2%
Simplified26.2%
Taylor expanded in x around 0 26.2%
associate--l+26.2%
Simplified26.2%
if 1 < x Initial program 85.9%
+-commutative85.9%
associate-+r+85.9%
associate-+r-84.3%
associate-+l-61.9%
associate-+r-46.6%
Simplified47.0%
Taylor expanded in t around inf 7.2%
associate--l+9.0%
+-commutative9.0%
+-commutative9.0%
+-commutative9.0%
associate-+l+9.0%
+-commutative9.0%
Simplified9.0%
Taylor expanded in x around inf 4.6%
mul-1-neg4.6%
Simplified4.6%
Taylor expanded in x around inf 10.4%
rem-exp-log10.2%
exp-neg10.2%
unpow1/210.2%
exp-prod10.2%
distribute-lft-neg-out10.2%
distribute-rgt-neg-in10.2%
metadata-eval10.2%
exp-to-pow10.4%
Simplified10.4%
Final simplification17.8%
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 0.26) (- 1.0 (sqrt x)) (* 0.5 (pow x -0.5))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.26) {
tmp = 1.0 - sqrt(x);
} else {
tmp = 0.5 * pow(x, -0.5);
}
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 <= 0.26d0) then
tmp = 1.0d0 - sqrt(x)
else
tmp = 0.5d0 * (x ** (-0.5d0))
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 <= 0.26) {
tmp = 1.0 - Math.sqrt(x);
} else {
tmp = 0.5 * Math.pow(x, -0.5);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 0.26: tmp = 1.0 - math.sqrt(x) else: tmp = 0.5 * math.pow(x, -0.5) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 0.26) tmp = Float64(1.0 - sqrt(x)); else tmp = Float64(0.5 * (x ^ -0.5)); 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 <= 0.26)
tmp = 1.0 - sqrt(x);
else
tmp = 0.5 * (x ^ -0.5);
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, 0.26], N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.26:\\
\;\;\;\;1 - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot {x}^{-0.5}\\
\end{array}
\end{array}
if x < 0.26000000000000001Initial program 97.4%
+-commutative97.4%
associate-+r+97.4%
associate-+r-64.3%
associate-+l-62.3%
associate-+r-58.9%
Simplified37.7%
Taylor expanded in t around inf 21.0%
associate--l+39.4%
+-commutative39.4%
+-commutative39.4%
+-commutative39.4%
associate-+l+39.4%
+-commutative39.4%
Simplified39.4%
Taylor expanded in x around inf 26.2%
mul-1-neg26.2%
Simplified26.2%
Taylor expanded in x around 0 26.2%
if 0.26000000000000001 < x Initial program 85.9%
+-commutative85.9%
associate-+r+85.9%
associate-+r-84.3%
associate-+l-61.9%
associate-+r-46.6%
Simplified47.0%
Taylor expanded in t around inf 7.2%
associate--l+9.0%
+-commutative9.0%
+-commutative9.0%
+-commutative9.0%
associate-+l+9.0%
+-commutative9.0%
Simplified9.0%
Taylor expanded in x around inf 4.6%
mul-1-neg4.6%
Simplified4.6%
Taylor expanded in x around inf 10.4%
rem-exp-log10.2%
exp-neg10.2%
unpow1/210.2%
exp-prod10.2%
distribute-lft-neg-out10.2%
distribute-rgt-neg-in10.2%
metadata-eval10.2%
exp-to-pow10.4%
Simplified10.4%
Final simplification17.8%
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 x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 - 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 - 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 - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 - 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[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 - \sqrt{x}
\end{array}
Initial program 91.3%
+-commutative91.3%
associate-+r+91.3%
associate-+r-74.9%
associate-+l-62.1%
associate-+r-52.4%
Simplified42.7%
Taylor expanded in t around inf 13.7%
associate--l+23.2%
+-commutative23.2%
+-commutative23.2%
+-commutative23.2%
associate-+l+23.2%
+-commutative23.2%
Simplified23.2%
Taylor expanded in x around inf 14.7%
mul-1-neg14.7%
Simplified14.7%
Taylor expanded in x around 0 13.0%
Final simplification13.0%
(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 2024076
(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))))