
(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 31 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 (+ (sqrt y) (sqrt (+ 1.0 y))))
(t_2 (sqrt (+ 1.0 t)))
(t_3 (sqrt (+ 1.0 x)))
(t_4 (+ t_3 (sqrt x))))
(if (<= z 38000000.0)
(-
(+ 1.0 (+ (+ t_3 (sqrt (+ z 1.0))) (/ 1.0 (+ t_2 (sqrt t)))))
(+ (sqrt x) (+ (sqrt y) (sqrt z))))
(+
(/ (/ (+ t_1 t_4) t_4) t_1)
(+ (* 0.5 (sqrt (/ 1.0 z))) (- t_2 (sqrt t)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(y) + sqrt((1.0 + y));
double t_2 = sqrt((1.0 + t));
double t_3 = sqrt((1.0 + x));
double t_4 = t_3 + sqrt(x);
double tmp;
if (z <= 38000000.0) {
tmp = (1.0 + ((t_3 + sqrt((z + 1.0))) + (1.0 / (t_2 + sqrt(t))))) - (sqrt(x) + (sqrt(y) + sqrt(z)));
} else {
tmp = (((t_1 + t_4) / t_4) / t_1) + ((0.5 * sqrt((1.0 / z))) + (t_2 - sqrt(t)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt(y) + sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + t))
t_3 = sqrt((1.0d0 + x))
t_4 = t_3 + sqrt(x)
if (z <= 38000000.0d0) then
tmp = (1.0d0 + ((t_3 + sqrt((z + 1.0d0))) + (1.0d0 / (t_2 + sqrt(t))))) - (sqrt(x) + (sqrt(y) + sqrt(z)))
else
tmp = (((t_1 + t_4) / t_4) / t_1) + ((0.5d0 * sqrt((1.0d0 / z))) + (t_2 - sqrt(t)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt(y) + Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + t));
double t_3 = Math.sqrt((1.0 + x));
double t_4 = t_3 + Math.sqrt(x);
double tmp;
if (z <= 38000000.0) {
tmp = (1.0 + ((t_3 + Math.sqrt((z + 1.0))) + (1.0 / (t_2 + Math.sqrt(t))))) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)));
} else {
tmp = (((t_1 + t_4) / t_4) / t_1) + ((0.5 * Math.sqrt((1.0 / z))) + (t_2 - Math.sqrt(t)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(y) + math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + t)) t_3 = math.sqrt((1.0 + x)) t_4 = t_3 + math.sqrt(x) tmp = 0 if z <= 38000000.0: tmp = (1.0 + ((t_3 + math.sqrt((z + 1.0))) + (1.0 / (t_2 + math.sqrt(t))))) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))) else: tmp = (((t_1 + t_4) / t_4) / t_1) + ((0.5 * math.sqrt((1.0 / z))) + (t_2 - math.sqrt(t))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(y) + sqrt(Float64(1.0 + y))) t_2 = sqrt(Float64(1.0 + t)) t_3 = sqrt(Float64(1.0 + x)) t_4 = Float64(t_3 + sqrt(x)) tmp = 0.0 if (z <= 38000000.0) tmp = Float64(Float64(1.0 + Float64(Float64(t_3 + sqrt(Float64(z + 1.0))) + Float64(1.0 / Float64(t_2 + sqrt(t))))) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))); else tmp = Float64(Float64(Float64(Float64(t_1 + t_4) / t_4) / t_1) + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(t_2 - sqrt(t)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt(y) + sqrt((1.0 + y));
t_2 = sqrt((1.0 + t));
t_3 = sqrt((1.0 + x));
t_4 = t_3 + sqrt(x);
tmp = 0.0;
if (z <= 38000000.0)
tmp = (1.0 + ((t_3 + sqrt((z + 1.0))) + (1.0 / (t_2 + sqrt(t))))) - (sqrt(x) + (sqrt(y) + sqrt(z)));
else
tmp = (((t_1 + t_4) / t_4) / t_1) + ((0.5 * sqrt((1.0 / z))) + (t_2 - 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[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 38000000.0], N[(N[(1.0 + N[(N[(t$95$3 + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t$95$1 + t$95$4), $MachinePrecision] / t$95$4), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - 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{y} + \sqrt{1 + y}\\
t_2 := \sqrt{1 + t}\\
t_3 := \sqrt{1 + x}\\
t_4 := t\_3 + \sqrt{x}\\
\mathbf{if}\;z \leq 38000000:\\
\;\;\;\;\left(1 + \left(\left(t\_3 + \sqrt{z + 1}\right) + \frac{1}{t\_2 + \sqrt{t}}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t\_1 + t\_4}{t\_4}}{t\_1} + \left(0.5 \cdot \sqrt{\frac{1}{z}} + \left(t\_2 - \sqrt{t}\right)\right)\\
\end{array}
\end{array}
if z < 3.8e7Initial program 96.8%
associate-+l+96.8%
sub-neg96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
flip--96.7%
add-sqr-sqrt76.6%
add-sqr-sqrt97.0%
Applied egg-rr97.0%
Taylor expanded in y around 0 26.3%
associate-+r+26.3%
+-commutative26.3%
Simplified26.3%
if 3.8e7 < z Initial program 85.4%
associate-+l+85.4%
sub-neg85.4%
sub-neg85.4%
+-commutative85.4%
+-commutative85.4%
+-commutative85.4%
Simplified85.4%
+-commutative85.4%
flip--86.1%
flip--86.6%
frac-add86.7%
Applied egg-rr87.3%
*-commutative87.3%
*-commutative87.3%
+-commutative87.3%
*-commutative87.3%
associate-/r*87.3%
Simplified94.5%
Taylor expanded in z around inf 97.3%
Final simplification61.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 (+ z 1.0)))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (sqrt (+ 1.0 y)))
(t_4 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= (+ (+ (- t_2 (sqrt x)) (- t_3 (sqrt y))) (- t_1 (sqrt z))) 1.00002)
(+
(+ (* 0.5 (sqrt (/ 1.0 z))) t_4)
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ t_2 (sqrt x)))))
(+
(- (+ 1.0 t_3) (+ (sqrt x) (sqrt y)))
(+ t_4 (/ 1.0 (+ t_1 (sqrt z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0));
double t_2 = sqrt((1.0 + x));
double t_3 = sqrt((1.0 + y));
double t_4 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if ((((t_2 - sqrt(x)) + (t_3 - sqrt(y))) + (t_1 - sqrt(z))) <= 1.00002) {
tmp = ((0.5 * sqrt((1.0 / z))) + t_4) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (t_2 + sqrt(x))));
} else {
tmp = ((1.0 + t_3) - (sqrt(x) + sqrt(y))) + (t_4 + (1.0 / (t_1 + 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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((z + 1.0d0))
t_2 = sqrt((1.0d0 + x))
t_3 = sqrt((1.0d0 + y))
t_4 = sqrt((1.0d0 + t)) - sqrt(t)
if ((((t_2 - sqrt(x)) + (t_3 - sqrt(y))) + (t_1 - sqrt(z))) <= 1.00002d0) then
tmp = ((0.5d0 * sqrt((1.0d0 / z))) + t_4) + ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (t_2 + sqrt(x))))
else
tmp = ((1.0d0 + t_3) - (sqrt(x) + sqrt(y))) + (t_4 + (1.0d0 / (t_1 + 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((z + 1.0));
double t_2 = Math.sqrt((1.0 + x));
double t_3 = Math.sqrt((1.0 + y));
double t_4 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if ((((t_2 - Math.sqrt(x)) + (t_3 - Math.sqrt(y))) + (t_1 - Math.sqrt(z))) <= 1.00002) {
tmp = ((0.5 * Math.sqrt((1.0 / z))) + t_4) + ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (t_2 + Math.sqrt(x))));
} else {
tmp = ((1.0 + t_3) - (Math.sqrt(x) + Math.sqrt(y))) + (t_4 + (1.0 / (t_1 + Math.sqrt(z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) t_2 = math.sqrt((1.0 + x)) t_3 = math.sqrt((1.0 + y)) t_4 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if (((t_2 - math.sqrt(x)) + (t_3 - math.sqrt(y))) + (t_1 - math.sqrt(z))) <= 1.00002: tmp = ((0.5 * math.sqrt((1.0 / z))) + t_4) + ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (t_2 + math.sqrt(x)))) else: tmp = ((1.0 + t_3) - (math.sqrt(x) + math.sqrt(y))) + (t_4 + (1.0 / (t_1 + math.sqrt(z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(z + 1.0)) t_2 = sqrt(Float64(1.0 + x)) t_3 = sqrt(Float64(1.0 + y)) t_4 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (Float64(Float64(Float64(t_2 - sqrt(x)) + Float64(t_3 - sqrt(y))) + Float64(t_1 - sqrt(z))) <= 1.00002) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + t_4) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(t_2 + sqrt(x))))); else tmp = Float64(Float64(Float64(1.0 + t_3) - Float64(sqrt(x) + sqrt(y))) + Float64(t_4 + Float64(1.0 / Float64(t_1 + 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((z + 1.0));
t_2 = sqrt((1.0 + x));
t_3 = sqrt((1.0 + y));
t_4 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if ((((t_2 - sqrt(x)) + (t_3 - sqrt(y))) + (t_1 - sqrt(z))) <= 1.00002)
tmp = ((0.5 * sqrt((1.0 / z))) + t_4) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (t_2 + sqrt(x))));
else
tmp = ((1.0 + t_3) - (sqrt(x) + sqrt(y))) + (t_4 + (1.0 / (t_1 + 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[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.00002], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + t$95$3), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 + N[(1.0 / N[(t$95$1 + N[Sqrt[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{z + 1}\\
t_2 := \sqrt{1 + x}\\
t_3 := \sqrt{1 + y}\\
t_4 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;\left(\left(t\_2 - \sqrt{x}\right) + \left(t\_3 - \sqrt{y}\right)\right) + \left(t\_1 - \sqrt{z}\right) \leq 1.00002:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{z}} + t\_4\right) + \left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{t\_2 + \sqrt{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + t\_3\right) - \left(\sqrt{x} + \sqrt{y}\right)\right) + \left(t\_4 + \frac{1}{t\_1 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if (+.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))) < 1.00001999999999991Initial program 84.3%
associate-+l+84.3%
sub-neg84.3%
sub-neg84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
Simplified84.3%
+-commutative84.3%
flip--85.2%
flip--85.9%
frac-add85.9%
Applied egg-rr86.8%
*-commutative86.8%
*-commutative86.8%
+-commutative86.8%
*-commutative86.8%
associate-/r*86.8%
Simplified94.2%
Taylor expanded in y around inf 76.8%
Taylor expanded in z around inf 56.7%
if 1.00001999999999991 < (+.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))) Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
sub-neg97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in x around 0 52.3%
flip--52.3%
div-inv52.3%
add-sqr-sqrt42.6%
add-sqr-sqrt52.3%
Applied egg-rr52.3%
associate-*r/52.3%
*-rgt-identity52.3%
associate--l+52.4%
+-inverses52.4%
metadata-eval52.4%
+-commutative52.4%
Simplified52.4%
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 (sqrt (+ 1.0 x))) (t_2 (- t_1 (sqrt x))))
(if (<= t_2 0.99999)
(+
(+ (* 0.5 (sqrt (/ 1.0 z))) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ t_1 (sqrt x)))))
(+
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))
(+ t_2 (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = t_1 - sqrt(x);
double tmp;
if (t_2 <= 0.99999) {
tmp = ((0.5 * sqrt((1.0 / z))) + (sqrt((1.0 + t)) - sqrt(t))) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (t_1 + sqrt(x))));
} else {
tmp = (1.0 / (sqrt((z + 1.0)) + sqrt(z))) + (t_2 + (1.0 / (sqrt(y) + sqrt((1.0 + y)))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = t_1 - sqrt(x)
if (t_2 <= 0.99999d0) then
tmp = ((0.5d0 * sqrt((1.0d0 / z))) + (sqrt((1.0d0 + t)) - sqrt(t))) + ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (t_1 + sqrt(x))))
else
tmp = (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z))) + (t_2 + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = t_1 - Math.sqrt(x);
double tmp;
if (t_2 <= 0.99999) {
tmp = ((0.5 * Math.sqrt((1.0 / z))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (t_1 + Math.sqrt(x))));
} else {
tmp = (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z))) + (t_2 + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = t_1 - math.sqrt(x) tmp = 0 if t_2 <= 0.99999: tmp = ((0.5 * math.sqrt((1.0 / z))) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (t_1 + math.sqrt(x)))) else: tmp = (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z))) + (t_2 + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = Float64(t_1 - sqrt(x)) tmp = 0.0 if (t_2 <= 0.99999) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(t_1 + sqrt(x))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z))) + Float64(t_2 + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = t_1 - sqrt(x);
tmp = 0.0;
if (t_2 <= 0.99999)
tmp = ((0.5 * sqrt((1.0 / z))) + (sqrt((1.0 + t)) - sqrt(t))) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (t_1 + sqrt(x))));
else
tmp = (1.0 / (sqrt((z + 1.0)) + sqrt(z))) + (t_2 + (1.0 / (sqrt(y) + sqrt((1.0 + y)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.99999], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := t\_1 - \sqrt{x}\\
\mathbf{if}\;t\_2 \leq 0.99999:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{t\_1 + \sqrt{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{z + 1} + \sqrt{z}} + \left(t\_2 + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.999990000000000046Initial program 84.3%
associate-+l+84.3%
sub-neg84.3%
sub-neg84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
Simplified84.3%
+-commutative84.3%
flip--85.0%
flip--85.8%
frac-add85.8%
Applied egg-rr87.1%
*-commutative87.1%
*-commutative87.1%
+-commutative87.1%
*-commutative87.1%
associate-/r*87.1%
Simplified94.4%
Taylor expanded in y around inf 50.7%
Taylor expanded in z around inf 26.9%
if 0.999990000000000046 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 98.3%
associate-+l+98.3%
sub-neg98.3%
sub-neg98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
flip--98.5%
div-inv98.5%
add-sqr-sqrt71.2%
add-sqr-sqrt98.9%
Applied egg-rr98.9%
associate-*r/98.9%
*-rgt-identity98.9%
associate--l+99.1%
+-inverses99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in t around inf 60.0%
flip--57.9%
div-inv57.9%
add-sqr-sqrt45.8%
add-sqr-sqrt58.0%
Applied egg-rr60.3%
associate-*r/58.0%
*-rgt-identity58.0%
associate--l+58.5%
+-inverses58.5%
metadata-eval58.5%
+-commutative58.5%
Simplified60.3%
Final simplification43.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (- t_1 (sqrt x))) (t_3 (sqrt (+ z 1.0))))
(if (<= t_2 0.99999)
(+ (+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ t_1 (sqrt x)))) (- t_3 (sqrt z)))
(+
(/ 1.0 (+ t_3 (sqrt z)))
(+ t_2 (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = t_1 - sqrt(x);
double t_3 = sqrt((z + 1.0));
double tmp;
if (t_2 <= 0.99999) {
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (t_1 + sqrt(x)))) + (t_3 - sqrt(z));
} else {
tmp = (1.0 / (t_3 + sqrt(z))) + (t_2 + (1.0 / (sqrt(y) + sqrt((1.0 + y)))));
}
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 + x))
t_2 = t_1 - sqrt(x)
t_3 = sqrt((z + 1.0d0))
if (t_2 <= 0.99999d0) then
tmp = ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (t_1 + sqrt(x)))) + (t_3 - sqrt(z))
else
tmp = (1.0d0 / (t_3 + sqrt(z))) + (t_2 + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = t_1 - Math.sqrt(x);
double t_3 = Math.sqrt((z + 1.0));
double tmp;
if (t_2 <= 0.99999) {
tmp = ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (t_1 + Math.sqrt(x)))) + (t_3 - Math.sqrt(z));
} else {
tmp = (1.0 / (t_3 + Math.sqrt(z))) + (t_2 + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = t_1 - math.sqrt(x) t_3 = math.sqrt((z + 1.0)) tmp = 0 if t_2 <= 0.99999: tmp = ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (t_1 + math.sqrt(x)))) + (t_3 - math.sqrt(z)) else: tmp = (1.0 / (t_3 + math.sqrt(z))) + (t_2 + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = Float64(t_1 - sqrt(x)) t_3 = sqrt(Float64(z + 1.0)) tmp = 0.0 if (t_2 <= 0.99999) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(t_1 + sqrt(x)))) + Float64(t_3 - sqrt(z))); else tmp = Float64(Float64(1.0 / Float64(t_3 + sqrt(z))) + Float64(t_2 + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = t_1 - sqrt(x);
t_3 = sqrt((z + 1.0));
tmp = 0.0;
if (t_2 <= 0.99999)
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (t_1 + sqrt(x)))) + (t_3 - sqrt(z));
else
tmp = (1.0 / (t_3 + sqrt(z))) + (t_2 + (1.0 / (sqrt(y) + sqrt((1.0 + y)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 0.99999], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := t\_1 - \sqrt{x}\\
t_3 := \sqrt{z + 1}\\
\mathbf{if}\;t\_2 \leq 0.99999:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{t\_1 + \sqrt{x}}\right) + \left(t\_3 - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_3 + \sqrt{z}} + \left(t\_2 + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.999990000000000046Initial program 84.3%
associate-+l+84.3%
sub-neg84.3%
sub-neg84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
Simplified84.3%
+-commutative84.3%
flip--85.0%
flip--85.8%
frac-add85.8%
Applied egg-rr87.1%
*-commutative87.1%
*-commutative87.1%
+-commutative87.1%
*-commutative87.1%
associate-/r*87.1%
Simplified94.4%
Taylor expanded in y around inf 50.7%
Taylor expanded in t around inf 28.3%
if 0.999990000000000046 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 98.3%
associate-+l+98.3%
sub-neg98.3%
sub-neg98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
flip--98.5%
div-inv98.5%
add-sqr-sqrt71.2%
add-sqr-sqrt98.9%
Applied egg-rr98.9%
associate-*r/98.9%
*-rgt-identity98.9%
associate--l+99.1%
+-inverses99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in t around inf 60.0%
flip--57.9%
div-inv57.9%
add-sqr-sqrt45.8%
add-sqr-sqrt58.0%
Applied egg-rr60.3%
associate-*r/58.0%
*-rgt-identity58.0%
associate--l+58.5%
+-inverses58.5%
metadata-eval58.5%
+-commutative58.5%
Simplified60.3%
Final simplification44.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x)))
(t_2 (- t_1 (sqrt x)))
(t_3 (- (sqrt (+ z 1.0)) (sqrt z))))
(if (<= t_2 0.99999)
(+ (+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ t_1 (sqrt x)))) t_3)
(+ t_3 (+ t_2 (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = t_1 - sqrt(x);
double t_3 = sqrt((z + 1.0)) - sqrt(z);
double tmp;
if (t_2 <= 0.99999) {
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (t_1 + sqrt(x)))) + t_3;
} else {
tmp = t_3 + (t_2 + (1.0 / (sqrt(y) + sqrt((1.0 + y)))));
}
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 + x))
t_2 = t_1 - sqrt(x)
t_3 = sqrt((z + 1.0d0)) - sqrt(z)
if (t_2 <= 0.99999d0) then
tmp = ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (t_1 + sqrt(x)))) + t_3
else
tmp = t_3 + (t_2 + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = t_1 - Math.sqrt(x);
double t_3 = Math.sqrt((z + 1.0)) - Math.sqrt(z);
double tmp;
if (t_2 <= 0.99999) {
tmp = ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (t_1 + Math.sqrt(x)))) + t_3;
} else {
tmp = t_3 + (t_2 + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = t_1 - math.sqrt(x) t_3 = math.sqrt((z + 1.0)) - math.sqrt(z) tmp = 0 if t_2 <= 0.99999: tmp = ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (t_1 + math.sqrt(x)))) + t_3 else: tmp = t_3 + (t_2 + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = Float64(t_1 - sqrt(x)) t_3 = Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) tmp = 0.0 if (t_2 <= 0.99999) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(t_1 + sqrt(x)))) + t_3); else tmp = Float64(t_3 + Float64(t_2 + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = t_1 - sqrt(x);
t_3 = sqrt((z + 1.0)) - sqrt(z);
tmp = 0.0;
if (t_2 <= 0.99999)
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (t_1 + sqrt(x)))) + t_3;
else
tmp = t_3 + (t_2 + (1.0 / (sqrt(y) + sqrt((1.0 + y)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.99999], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision], N[(t$95$3 + N[(t$95$2 + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := t\_1 - \sqrt{x}\\
t_3 := \sqrt{z + 1} - \sqrt{z}\\
\mathbf{if}\;t\_2 \leq 0.99999:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{t\_1 + \sqrt{x}}\right) + t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_3 + \left(t\_2 + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.999990000000000046Initial program 84.3%
associate-+l+84.3%
sub-neg84.3%
sub-neg84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
Simplified84.3%
+-commutative84.3%
flip--85.0%
flip--85.8%
frac-add85.8%
Applied egg-rr87.1%
*-commutative87.1%
*-commutative87.1%
+-commutative87.1%
*-commutative87.1%
associate-/r*87.1%
Simplified94.4%
Taylor expanded in y around inf 50.7%
Taylor expanded in t around inf 28.3%
if 0.999990000000000046 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 98.3%
associate-+l+98.3%
sub-neg98.3%
sub-neg98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
flip--98.5%
div-inv98.5%
add-sqr-sqrt71.2%
add-sqr-sqrt98.9%
Applied egg-rr98.9%
associate-*r/98.9%
*-rgt-identity98.9%
associate--l+99.1%
+-inverses99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in t around inf 60.0%
Final simplification43.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 t)) (sqrt t))))
(if (<= y 2900000000.0)
(+
(- (+ 1.0 (pow (+ 1.0 y) 0.5)) (+ (sqrt x) (sqrt y)))
(+ t_1 (- (sqrt (+ z 1.0)) (sqrt z))))
(+
(+ (* 0.5 (sqrt (/ 1.0 z))) t_1)
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (y <= 2900000000.0) {
tmp = ((1.0 + pow((1.0 + y), 0.5)) - (sqrt(x) + sqrt(y))) + (t_1 + (sqrt((z + 1.0)) - sqrt(z)));
} else {
tmp = ((0.5 * sqrt((1.0 / z))) + t_1) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
if (y <= 2900000000.0d0) then
tmp = ((1.0d0 + ((1.0d0 + y) ** 0.5d0)) - (sqrt(x) + sqrt(y))) + (t_1 + (sqrt((z + 1.0d0)) - sqrt(z)))
else
tmp = ((0.5d0 * sqrt((1.0d0 / z))) + t_1) + ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (y <= 2900000000.0) {
tmp = ((1.0 + Math.pow((1.0 + y), 0.5)) - (Math.sqrt(x) + Math.sqrt(y))) + (t_1 + (Math.sqrt((z + 1.0)) - Math.sqrt(z)));
} else {
tmp = ((0.5 * Math.sqrt((1.0 / z))) + t_1) + ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if y <= 2900000000.0: tmp = ((1.0 + math.pow((1.0 + y), 0.5)) - (math.sqrt(x) + math.sqrt(y))) + (t_1 + (math.sqrt((z + 1.0)) - math.sqrt(z))) else: tmp = ((0.5 * math.sqrt((1.0 / z))) + t_1) + ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (y <= 2900000000.0) tmp = Float64(Float64(Float64(1.0 + (Float64(1.0 + y) ^ 0.5)) - Float64(sqrt(x) + sqrt(y))) + Float64(t_1 + Float64(sqrt(Float64(z + 1.0)) - sqrt(z)))); else tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + t_1) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (y <= 2900000000.0)
tmp = ((1.0 + ((1.0 + y) ^ 0.5)) - (sqrt(x) + sqrt(y))) + (t_1 + (sqrt((z + 1.0)) - sqrt(z)));
else
tmp = ((0.5 * sqrt((1.0 / z))) + t_1) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2900000000.0], N[(N[(N[(1.0 + N[Power[N[(1.0 + y), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 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 + t} - \sqrt{t}\\
\mathbf{if}\;y \leq 2900000000:\\
\;\;\;\;\left(\left(1 + {\left(1 + y\right)}^{0.5}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right) + \left(t\_1 + \left(\sqrt{z + 1} - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{z}} + t\_1\right) + \left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)\\
\end{array}
\end{array}
if y < 2.9e9Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 49.4%
pow1/249.4%
+-commutative49.4%
Applied egg-rr49.4%
if 2.9e9 < y Initial program 85.3%
associate-+l+85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
+-commutative85.3%
flip--86.3%
flip--86.5%
frac-add86.5%
Applied egg-rr87.5%
*-commutative87.5%
*-commutative87.5%
+-commutative87.5%
*-commutative87.5%
associate-/r*87.5%
Simplified94.3%
Taylor expanded in y around inf 94.3%
Taylor expanded in z around inf 55.2%
Final simplification52.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= y 1200000000.0)
(+
(- (+ 1.0 (sqrt (+ 1.0 y))) (+ (sqrt x) (sqrt y)))
(+ t_1 (- (sqrt (+ z 1.0)) (sqrt z))))
(+
(+ (* 0.5 (sqrt (/ 1.0 z))) t_1)
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (y <= 1200000000.0) {
tmp = ((1.0 + sqrt((1.0 + y))) - (sqrt(x) + sqrt(y))) + (t_1 + (sqrt((z + 1.0)) - sqrt(z)));
} else {
tmp = ((0.5 * sqrt((1.0 / z))) + t_1) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
if (y <= 1200000000.0d0) then
tmp = ((1.0d0 + sqrt((1.0d0 + y))) - (sqrt(x) + sqrt(y))) + (t_1 + (sqrt((z + 1.0d0)) - sqrt(z)))
else
tmp = ((0.5d0 * sqrt((1.0d0 / z))) + t_1) + ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (y <= 1200000000.0) {
tmp = ((1.0 + Math.sqrt((1.0 + y))) - (Math.sqrt(x) + Math.sqrt(y))) + (t_1 + (Math.sqrt((z + 1.0)) - Math.sqrt(z)));
} else {
tmp = ((0.5 * Math.sqrt((1.0 / z))) + t_1) + ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if y <= 1200000000.0: tmp = ((1.0 + math.sqrt((1.0 + y))) - (math.sqrt(x) + math.sqrt(y))) + (t_1 + (math.sqrt((z + 1.0)) - math.sqrt(z))) else: tmp = ((0.5 * math.sqrt((1.0 / z))) + t_1) + ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (y <= 1200000000.0) tmp = Float64(Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - Float64(sqrt(x) + sqrt(y))) + Float64(t_1 + Float64(sqrt(Float64(z + 1.0)) - sqrt(z)))); else tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + t_1) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (y <= 1200000000.0)
tmp = ((1.0 + sqrt((1.0 + y))) - (sqrt(x) + sqrt(y))) + (t_1 + (sqrt((z + 1.0)) - sqrt(z)));
else
tmp = ((0.5 * sqrt((1.0 / z))) + t_1) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1200000000.0], N[(N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 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 + t} - \sqrt{t}\\
\mathbf{if}\;y \leq 1200000000:\\
\;\;\;\;\left(\left(1 + \sqrt{1 + y}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right) + \left(t\_1 + \left(\sqrt{z + 1} - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{z}} + t\_1\right) + \left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)\\
\end{array}
\end{array}
if y < 1.2e9Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 49.4%
if 1.2e9 < y Initial program 85.3%
associate-+l+85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
+-commutative85.3%
flip--86.3%
flip--86.5%
frac-add86.5%
Applied egg-rr87.5%
*-commutative87.5%
*-commutative87.5%
+-commutative87.5%
*-commutative87.5%
associate-/r*87.5%
Simplified94.3%
Taylor expanded in y around inf 94.3%
Taylor expanded in z around inf 55.2%
Final simplification52.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= y 450000000000.0)
(+
(+ t_1 (- (sqrt (+ z 1.0)) (sqrt z)))
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 y)) (sqrt y))))
(+
(+ (* 0.5 (sqrt (/ 1.0 z))) t_1)
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (y <= 450000000000.0) {
tmp = (t_1 + (sqrt((z + 1.0)) - sqrt(z))) + ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y)));
} else {
tmp = ((0.5 * sqrt((1.0 / z))) + t_1) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
if (y <= 450000000000.0d0) then
tmp = (t_1 + (sqrt((z + 1.0d0)) - sqrt(z))) + ((1.0d0 - sqrt(x)) + (sqrt((1.0d0 + y)) - sqrt(y)))
else
tmp = ((0.5d0 * sqrt((1.0d0 / z))) + t_1) + ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (y <= 450000000000.0) {
tmp = (t_1 + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + ((1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y)));
} else {
tmp = ((0.5 * Math.sqrt((1.0 / z))) + t_1) + ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if y <= 450000000000.0: tmp = (t_1 + (math.sqrt((z + 1.0)) - math.sqrt(z))) + ((1.0 - math.sqrt(x)) + (math.sqrt((1.0 + y)) - math.sqrt(y))) else: tmp = ((0.5 * math.sqrt((1.0 / z))) + t_1) + ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (y <= 450000000000.0) tmp = Float64(Float64(t_1 + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y)))); else tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + t_1) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (y <= 450000000000.0)
tmp = (t_1 + (sqrt((z + 1.0)) - sqrt(z))) + ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y)));
else
tmp = ((0.5 * sqrt((1.0 / z))) + t_1) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 450000000000.0], N[(N[(t$95$1 + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $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[(N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 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 + t} - \sqrt{t}\\
\mathbf{if}\;y \leq 450000000000:\\
\;\;\;\;\left(t\_1 + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{z}} + t\_1\right) + \left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)\\
\end{array}
\end{array}
if y < 4.5e11Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in x around 0 49.8%
if 4.5e11 < y Initial program 85.4%
associate-+l+85.4%
sub-neg85.4%
sub-neg85.4%
+-commutative85.4%
+-commutative85.4%
+-commutative85.4%
Simplified85.4%
+-commutative85.4%
flip--86.2%
flip--86.5%
frac-add86.5%
Applied egg-rr87.1%
*-commutative87.1%
*-commutative87.1%
+-commutative87.1%
*-commutative87.1%
associate-/r*87.1%
Simplified94.1%
Taylor expanded in y around inf 94.1%
Taylor expanded in z around inf 55.3%
Final simplification52.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= y 2500000000.0)
(+
(+ t_1 (- (sqrt (+ z 1.0)) (sqrt z)))
(+ 1.0 (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y)))))
(+
(+ (* 0.5 (sqrt (/ 1.0 z))) t_1)
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (y <= 2500000000.0) {
tmp = (t_1 + (sqrt((z + 1.0)) - sqrt(z))) + (1.0 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y))));
} else {
tmp = ((0.5 * sqrt((1.0 / z))) + t_1) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
if (y <= 2500000000.0d0) then
tmp = (t_1 + (sqrt((z + 1.0d0)) - sqrt(z))) + (1.0d0 + (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y))))
else
tmp = ((0.5d0 * sqrt((1.0d0 / z))) + t_1) + ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (y <= 2500000000.0) {
tmp = (t_1 + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (1.0 + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = ((0.5 * Math.sqrt((1.0 / z))) + t_1) + ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if y <= 2500000000.0: tmp = (t_1 + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (1.0 + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y)))) else: tmp = ((0.5 * math.sqrt((1.0 / z))) + t_1) + ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (y <= 2500000000.0) tmp = Float64(Float64(t_1 + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + t_1) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (y <= 2500000000.0)
tmp = (t_1 + (sqrt((z + 1.0)) - sqrt(z))) + (1.0 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y))));
else
tmp = ((0.5 * sqrt((1.0 / z))) + t_1) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2500000000.0], N[(N[(t$95$1 + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 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 + t} - \sqrt{t}\\
\mathbf{if}\;y \leq 2500000000:\\
\;\;\;\;\left(t\_1 + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{z}} + t\_1\right) + \left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)\\
\end{array}
\end{array}
if y < 2.5e9Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 49.4%
associate--l+49.4%
+-commutative49.4%
Simplified49.4%
if 2.5e9 < y Initial program 85.3%
associate-+l+85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
+-commutative85.3%
flip--86.3%
flip--86.5%
frac-add86.5%
Applied egg-rr87.5%
*-commutative87.5%
*-commutative87.5%
+-commutative87.5%
*-commutative87.5%
associate-/r*87.5%
Simplified94.3%
Taylor expanded in y around inf 94.3%
Taylor expanded in z around inf 55.2%
Final simplification52.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 6e-27)
(+
2.0
(-
(+ (hypot 1.0 (sqrt z)) (* 0.5 (sqrt (/ 1.0 t))))
(+ (sqrt x) (sqrt z))))
(if (<= y 210000000.0)
(+
t_1
(-
(+ (* 0.5 (sqrt (/ 1.0 z))) (pow (+ 1.0 y) 0.5))
(+ (sqrt x) (sqrt y))))
(+
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ t_1 (sqrt x))))
(- (sqrt (+ z 1.0)) (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 + x));
double tmp;
if (y <= 6e-27) {
tmp = 2.0 + ((hypot(1.0, sqrt(z)) + (0.5 * sqrt((1.0 / t)))) - (sqrt(x) + sqrt(z)));
} else if (y <= 210000000.0) {
tmp = t_1 + (((0.5 * sqrt((1.0 / z))) + pow((1.0 + y), 0.5)) - (sqrt(x) + sqrt(y)));
} else {
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (t_1 + sqrt(x)))) + (sqrt((z + 1.0)) - sqrt(z));
}
return tmp;
}
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 <= 6e-27) {
tmp = 2.0 + ((Math.hypot(1.0, Math.sqrt(z)) + (0.5 * Math.sqrt((1.0 / t)))) - (Math.sqrt(x) + Math.sqrt(z)));
} else if (y <= 210000000.0) {
tmp = t_1 + (((0.5 * Math.sqrt((1.0 / z))) + Math.pow((1.0 + y), 0.5)) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (t_1 + Math.sqrt(x)))) + (Math.sqrt((z + 1.0)) - 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 + x)) tmp = 0 if y <= 6e-27: tmp = 2.0 + ((math.hypot(1.0, math.sqrt(z)) + (0.5 * math.sqrt((1.0 / t)))) - (math.sqrt(x) + math.sqrt(z))) elif y <= 210000000.0: tmp = t_1 + (((0.5 * math.sqrt((1.0 / z))) + math.pow((1.0 + y), 0.5)) - (math.sqrt(x) + math.sqrt(y))) else: tmp = ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (t_1 + math.sqrt(x)))) + (math.sqrt((z + 1.0)) - 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 + x)) tmp = 0.0 if (y <= 6e-27) tmp = Float64(2.0 + Float64(Float64(hypot(1.0, sqrt(z)) + Float64(0.5 * sqrt(Float64(1.0 / t)))) - Float64(sqrt(x) + sqrt(z)))); elseif (y <= 210000000.0) tmp = Float64(t_1 + Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + (Float64(1.0 + y) ^ 0.5)) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(t_1 + sqrt(x)))) + Float64(sqrt(Float64(z + 1.0)) - 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 + x));
tmp = 0.0;
if (y <= 6e-27)
tmp = 2.0 + ((hypot(1.0, sqrt(z)) + (0.5 * sqrt((1.0 / t)))) - (sqrt(x) + sqrt(z)));
elseif (y <= 210000000.0)
tmp = t_1 + (((0.5 * sqrt((1.0 / z))) + ((1.0 + y) ^ 0.5)) - (sqrt(x) + sqrt(y)));
else
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (t_1 + sqrt(x)))) + (sqrt((z + 1.0)) - 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 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 6e-27], N[(2.0 + N[(N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[z], $MachinePrecision] ^ 2], $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 210000000.0], N[(t$95$1 + N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[Power[N[(1.0 + y), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $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 + x}\\
\mathbf{if}\;y \leq 6 \cdot 10^{-27}:\\
\;\;\;\;2 + \left(\left(\mathsf{hypot}\left(1, \sqrt{z}\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right) - \left(\sqrt{x} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;y \leq 210000000:\\
\;\;\;\;t\_1 + \left(\left(0.5 \cdot \sqrt{\frac{1}{z}} + {\left(1 + y\right)}^{0.5}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{t\_1 + \sqrt{x}}\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 6.0000000000000002e-27Initial program 98.2%
associate-+l+98.2%
sub-neg98.2%
sub-neg98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 48.5%
Taylor expanded in t around inf 18.9%
Taylor expanded in y around 0 18.9%
associate--l+36.1%
rem-square-sqrt36.1%
metadata-eval36.1%
hypot-undefine36.1%
Simplified36.1%
Taylor expanded in z around inf 36.0%
if 6.0000000000000002e-27 < y < 2.1e8Initial program 93.5%
associate-+l+93.5%
sub-neg93.5%
sub-neg93.5%
+-commutative93.5%
+-commutative93.5%
+-commutative93.5%
Simplified93.5%
Taylor expanded in t around inf 16.7%
associate--l+21.7%
+-commutative21.7%
Simplified21.7%
Taylor expanded in z around inf 15.6%
pow1/255.2%
+-commutative55.2%
Applied egg-rr15.6%
if 2.1e8 < y Initial program 85.3%
associate-+l+85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
+-commutative85.3%
flip--86.3%
flip--86.5%
frac-add86.5%
Applied egg-rr87.5%
*-commutative87.5%
*-commutative87.5%
+-commutative87.5%
*-commutative87.5%
associate-/r*87.5%
Simplified94.3%
Taylor expanded in y around inf 94.3%
Taylor expanded in t around inf 53.1%
Final simplification43.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))) (t_2 (- (sqrt (+ z 1.0)) (sqrt z))))
(if (<= y 1.05)
(+
t_2
(- (+ 1.0 (+ t_1 (* y (+ 0.5 (* y -0.125))))) (+ (sqrt x) (sqrt y))))
(+ (+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ t_1 (sqrt x)))) t_2))))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((z + 1.0)) - sqrt(z);
double tmp;
if (y <= 1.05) {
tmp = t_2 + ((1.0 + (t_1 + (y * (0.5 + (y * -0.125))))) - (sqrt(x) + sqrt(y)));
} else {
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (t_1 + sqrt(x)))) + t_2;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((z + 1.0d0)) - sqrt(z)
if (y <= 1.05d0) then
tmp = t_2 + ((1.0d0 + (t_1 + (y * (0.5d0 + (y * (-0.125d0)))))) - (sqrt(x) + sqrt(y)))
else
tmp = ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (t_1 + sqrt(x)))) + t_2
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((z + 1.0)) - Math.sqrt(z);
double tmp;
if (y <= 1.05) {
tmp = t_2 + ((1.0 + (t_1 + (y * (0.5 + (y * -0.125))))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (t_1 + Math.sqrt(x)))) + t_2;
}
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((z + 1.0)) - math.sqrt(z) tmp = 0 if y <= 1.05: tmp = t_2 + ((1.0 + (t_1 + (y * (0.5 + (y * -0.125))))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (t_1 + math.sqrt(x)))) + t_2 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) tmp = 0.0 if (y <= 1.05) tmp = Float64(t_2 + Float64(Float64(1.0 + Float64(t_1 + Float64(y * Float64(0.5 + Float64(y * -0.125))))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(t_1 + sqrt(x)))) + t_2); 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((z + 1.0)) - sqrt(z);
tmp = 0.0;
if (y <= 1.05)
tmp = t_2 + ((1.0 + (t_1 + (y * (0.5 + (y * -0.125))))) - (sqrt(x) + sqrt(y)));
else
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (t_1 + sqrt(x)))) + t_2;
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[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.05], N[(t$95$2 + N[(N[(1.0 + N[(t$95$1 + N[(y * N[(0.5 + N[(y * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $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{z + 1} - \sqrt{z}\\
\mathbf{if}\;y \leq 1.05:\\
\;\;\;\;t\_2 + \left(\left(1 + \left(t\_1 + y \cdot \left(0.5 + y \cdot -0.125\right)\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{t\_1 + \sqrt{x}}\right) + t\_2\\
\end{array}
\end{array}
if y < 1.05000000000000004Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in y around 0 60.2%
Taylor expanded in t around inf 38.0%
if 1.05000000000000004 < y Initial program 85.7%
associate-+l+85.7%
sub-neg85.7%
sub-neg85.7%
+-commutative85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
+-commutative85.7%
flip--86.6%
flip--86.8%
frac-add86.8%
Applied egg-rr87.9%
*-commutative87.9%
*-commutative87.9%
+-commutative87.9%
*-commutative87.9%
associate-/r*87.9%
Simplified94.5%
Taylor expanded in y around inf 92.8%
Taylor expanded in t around inf 52.0%
Final simplification45.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 1.3e-24)
(+
2.0
(-
(+ (hypot 1.0 (sqrt z)) (* 0.5 (sqrt (/ 1.0 t))))
(+ (sqrt x) (sqrt z))))
(if (<= y 8e+31)
(+ (- t_1 (sqrt x)) (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 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.3e-24) {
tmp = 2.0 + ((hypot(1.0, sqrt(z)) + (0.5 * sqrt((1.0 / t)))) - (sqrt(x) + sqrt(z)));
} else if (y <= 8e+31) {
tmp = (t_1 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((1.0 + y))));
} else {
tmp = 1.0 / (t_1 + sqrt(x));
}
return tmp;
}
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.3e-24) {
tmp = 2.0 + ((Math.hypot(1.0, Math.sqrt(z)) + (0.5 * Math.sqrt((1.0 / t)))) - (Math.sqrt(x) + Math.sqrt(z)));
} else if (y <= 8e+31) {
tmp = (t_1 - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + 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.3e-24: tmp = 2.0 + ((math.hypot(1.0, math.sqrt(z)) + (0.5 * math.sqrt((1.0 / t)))) - (math.sqrt(x) + math.sqrt(z))) elif y <= 8e+31: tmp = (t_1 - math.sqrt(x)) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + 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.3e-24) tmp = Float64(2.0 + Float64(Float64(hypot(1.0, sqrt(z)) + Float64(0.5 * sqrt(Float64(1.0 / t)))) - Float64(sqrt(x) + sqrt(z)))); elseif (y <= 8e+31) tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + 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.3e-24)
tmp = 2.0 + ((hypot(1.0, sqrt(z)) + (0.5 * sqrt((1.0 / t)))) - (sqrt(x) + sqrt(z)));
elseif (y <= 8e+31)
tmp = (t_1 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((1.0 + 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.3e-24], N[(2.0 + N[(N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[z], $MachinePrecision] ^ 2], $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e+31], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $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.3 \cdot 10^{-24}:\\
\;\;\;\;2 + \left(\left(\mathsf{hypot}\left(1, \sqrt{z}\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right) - \left(\sqrt{x} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+31}:\\
\;\;\;\;\left(t\_1 - \sqrt{x}\right) + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 1.3e-24Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
sub-neg97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in x around 0 48.1%
Taylor expanded in t around inf 18.7%
Taylor expanded in y around 0 18.7%
associate--l+35.8%
rem-square-sqrt35.8%
metadata-eval35.8%
hypot-undefine35.8%
Simplified35.8%
Taylor expanded in z around inf 35.7%
if 1.3e-24 < y < 7.9999999999999997e31Initial program 83.9%
associate-+l+83.9%
sub-neg83.9%
sub-neg83.9%
+-commutative83.9%
+-commutative83.9%
+-commutative83.9%
Simplified83.9%
flip--88.4%
div-inv88.4%
add-sqr-sqrt83.5%
add-sqr-sqrt91.8%
Applied egg-rr91.8%
associate-*r/91.8%
*-rgt-identity91.8%
associate--l+97.4%
+-inverses97.4%
metadata-eval97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in t around inf 53.8%
Taylor expanded in z around inf 19.5%
sub-neg19.5%
+-commutative19.5%
associate-+r+32.7%
+-commutative32.7%
sub-neg32.7%
+-commutative32.7%
+-commutative32.7%
Simplified32.7%
if 7.9999999999999997e31 < y Initial program 86.9%
associate-+l+86.9%
sub-neg86.9%
sub-neg86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
Simplified86.9%
Taylor expanded in t around inf 3.2%
associate--l+23.9%
+-commutative23.9%
Simplified23.9%
Taylor expanded in x around inf 23.8%
mul-1-neg23.8%
Simplified23.8%
+-commutative23.8%
sub-neg23.8%
flip--23.8%
add-sqr-sqrt24.0%
+-commutative24.0%
add-sqr-sqrt23.8%
+-commutative23.8%
Applied egg-rr23.8%
associate--l+28.7%
+-inverses28.7%
metadata-eval28.7%
+-commutative28.7%
Simplified28.7%
Final simplification32.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 y))))
(if (<= z 1.2)
(-
(+
3.0
(+ (* 0.5 (sqrt (/ 1.0 t))) (* z (+ 0.5 (* z (- (* z 0.0625) 0.125))))))
(+ (sqrt x) (+ (sqrt y) (sqrt z))))
(if (<= z 9e+29)
(- (+ (+ 1.0 t_1) (* 0.5 (+ x (sqrt (/ 1.0 z))))) (+ (sqrt x) (sqrt y)))
(+ (- (sqrt (+ 1.0 x)) (sqrt x)) (/ 1.0 (+ (sqrt y) 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 + y));
double tmp;
if (z <= 1.2) {
tmp = (3.0 + ((0.5 * sqrt((1.0 / t))) + (z * (0.5 + (z * ((z * 0.0625) - 0.125)))))) - (sqrt(x) + (sqrt(y) + sqrt(z)));
} else if (z <= 9e+29) {
tmp = ((1.0 + t_1) + (0.5 * (x + sqrt((1.0 / z))))) - (sqrt(x) + sqrt(y));
} else {
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (1.0 / (sqrt(y) + 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 + y))
if (z <= 1.2d0) then
tmp = (3.0d0 + ((0.5d0 * sqrt((1.0d0 / t))) + (z * (0.5d0 + (z * ((z * 0.0625d0) - 0.125d0)))))) - (sqrt(x) + (sqrt(y) + sqrt(z)))
else if (z <= 9d+29) then
tmp = ((1.0d0 + t_1) + (0.5d0 * (x + sqrt((1.0d0 / z))))) - (sqrt(x) + sqrt(y))
else
tmp = (sqrt((1.0d0 + x)) - sqrt(x)) + (1.0d0 / (sqrt(y) + 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 + y));
double tmp;
if (z <= 1.2) {
tmp = (3.0 + ((0.5 * Math.sqrt((1.0 / t))) + (z * (0.5 + (z * ((z * 0.0625) - 0.125)))))) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)));
} else if (z <= 9e+29) {
tmp = ((1.0 + t_1) + (0.5 * (x + Math.sqrt((1.0 / z))))) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = (Math.sqrt((1.0 + x)) - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + 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 + y)) tmp = 0 if z <= 1.2: tmp = (3.0 + ((0.5 * math.sqrt((1.0 / t))) + (z * (0.5 + (z * ((z * 0.0625) - 0.125)))))) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))) elif z <= 9e+29: tmp = ((1.0 + t_1) + (0.5 * (x + math.sqrt((1.0 / z))))) - (math.sqrt(x) + math.sqrt(y)) else: tmp = (math.sqrt((1.0 + x)) - math.sqrt(x)) + (1.0 / (math.sqrt(y) + 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 + y)) tmp = 0.0 if (z <= 1.2) tmp = Float64(Float64(3.0 + Float64(Float64(0.5 * sqrt(Float64(1.0 / t))) + Float64(z * Float64(0.5 + Float64(z * Float64(Float64(z * 0.0625) - 0.125)))))) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))); elseif (z <= 9e+29) tmp = Float64(Float64(Float64(1.0 + t_1) + Float64(0.5 * Float64(x + sqrt(Float64(1.0 / z))))) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + 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 + y));
tmp = 0.0;
if (z <= 1.2)
tmp = (3.0 + ((0.5 * sqrt((1.0 / t))) + (z * (0.5 + (z * ((z * 0.0625) - 0.125)))))) - (sqrt(x) + (sqrt(y) + sqrt(z)));
elseif (z <= 9e+29)
tmp = ((1.0 + t_1) + (0.5 * (x + sqrt((1.0 / z))))) - (sqrt(x) + sqrt(y));
else
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (1.0 / (sqrt(y) + 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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.2], N[(N[(3.0 + N[(N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(z * N[(0.5 + N[(z * N[(N[(z * 0.0625), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+29], N[(N[(N[(1.0 + t$95$1), $MachinePrecision] + N[(0.5 * N[(x + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $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 + y}\\
\mathbf{if}\;z \leq 1.2:\\
\;\;\;\;\left(3 + \left(0.5 \cdot \sqrt{\frac{1}{t}} + z \cdot \left(0.5 + z \cdot \left(z \cdot 0.0625 - 0.125\right)\right)\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+29}:\\
\;\;\;\;\left(\left(1 + t\_1\right) + 0.5 \cdot \left(x + \sqrt{\frac{1}{z}}\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + x} - \sqrt{x}\right) + \frac{1}{\sqrt{y} + t\_1}\\
\end{array}
\end{array}
if z < 1.19999999999999996Initial program 97.2%
associate-+l+97.2%
sub-neg97.2%
sub-neg97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 37.7%
Taylor expanded in t around inf 17.3%
Taylor expanded in y around 0 16.0%
associate--l+16.0%
rem-square-sqrt16.0%
metadata-eval16.0%
hypot-undefine16.0%
Simplified16.0%
Taylor expanded in z around 0 16.0%
if 1.19999999999999996 < z < 9.0000000000000005e29Initial program 80.5%
associate-+l+80.5%
sub-neg80.5%
sub-neg80.5%
+-commutative80.5%
+-commutative80.5%
+-commutative80.5%
Simplified80.5%
Taylor expanded in t around inf 6.0%
associate--l+15.2%
+-commutative15.2%
Simplified15.2%
Taylor expanded in z around inf 15.2%
Taylor expanded in x around 0 7.0%
associate-+r+7.0%
distribute-lft-out7.0%
+-commutative7.0%
Simplified7.0%
if 9.0000000000000005e29 < z Initial program 85.9%
associate-+l+85.9%
sub-neg85.9%
sub-neg85.9%
+-commutative85.9%
+-commutative85.9%
+-commutative85.9%
Simplified85.9%
flip--86.6%
div-inv86.6%
add-sqr-sqrt59.6%
add-sqr-sqrt87.0%
Applied egg-rr87.0%
associate-*r/87.0%
*-rgt-identity87.0%
associate--l+90.3%
+-inverses90.3%
metadata-eval90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in t around inf 44.7%
Taylor expanded in z around inf 34.5%
sub-neg34.5%
+-commutative34.5%
associate-+r+44.7%
+-commutative44.7%
sub-neg44.7%
+-commutative44.7%
+-commutative44.7%
Simplified44.7%
Final simplification28.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 (<= z 0.92)
(-
(+ 3.0 (+ (* 0.5 (sqrt (/ 1.0 t))) (* z (+ 0.5 (* z -0.125)))))
(+ (sqrt x) (+ (sqrt y) (sqrt z))))
(if (<= z 9e+29)
(- (+ (+ 1.0 t_1) (* 0.5 (+ x (sqrt (/ 1.0 z))))) (+ (sqrt x) (sqrt y)))
(+ (- (sqrt (+ 1.0 x)) (sqrt x)) (/ 1.0 (+ (sqrt y) 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 + y));
double tmp;
if (z <= 0.92) {
tmp = (3.0 + ((0.5 * sqrt((1.0 / t))) + (z * (0.5 + (z * -0.125))))) - (sqrt(x) + (sqrt(y) + sqrt(z)));
} else if (z <= 9e+29) {
tmp = ((1.0 + t_1) + (0.5 * (x + sqrt((1.0 / z))))) - (sqrt(x) + sqrt(y));
} else {
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (1.0 / (sqrt(y) + 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 + y))
if (z <= 0.92d0) then
tmp = (3.0d0 + ((0.5d0 * sqrt((1.0d0 / t))) + (z * (0.5d0 + (z * (-0.125d0)))))) - (sqrt(x) + (sqrt(y) + sqrt(z)))
else if (z <= 9d+29) then
tmp = ((1.0d0 + t_1) + (0.5d0 * (x + sqrt((1.0d0 / z))))) - (sqrt(x) + sqrt(y))
else
tmp = (sqrt((1.0d0 + x)) - sqrt(x)) + (1.0d0 / (sqrt(y) + 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 + y));
double tmp;
if (z <= 0.92) {
tmp = (3.0 + ((0.5 * Math.sqrt((1.0 / t))) + (z * (0.5 + (z * -0.125))))) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)));
} else if (z <= 9e+29) {
tmp = ((1.0 + t_1) + (0.5 * (x + Math.sqrt((1.0 / z))))) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = (Math.sqrt((1.0 + x)) - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + 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 + y)) tmp = 0 if z <= 0.92: tmp = (3.0 + ((0.5 * math.sqrt((1.0 / t))) + (z * (0.5 + (z * -0.125))))) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))) elif z <= 9e+29: tmp = ((1.0 + t_1) + (0.5 * (x + math.sqrt((1.0 / z))))) - (math.sqrt(x) + math.sqrt(y)) else: tmp = (math.sqrt((1.0 + x)) - math.sqrt(x)) + (1.0 / (math.sqrt(y) + 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 + y)) tmp = 0.0 if (z <= 0.92) tmp = Float64(Float64(3.0 + Float64(Float64(0.5 * sqrt(Float64(1.0 / t))) + Float64(z * Float64(0.5 + Float64(z * -0.125))))) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))); elseif (z <= 9e+29) tmp = Float64(Float64(Float64(1.0 + t_1) + Float64(0.5 * Float64(x + sqrt(Float64(1.0 / z))))) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + 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 + y));
tmp = 0.0;
if (z <= 0.92)
tmp = (3.0 + ((0.5 * sqrt((1.0 / t))) + (z * (0.5 + (z * -0.125))))) - (sqrt(x) + (sqrt(y) + sqrt(z)));
elseif (z <= 9e+29)
tmp = ((1.0 + t_1) + (0.5 * (x + sqrt((1.0 / z))))) - (sqrt(x) + sqrt(y));
else
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (1.0 / (sqrt(y) + 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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 0.92], N[(N[(3.0 + N[(N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(z * N[(0.5 + N[(z * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+29], N[(N[(N[(1.0 + t$95$1), $MachinePrecision] + N[(0.5 * N[(x + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $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 + y}\\
\mathbf{if}\;z \leq 0.92:\\
\;\;\;\;\left(3 + \left(0.5 \cdot \sqrt{\frac{1}{t}} + z \cdot \left(0.5 + z \cdot -0.125\right)\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+29}:\\
\;\;\;\;\left(\left(1 + t\_1\right) + 0.5 \cdot \left(x + \sqrt{\frac{1}{z}}\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + x} - \sqrt{x}\right) + \frac{1}{\sqrt{y} + t\_1}\\
\end{array}
\end{array}
if z < 0.92000000000000004Initial program 97.2%
associate-+l+97.2%
sub-neg97.2%
sub-neg97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 37.7%
Taylor expanded in t around inf 17.3%
Taylor expanded in y around 0 16.0%
associate--l+16.0%
rem-square-sqrt16.0%
metadata-eval16.0%
hypot-undefine16.0%
Simplified16.0%
Taylor expanded in z around 0 16.0%
if 0.92000000000000004 < z < 9.0000000000000005e29Initial program 80.5%
associate-+l+80.5%
sub-neg80.5%
sub-neg80.5%
+-commutative80.5%
+-commutative80.5%
+-commutative80.5%
Simplified80.5%
Taylor expanded in t around inf 6.0%
associate--l+15.2%
+-commutative15.2%
Simplified15.2%
Taylor expanded in z around inf 15.2%
Taylor expanded in x around 0 7.0%
associate-+r+7.0%
distribute-lft-out7.0%
+-commutative7.0%
Simplified7.0%
if 9.0000000000000005e29 < z Initial program 85.9%
associate-+l+85.9%
sub-neg85.9%
sub-neg85.9%
+-commutative85.9%
+-commutative85.9%
+-commutative85.9%
Simplified85.9%
flip--86.6%
div-inv86.6%
add-sqr-sqrt59.6%
add-sqr-sqrt87.0%
Applied egg-rr87.0%
associate-*r/87.0%
*-rgt-identity87.0%
associate--l+90.3%
+-inverses90.3%
metadata-eval90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in t around inf 44.7%
Taylor expanded in z around inf 34.5%
sub-neg34.5%
+-commutative34.5%
associate-+r+44.7%
+-commutative44.7%
sub-neg44.7%
+-commutative44.7%
+-commutative44.7%
Simplified44.7%
Final simplification28.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 (<= z 0.72)
(-
(+ 3.0 (* 0.5 (+ z (sqrt (/ 1.0 t)))))
(+ (sqrt x) (+ (sqrt y) (sqrt z))))
(if (<= z 9e+29)
(- (+ (+ 1.0 t_1) (* 0.5 (+ x (sqrt (/ 1.0 z))))) (+ (sqrt x) (sqrt y)))
(+ (- (sqrt (+ 1.0 x)) (sqrt x)) (/ 1.0 (+ (sqrt y) 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 + y));
double tmp;
if (z <= 0.72) {
tmp = (3.0 + (0.5 * (z + sqrt((1.0 / t))))) - (sqrt(x) + (sqrt(y) + sqrt(z)));
} else if (z <= 9e+29) {
tmp = ((1.0 + t_1) + (0.5 * (x + sqrt((1.0 / z))))) - (sqrt(x) + sqrt(y));
} else {
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (1.0 / (sqrt(y) + 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 + y))
if (z <= 0.72d0) then
tmp = (3.0d0 + (0.5d0 * (z + sqrt((1.0d0 / t))))) - (sqrt(x) + (sqrt(y) + sqrt(z)))
else if (z <= 9d+29) then
tmp = ((1.0d0 + t_1) + (0.5d0 * (x + sqrt((1.0d0 / z))))) - (sqrt(x) + sqrt(y))
else
tmp = (sqrt((1.0d0 + x)) - sqrt(x)) + (1.0d0 / (sqrt(y) + 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 + y));
double tmp;
if (z <= 0.72) {
tmp = (3.0 + (0.5 * (z + Math.sqrt((1.0 / t))))) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)));
} else if (z <= 9e+29) {
tmp = ((1.0 + t_1) + (0.5 * (x + Math.sqrt((1.0 / z))))) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = (Math.sqrt((1.0 + x)) - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + 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 + y)) tmp = 0 if z <= 0.72: tmp = (3.0 + (0.5 * (z + math.sqrt((1.0 / t))))) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))) elif z <= 9e+29: tmp = ((1.0 + t_1) + (0.5 * (x + math.sqrt((1.0 / z))))) - (math.sqrt(x) + math.sqrt(y)) else: tmp = (math.sqrt((1.0 + x)) - math.sqrt(x)) + (1.0 / (math.sqrt(y) + 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 + y)) tmp = 0.0 if (z <= 0.72) tmp = Float64(Float64(3.0 + Float64(0.5 * Float64(z + sqrt(Float64(1.0 / t))))) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))); elseif (z <= 9e+29) tmp = Float64(Float64(Float64(1.0 + t_1) + Float64(0.5 * Float64(x + sqrt(Float64(1.0 / z))))) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + 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 + y));
tmp = 0.0;
if (z <= 0.72)
tmp = (3.0 + (0.5 * (z + sqrt((1.0 / t))))) - (sqrt(x) + (sqrt(y) + sqrt(z)));
elseif (z <= 9e+29)
tmp = ((1.0 + t_1) + (0.5 * (x + sqrt((1.0 / z))))) - (sqrt(x) + sqrt(y));
else
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (1.0 / (sqrt(y) + 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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 0.72], N[(N[(3.0 + N[(0.5 * N[(z + N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+29], N[(N[(N[(1.0 + t$95$1), $MachinePrecision] + N[(0.5 * N[(x + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $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 + y}\\
\mathbf{if}\;z \leq 0.72:\\
\;\;\;\;\left(3 + 0.5 \cdot \left(z + \sqrt{\frac{1}{t}}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+29}:\\
\;\;\;\;\left(\left(1 + t\_1\right) + 0.5 \cdot \left(x + \sqrt{\frac{1}{z}}\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + x} - \sqrt{x}\right) + \frac{1}{\sqrt{y} + t\_1}\\
\end{array}
\end{array}
if z < 0.71999999999999997Initial program 97.2%
associate-+l+97.2%
sub-neg97.2%
sub-neg97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 37.7%
Taylor expanded in t around inf 17.3%
Taylor expanded in y around 0 16.0%
associate--l+16.0%
rem-square-sqrt16.0%
metadata-eval16.0%
hypot-undefine16.0%
Simplified16.0%
Taylor expanded in z around 0 16.0%
distribute-lft-out16.0%
Simplified16.0%
if 0.71999999999999997 < z < 9.0000000000000005e29Initial program 80.5%
associate-+l+80.5%
sub-neg80.5%
sub-neg80.5%
+-commutative80.5%
+-commutative80.5%
+-commutative80.5%
Simplified80.5%
Taylor expanded in t around inf 6.0%
associate--l+15.2%
+-commutative15.2%
Simplified15.2%
Taylor expanded in z around inf 15.2%
Taylor expanded in x around 0 7.0%
associate-+r+7.0%
distribute-lft-out7.0%
+-commutative7.0%
Simplified7.0%
if 9.0000000000000005e29 < z Initial program 85.9%
associate-+l+85.9%
sub-neg85.9%
sub-neg85.9%
+-commutative85.9%
+-commutative85.9%
+-commutative85.9%
Simplified85.9%
flip--86.6%
div-inv86.6%
add-sqr-sqrt59.6%
add-sqr-sqrt87.0%
Applied egg-rr87.0%
associate-*r/87.0%
*-rgt-identity87.0%
associate--l+90.3%
+-inverses90.3%
metadata-eval90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in t around inf 44.7%
Taylor expanded in z around inf 34.5%
sub-neg34.5%
+-commutative34.5%
associate-+r+44.7%
+-commutative44.7%
sub-neg44.7%
+-commutative44.7%
+-commutative44.7%
Simplified44.7%
Final simplification28.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 (<= z 0.72)
(-
(+ 3.0 (* 0.5 (+ z (sqrt (/ 1.0 t)))))
(+ (sqrt x) (+ (sqrt y) (sqrt z))))
(if (<= z 3.2e+30)
(+ 1.0 (- (+ t_1 (* 0.5 (sqrt (/ 1.0 z)))) (+ (sqrt x) (sqrt y))))
(+ (- (sqrt (+ 1.0 x)) (sqrt x)) (/ 1.0 (+ (sqrt y) 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 + y));
double tmp;
if (z <= 0.72) {
tmp = (3.0 + (0.5 * (z + sqrt((1.0 / t))))) - (sqrt(x) + (sqrt(y) + sqrt(z)));
} else if (z <= 3.2e+30) {
tmp = 1.0 + ((t_1 + (0.5 * sqrt((1.0 / z)))) - (sqrt(x) + sqrt(y)));
} else {
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (1.0 / (sqrt(y) + 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 + y))
if (z <= 0.72d0) then
tmp = (3.0d0 + (0.5d0 * (z + sqrt((1.0d0 / t))))) - (sqrt(x) + (sqrt(y) + sqrt(z)))
else if (z <= 3.2d+30) then
tmp = 1.0d0 + ((t_1 + (0.5d0 * sqrt((1.0d0 / z)))) - (sqrt(x) + sqrt(y)))
else
tmp = (sqrt((1.0d0 + x)) - sqrt(x)) + (1.0d0 / (sqrt(y) + 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 + y));
double tmp;
if (z <= 0.72) {
tmp = (3.0 + (0.5 * (z + Math.sqrt((1.0 / t))))) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)));
} else if (z <= 3.2e+30) {
tmp = 1.0 + ((t_1 + (0.5 * Math.sqrt((1.0 / z)))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (Math.sqrt((1.0 + x)) - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + 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 + y)) tmp = 0 if z <= 0.72: tmp = (3.0 + (0.5 * (z + math.sqrt((1.0 / t))))) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))) elif z <= 3.2e+30: tmp = 1.0 + ((t_1 + (0.5 * math.sqrt((1.0 / z)))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = (math.sqrt((1.0 + x)) - math.sqrt(x)) + (1.0 / (math.sqrt(y) + 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 + y)) tmp = 0.0 if (z <= 0.72) tmp = Float64(Float64(3.0 + Float64(0.5 * Float64(z + sqrt(Float64(1.0 / t))))) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))); elseif (z <= 3.2e+30) tmp = Float64(1.0 + Float64(Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / z)))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + 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 + y));
tmp = 0.0;
if (z <= 0.72)
tmp = (3.0 + (0.5 * (z + sqrt((1.0 / t))))) - (sqrt(x) + (sqrt(y) + sqrt(z)));
elseif (z <= 3.2e+30)
tmp = 1.0 + ((t_1 + (0.5 * sqrt((1.0 / z)))) - (sqrt(x) + sqrt(y)));
else
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (1.0 / (sqrt(y) + 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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 0.72], N[(N[(3.0 + N[(0.5 * N[(z + N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+30], N[(1.0 + N[(N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $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 + y}\\
\mathbf{if}\;z \leq 0.72:\\
\;\;\;\;\left(3 + 0.5 \cdot \left(z + \sqrt{\frac{1}{t}}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+30}:\\
\;\;\;\;1 + \left(\left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + x} - \sqrt{x}\right) + \frac{1}{\sqrt{y} + t\_1}\\
\end{array}
\end{array}
if z < 0.71999999999999997Initial program 97.2%
associate-+l+97.2%
sub-neg97.2%
sub-neg97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 37.7%
Taylor expanded in t around inf 17.3%
Taylor expanded in y around 0 16.0%
associate--l+16.0%
rem-square-sqrt16.0%
metadata-eval16.0%
hypot-undefine16.0%
Simplified16.0%
Taylor expanded in z around 0 16.0%
distribute-lft-out16.0%
Simplified16.0%
if 0.71999999999999997 < z < 3.19999999999999973e30Initial program 80.5%
associate-+l+80.5%
sub-neg80.5%
sub-neg80.5%
+-commutative80.5%
+-commutative80.5%
+-commutative80.5%
Simplified80.5%
Taylor expanded in t around inf 6.0%
associate--l+15.2%
+-commutative15.2%
Simplified15.2%
Taylor expanded in z around inf 15.2%
Taylor expanded in x around 0 5.4%
associate--l+19.1%
+-commutative19.1%
+-commutative19.1%
Simplified19.1%
if 3.19999999999999973e30 < z Initial program 85.9%
associate-+l+85.9%
sub-neg85.9%
sub-neg85.9%
+-commutative85.9%
+-commutative85.9%
+-commutative85.9%
Simplified85.9%
flip--86.6%
div-inv86.6%
add-sqr-sqrt59.6%
add-sqr-sqrt87.0%
Applied egg-rr87.0%
associate-*r/87.0%
*-rgt-identity87.0%
associate--l+90.3%
+-inverses90.3%
metadata-eval90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in t around inf 44.7%
Taylor expanded in z around inf 34.5%
sub-neg34.5%
+-commutative34.5%
associate-+r+44.7%
+-commutative44.7%
sub-neg44.7%
+-commutative44.7%
+-commutative44.7%
Simplified44.7%
Final simplification29.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 (sqrt (+ 1.0 y))))
(if (<= z 0.43)
(- (+ (* 0.5 (sqrt (/ 1.0 t))) 3.0) (+ (sqrt x) (+ (sqrt y) (sqrt z))))
(if (<= z 1.35e+31)
(+ 1.0 (- (+ t_1 (* 0.5 (sqrt (/ 1.0 z)))) (+ (sqrt x) (sqrt y))))
(+ (- (sqrt (+ 1.0 x)) (sqrt x)) (/ 1.0 (+ (sqrt y) 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 + y));
double tmp;
if (z <= 0.43) {
tmp = ((0.5 * sqrt((1.0 / t))) + 3.0) - (sqrt(x) + (sqrt(y) + sqrt(z)));
} else if (z <= 1.35e+31) {
tmp = 1.0 + ((t_1 + (0.5 * sqrt((1.0 / z)))) - (sqrt(x) + sqrt(y)));
} else {
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (1.0 / (sqrt(y) + 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 + y))
if (z <= 0.43d0) then
tmp = ((0.5d0 * sqrt((1.0d0 / t))) + 3.0d0) - (sqrt(x) + (sqrt(y) + sqrt(z)))
else if (z <= 1.35d+31) then
tmp = 1.0d0 + ((t_1 + (0.5d0 * sqrt((1.0d0 / z)))) - (sqrt(x) + sqrt(y)))
else
tmp = (sqrt((1.0d0 + x)) - sqrt(x)) + (1.0d0 / (sqrt(y) + 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 + y));
double tmp;
if (z <= 0.43) {
tmp = ((0.5 * Math.sqrt((1.0 / t))) + 3.0) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)));
} else if (z <= 1.35e+31) {
tmp = 1.0 + ((t_1 + (0.5 * Math.sqrt((1.0 / z)))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (Math.sqrt((1.0 + x)) - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + 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 + y)) tmp = 0 if z <= 0.43: tmp = ((0.5 * math.sqrt((1.0 / t))) + 3.0) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))) elif z <= 1.35e+31: tmp = 1.0 + ((t_1 + (0.5 * math.sqrt((1.0 / z)))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = (math.sqrt((1.0 + x)) - math.sqrt(x)) + (1.0 / (math.sqrt(y) + 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 + y)) tmp = 0.0 if (z <= 0.43) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / t))) + 3.0) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))); elseif (z <= 1.35e+31) tmp = Float64(1.0 + Float64(Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / z)))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + 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 + y));
tmp = 0.0;
if (z <= 0.43)
tmp = ((0.5 * sqrt((1.0 / t))) + 3.0) - (sqrt(x) + (sqrt(y) + sqrt(z)));
elseif (z <= 1.35e+31)
tmp = 1.0 + ((t_1 + (0.5 * sqrt((1.0 / z)))) - (sqrt(x) + sqrt(y)));
else
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (1.0 / (sqrt(y) + 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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 0.43], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e+31], N[(1.0 + N[(N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $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 + y}\\
\mathbf{if}\;z \leq 0.43:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{t}} + 3\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+31}:\\
\;\;\;\;1 + \left(\left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + x} - \sqrt{x}\right) + \frac{1}{\sqrt{y} + t\_1}\\
\end{array}
\end{array}
if z < 0.429999999999999993Initial program 97.2%
associate-+l+97.2%
sub-neg97.2%
sub-neg97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 37.7%
Taylor expanded in t around inf 17.3%
Taylor expanded in y around 0 16.0%
associate--l+16.0%
rem-square-sqrt16.0%
metadata-eval16.0%
hypot-undefine16.0%
Simplified16.0%
Taylor expanded in z around 0 16.0%
if 0.429999999999999993 < z < 1.34999999999999993e31Initial program 80.5%
associate-+l+80.5%
sub-neg80.5%
sub-neg80.5%
+-commutative80.5%
+-commutative80.5%
+-commutative80.5%
Simplified80.5%
Taylor expanded in t around inf 6.0%
associate--l+15.2%
+-commutative15.2%
Simplified15.2%
Taylor expanded in z around inf 15.2%
Taylor expanded in x around 0 5.4%
associate--l+19.1%
+-commutative19.1%
+-commutative19.1%
Simplified19.1%
if 1.34999999999999993e31 < z Initial program 85.9%
associate-+l+85.9%
sub-neg85.9%
sub-neg85.9%
+-commutative85.9%
+-commutative85.9%
+-commutative85.9%
Simplified85.9%
flip--86.6%
div-inv86.6%
add-sqr-sqrt59.6%
add-sqr-sqrt87.0%
Applied egg-rr87.0%
associate-*r/87.0%
*-rgt-identity87.0%
associate--l+90.3%
+-inverses90.3%
metadata-eval90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in t around inf 44.7%
Taylor expanded in z around inf 34.5%
sub-neg34.5%
+-commutative34.5%
associate-+r+44.7%
+-commutative44.7%
sub-neg44.7%
+-commutative44.7%
+-commutative44.7%
Simplified44.7%
Final simplification29.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 0.72) (- (+ (* 0.5 (sqrt (/ 1.0 t))) 3.0) (+ (sqrt x) (+ (sqrt y) (sqrt z)))) (+ (- (sqrt (+ 1.0 x)) (sqrt x)) (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.72) {
tmp = ((0.5 * sqrt((1.0 / t))) + 3.0) - (sqrt(x) + (sqrt(y) + sqrt(z)));
} else {
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((1.0 + y))));
}
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 (z <= 0.72d0) then
tmp = ((0.5d0 * sqrt((1.0d0 / t))) + 3.0d0) - (sqrt(x) + (sqrt(y) + sqrt(z)))
else
tmp = (sqrt((1.0d0 + x)) - sqrt(x)) + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y))))
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 (z <= 0.72) {
tmp = ((0.5 * Math.sqrt((1.0 / t))) + 3.0) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)));
} else {
tmp = (Math.sqrt((1.0 + x)) - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.72: tmp = ((0.5 * math.sqrt((1.0 / t))) + 3.0) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))) else: tmp = (math.sqrt((1.0 + x)) - math.sqrt(x)) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.72) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / t))) + 3.0) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))); else tmp = Float64(Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y))))); 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 (z <= 0.72)
tmp = ((0.5 * sqrt((1.0 / t))) + 3.0) - (sqrt(x) + (sqrt(y) + sqrt(z)));
else
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((1.0 + y))));
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[z, 0.72], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.72:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{t}} + 3\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + x} - \sqrt{x}\right) + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\\
\end{array}
\end{array}
if z < 0.71999999999999997Initial program 97.2%
associate-+l+97.2%
sub-neg97.2%
sub-neg97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 37.7%
Taylor expanded in t around inf 17.3%
Taylor expanded in y around 0 16.0%
associate--l+16.0%
rem-square-sqrt16.0%
metadata-eval16.0%
hypot-undefine16.0%
Simplified16.0%
Taylor expanded in z around 0 16.0%
if 0.71999999999999997 < z Initial program 85.4%
associate-+l+85.4%
sub-neg85.4%
sub-neg85.4%
+-commutative85.4%
+-commutative85.4%
+-commutative85.4%
Simplified85.4%
flip--86.0%
div-inv86.0%
add-sqr-sqrt59.5%
add-sqr-sqrt86.4%
Applied egg-rr86.4%
associate-*r/86.4%
*-rgt-identity86.4%
associate--l+89.4%
+-inverses89.4%
metadata-eval89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in t around inf 45.0%
Taylor expanded in z around inf 32.7%
sub-neg32.7%
+-commutative32.7%
associate-+r+42.6%
+-commutative42.6%
sub-neg42.6%
+-commutative42.6%
+-commutative42.6%
Simplified42.6%
Final simplification29.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))))
(if (<= z 0.104)
(- (+ 1.0 (+ (sqrt (+ z 1.0)) t_1)) (+ (sqrt x) (sqrt y)))
(+ (- (sqrt (+ 1.0 x)) (sqrt x)) (/ 1.0 (+ (sqrt y) 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 + y));
double tmp;
if (z <= 0.104) {
tmp = (1.0 + (sqrt((z + 1.0)) + t_1)) - (sqrt(x) + sqrt(y));
} else {
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (1.0 / (sqrt(y) + 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 + y))
if (z <= 0.104d0) then
tmp = (1.0d0 + (sqrt((z + 1.0d0)) + t_1)) - (sqrt(x) + sqrt(y))
else
tmp = (sqrt((1.0d0 + x)) - sqrt(x)) + (1.0d0 / (sqrt(y) + 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 + y));
double tmp;
if (z <= 0.104) {
tmp = (1.0 + (Math.sqrt((z + 1.0)) + t_1)) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = (Math.sqrt((1.0 + x)) - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + 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 + y)) tmp = 0 if z <= 0.104: tmp = (1.0 + (math.sqrt((z + 1.0)) + t_1)) - (math.sqrt(x) + math.sqrt(y)) else: tmp = (math.sqrt((1.0 + x)) - math.sqrt(x)) + (1.0 / (math.sqrt(y) + 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 + y)) tmp = 0.0 if (z <= 0.104) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(z + 1.0)) + t_1)) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + 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 + y));
tmp = 0.0;
if (z <= 0.104)
tmp = (1.0 + (sqrt((z + 1.0)) + t_1)) - (sqrt(x) + sqrt(y));
else
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (1.0 / (sqrt(y) + 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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 0.104], N[(N[(1.0 + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $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 + y}\\
\mathbf{if}\;z \leq 0.104:\\
\;\;\;\;\left(1 + \left(\sqrt{z + 1} + t\_1\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + x} - \sqrt{x}\right) + \frac{1}{\sqrt{y} + t\_1}\\
\end{array}
\end{array}
if z < 0.103999999999999995Initial program 97.2%
associate-+l+97.2%
sub-neg97.2%
sub-neg97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in t around inf 20.7%
associate--l+24.4%
+-commutative24.4%
Simplified24.4%
Taylor expanded in y around inf 24.4%
Taylor expanded in x around 0 18.2%
if 0.103999999999999995 < z Initial program 85.4%
associate-+l+85.4%
sub-neg85.4%
sub-neg85.4%
+-commutative85.4%
+-commutative85.4%
+-commutative85.4%
Simplified85.4%
flip--86.0%
div-inv86.0%
add-sqr-sqrt59.5%
add-sqr-sqrt86.4%
Applied egg-rr86.4%
associate-*r/86.4%
*-rgt-identity86.4%
associate--l+89.4%
+-inverses89.4%
metadata-eval89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in t around inf 45.0%
Taylor expanded in z around inf 32.7%
sub-neg32.7%
+-commutative32.7%
associate-+r+42.6%
+-commutative42.6%
sub-neg42.6%
+-commutative42.6%
+-commutative42.6%
Simplified42.6%
Final simplification30.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.5e+31)
(+ (- t_1 (sqrt x)) (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 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.5e+31) {
tmp = (t_1 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((1.0 + 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.5d+31) then
tmp = (t_1 - sqrt(x)) + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + 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.5e+31) {
tmp = (t_1 - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + 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.5e+31: tmp = (t_1 - math.sqrt(x)) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + 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.5e+31) tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + 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.5e+31)
tmp = (t_1 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((1.0 + 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.5e+31], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $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.5 \cdot 10^{+31}:\\
\;\;\;\;\left(t\_1 - \sqrt{x}\right) + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 3.5e31Initial program 94.9%
associate-+l+94.9%
sub-neg94.9%
sub-neg94.9%
+-commutative94.9%
+-commutative94.9%
+-commutative94.9%
Simplified94.9%
flip--95.9%
div-inv95.9%
add-sqr-sqrt94.8%
add-sqr-sqrt96.6%
Applied egg-rr96.6%
associate-*r/96.6%
*-rgt-identity96.6%
associate--l+97.8%
+-inverses97.8%
metadata-eval97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in t around inf 52.9%
Taylor expanded in z around inf 20.9%
sub-neg20.9%
+-commutative20.9%
associate-+r+31.7%
+-commutative31.7%
sub-neg31.7%
+-commutative31.7%
+-commutative31.7%
Simplified31.7%
if 3.5e31 < y Initial program 86.9%
associate-+l+86.9%
sub-neg86.9%
sub-neg86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
Simplified86.9%
Taylor expanded in t around inf 3.2%
associate--l+23.9%
+-commutative23.9%
Simplified23.9%
Taylor expanded in x around inf 23.8%
mul-1-neg23.8%
Simplified23.8%
+-commutative23.8%
sub-neg23.8%
flip--23.8%
add-sqr-sqrt24.0%
+-commutative24.0%
add-sqr-sqrt23.8%
+-commutative23.8%
Applied egg-rr23.8%
associate--l+28.7%
+-inverses28.7%
metadata-eval28.7%
+-commutative28.7%
Simplified28.7%
Final simplification30.3%
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 1e+23)
(- (+ 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 <= 1e+23) {
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 <= 1d+23) 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 <= 1e+23) {
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 <= 1e+23: 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 <= 1e+23) tmp = Float64(Float64(t_1 + 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 <= 1e+23)
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, 1e+23], N[(N[(t$95$1 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 10^{+23}:\\
\;\;\;\;\left(t\_1 + \sqrt{1 + y}\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 9.9999999999999992e22Initial program 95.6%
associate-+l+95.6%
sub-neg95.6%
sub-neg95.6%
+-commutative95.6%
+-commutative95.6%
+-commutative95.6%
Simplified95.6%
Taylor expanded in t around inf 19.9%
associate--l+25.0%
+-commutative25.0%
Simplified25.0%
Taylor expanded in z around inf 21.2%
if 9.9999999999999992e22 < y Initial program 86.4%
associate-+l+86.4%
sub-neg86.4%
sub-neg86.4%
+-commutative86.4%
+-commutative86.4%
+-commutative86.4%
Simplified86.4%
Taylor expanded in t around inf 3.3%
associate--l+23.4%
+-commutative23.4%
Simplified23.4%
Taylor expanded in x around inf 23.3%
mul-1-neg23.3%
Simplified23.3%
+-commutative23.3%
sub-neg23.3%
flip--23.3%
add-sqr-sqrt23.4%
+-commutative23.4%
add-sqr-sqrt23.3%
+-commutative23.3%
Applied egg-rr23.3%
associate--l+28.1%
+-inverses28.1%
metadata-eval28.1%
+-commutative28.1%
Simplified28.1%
Final simplification24.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 (sqrt (+ 1.0 x))))
(if (<= y 4.5e+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 <= 4.5e+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 <= 4.5d+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 <= 4.5e+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 <= 4.5e+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 <= 4.5e+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 <= 4.5e+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, 4.5e+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 4.5 \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 < 4.5e15Initial program 96.1%
associate-+l+96.1%
sub-neg96.1%
sub-neg96.1%
+-commutative96.1%
+-commutative96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in t around inf 20.3%
associate--l+24.4%
+-commutative24.4%
Simplified24.4%
Taylor expanded in z around inf 20.5%
if 4.5e15 < y Initial program 86.1%
associate-+l+86.1%
sub-neg86.1%
sub-neg86.1%
+-commutative86.1%
+-commutative86.1%
+-commutative86.1%
Simplified86.1%
Taylor expanded in t around inf 3.3%
associate--l+24.1%
+-commutative24.1%
Simplified24.1%
Taylor expanded in x around inf 23.9%
mul-1-neg23.9%
Simplified23.9%
+-commutative23.9%
sub-neg23.9%
flip--23.9%
add-sqr-sqrt24.1%
+-commutative24.1%
add-sqr-sqrt23.9%
+-commutative23.9%
Applied egg-rr23.9%
associate--l+28.7%
+-inverses28.7%
metadata-eval28.7%
+-commutative28.7%
Simplified28.7%
Final simplification24.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 80000000000000.0) (- (+ 1.0 (sqrt (+ 1.0 y))) (+ (sqrt x) (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 (y <= 80000000000000.0) {
tmp = (1.0 + sqrt((1.0 + y))) - (sqrt(x) + 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 (y <= 80000000000000.0d0) then
tmp = (1.0d0 + sqrt((1.0d0 + y))) - (sqrt(x) + 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 (y <= 80000000000000.0) {
tmp = (1.0 + Math.sqrt((1.0 + y))) - (Math.sqrt(x) + 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 y <= 80000000000000.0: tmp = (1.0 + math.sqrt((1.0 + y))) - (math.sqrt(x) + 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 (y <= 80000000000000.0) tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - Float64(sqrt(x) + 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 (y <= 80000000000000.0)
tmp = (1.0 + sqrt((1.0 + y))) - (sqrt(x) + 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[y, 80000000000000.0], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 80000000000000:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 8e13Initial program 96.7%
associate-+l+96.7%
sub-neg96.7%
sub-neg96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
Taylor expanded in t around inf 20.5%
associate--l+24.5%
+-commutative24.5%
Simplified24.5%
Taylor expanded in z around inf 20.6%
Taylor expanded in x around 0 18.5%
if 8e13 < y Initial program 85.7%
associate-+l+85.7%
sub-neg85.7%
sub-neg85.7%
+-commutative85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in t around inf 3.3%
associate--l+23.9%
+-commutative23.9%
Simplified23.9%
Taylor expanded in x around inf 23.8%
mul-1-neg23.8%
Simplified23.8%
+-commutative23.8%
sub-neg23.8%
flip--23.7%
add-sqr-sqrt23.9%
+-commutative23.9%
add-sqr-sqrt23.8%
+-commutative23.8%
Applied egg-rr23.8%
associate--l+28.5%
+-inverses28.5%
metadata-eval28.5%
+-commutative28.5%
Simplified28.5%
Final simplification23.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 80000000000000.0) (+ 1.0 (- (sqrt (+ 1.0 y)) (+ (sqrt x) (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 (y <= 80000000000000.0) {
tmp = 1.0 + (sqrt((1.0 + y)) - (sqrt(x) + 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 (y <= 80000000000000.0d0) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - (sqrt(x) + 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 (y <= 80000000000000.0) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + 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 y <= 80000000000000.0: tmp = 1.0 + (math.sqrt((1.0 + y)) - (math.sqrt(x) + 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 (y <= 80000000000000.0) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + 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 (y <= 80000000000000.0)
tmp = 1.0 + (sqrt((1.0 + y)) - (sqrt(x) + 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[y, 80000000000000.0], N[(1.0 + 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[(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}\;y \leq 80000000000000:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 8e13Initial program 96.7%
associate-+l+96.7%
sub-neg96.7%
sub-neg96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
Taylor expanded in t around inf 20.5%
associate--l+24.5%
+-commutative24.5%
Simplified24.5%
Taylor expanded in z around inf 20.6%
Taylor expanded in x around 0 18.5%
associate--l+18.5%
Simplified18.5%
if 8e13 < y Initial program 85.7%
associate-+l+85.7%
sub-neg85.7%
sub-neg85.7%
+-commutative85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in t around inf 3.3%
associate--l+23.9%
+-commutative23.9%
Simplified23.9%
Taylor expanded in x around inf 23.8%
mul-1-neg23.8%
Simplified23.8%
+-commutative23.8%
sub-neg23.8%
flip--23.7%
add-sqr-sqrt23.9%
+-commutative23.9%
add-sqr-sqrt23.8%
+-commutative23.8%
Applied egg-rr23.8%
associate--l+28.5%
+-inverses28.5%
metadata-eval28.5%
+-commutative28.5%
Simplified28.5%
Final simplification23.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 1.6) (- 2.0 (sqrt y)) (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.6) {
tmp = 2.0 - sqrt(y);
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.6d0) then
tmp = 2.0d0 - sqrt(y)
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.6) {
tmp = 2.0 - Math.sqrt(y);
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.6: tmp = 2.0 - math.sqrt(y) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.6) tmp = Float64(2.0 - sqrt(y)); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.6)
tmp = 2.0 - sqrt(y);
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.6], N[(2.0 - N[Sqrt[y], $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}\;y \leq 1.6:\\
\;\;\;\;2 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 1.6000000000000001Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 47.4%
Taylor expanded in t around inf 17.5%
Taylor expanded in y around 0 17.5%
associate--l+34.2%
rem-square-sqrt34.2%
metadata-eval34.2%
hypot-undefine34.2%
Simplified34.2%
Taylor expanded in y around inf 46.5%
mul-1-neg46.5%
Simplified46.5%
if 1.6000000000000001 < y Initial program 85.7%
associate-+l+85.7%
sub-neg85.7%
sub-neg85.7%
+-commutative85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in t around inf 4.3%
associate--l+23.8%
+-commutative23.8%
Simplified23.8%
Taylor expanded in x around inf 23.0%
mul-1-neg23.0%
Simplified23.0%
+-commutative23.0%
sub-neg23.0%
flip--23.0%
add-sqr-sqrt23.2%
+-commutative23.2%
add-sqr-sqrt23.0%
+-commutative23.0%
Applied egg-rr23.0%
associate--l+27.5%
+-inverses27.5%
metadata-eval27.5%
+-commutative27.5%
Simplified27.5%
Final simplification36.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 1.05) (- 2.0 (sqrt y)) (- (pow (+ 1.0 x) 0.5) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.05) {
tmp = 2.0 - sqrt(y);
} else {
tmp = pow((1.0 + x), 0.5) - 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 (y <= 1.05d0) then
tmp = 2.0d0 - sqrt(y)
else
tmp = ((1.0d0 + x) ** 0.5d0) - 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 (y <= 1.05) {
tmp = 2.0 - Math.sqrt(y);
} else {
tmp = Math.pow((1.0 + x), 0.5) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.05: tmp = 2.0 - math.sqrt(y) else: tmp = math.pow((1.0 + x), 0.5) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.05) tmp = Float64(2.0 - sqrt(y)); else tmp = Float64((Float64(1.0 + x) ^ 0.5) - 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 (y <= 1.05)
tmp = 2.0 - sqrt(y);
else
tmp = ((1.0 + x) ^ 0.5) - 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[y, 1.05], N[(2.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(1.0 + x), $MachinePrecision], 0.5], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.05:\\
\;\;\;\;2 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;{\left(1 + x\right)}^{0.5} - \sqrt{x}\\
\end{array}
\end{array}
if y < 1.05000000000000004Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 47.4%
Taylor expanded in t around inf 17.5%
Taylor expanded in y around 0 17.5%
associate--l+34.2%
rem-square-sqrt34.2%
metadata-eval34.2%
hypot-undefine34.2%
Simplified34.2%
Taylor expanded in y around inf 46.5%
mul-1-neg46.5%
Simplified46.5%
if 1.05000000000000004 < y Initial program 85.7%
associate-+l+85.7%
sub-neg85.7%
sub-neg85.7%
+-commutative85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in t around inf 4.3%
associate--l+23.8%
+-commutative23.8%
Simplified23.8%
Taylor expanded in x around inf 23.0%
mul-1-neg23.0%
Simplified23.0%
pow1/223.0%
Applied egg-rr23.0%
Final simplification33.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 (<= y 1.2) (- 2.0 (sqrt y)) (- (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 (y <= 1.2) {
tmp = 2.0 - sqrt(y);
} else {
tmp = 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 (y <= 1.2d0) then
tmp = 2.0d0 - sqrt(y)
else
tmp = 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 (y <= 1.2) {
tmp = 2.0 - Math.sqrt(y);
} else {
tmp = 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 y <= 1.2: tmp = 2.0 - math.sqrt(y) else: tmp = 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 (y <= 1.2) tmp = Float64(2.0 - sqrt(y)); else tmp = 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 (y <= 1.2)
tmp = 2.0 - sqrt(y);
else
tmp = 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[y, 1.2], N[(2.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.2:\\
\;\;\;\;2 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 1.19999999999999996Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 47.4%
Taylor expanded in t around inf 17.5%
Taylor expanded in y around 0 17.5%
associate--l+34.2%
rem-square-sqrt34.2%
metadata-eval34.2%
hypot-undefine34.2%
Simplified34.2%
Taylor expanded in y around inf 46.5%
mul-1-neg46.5%
Simplified46.5%
if 1.19999999999999996 < y Initial program 85.7%
associate-+l+85.7%
sub-neg85.7%
sub-neg85.7%
+-commutative85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in t around inf 4.3%
associate--l+23.8%
+-commutative23.8%
Simplified23.8%
Taylor expanded in z around inf 5.2%
Taylor expanded in y around inf 23.0%
+-commutative23.0%
Simplified23.0%
Final simplification33.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 (<= y 1.0) (- 2.0 (sqrt y)) (+ 1.0 (- (* x 0.5) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.0) {
tmp = 2.0 - sqrt(y);
} else {
tmp = 1.0 + ((x * 0.5) - 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 (y <= 1.0d0) then
tmp = 2.0d0 - sqrt(y)
else
tmp = 1.0d0 + ((x * 0.5d0) - 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 (y <= 1.0) {
tmp = 2.0 - Math.sqrt(y);
} else {
tmp = 1.0 + ((x * 0.5) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.0: tmp = 2.0 - math.sqrt(y) else: tmp = 1.0 + ((x * 0.5) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.0) tmp = Float64(2.0 - sqrt(y)); else tmp = Float64(1.0 + Float64(Float64(x * 0.5) - 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 (y <= 1.0)
tmp = 2.0 - sqrt(y);
else
tmp = 1.0 + ((x * 0.5) - 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[y, 1.0], N[(2.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x * 0.5), $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}\;y \leq 1:\\
\;\;\;\;2 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x \cdot 0.5 - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 1Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 47.4%
Taylor expanded in t around inf 17.5%
Taylor expanded in y around 0 17.5%
associate--l+34.2%
rem-square-sqrt34.2%
metadata-eval34.2%
hypot-undefine34.2%
Simplified34.2%
Taylor expanded in y around inf 46.5%
mul-1-neg46.5%
Simplified46.5%
if 1 < y Initial program 85.7%
associate-+l+85.7%
sub-neg85.7%
sub-neg85.7%
+-commutative85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in t around inf 4.3%
associate--l+23.8%
+-commutative23.8%
Simplified23.8%
Taylor expanded in x around inf 23.0%
mul-1-neg23.0%
Simplified23.0%
Taylor expanded in x around 0 23.5%
associate--l+23.5%
Simplified23.5%
Final simplification34.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 (<= y 1.0) (- 2.0 (sqrt y)) (- 1.0 (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.0) {
tmp = 2.0 - sqrt(y);
} else {
tmp = 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) :: tmp
if (y <= 1.0d0) then
tmp = 2.0d0 - sqrt(y)
else
tmp = 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 tmp;
if (y <= 1.0) {
tmp = 2.0 - Math.sqrt(y);
} else {
tmp = 1.0 - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.0: tmp = 2.0 - math.sqrt(y) else: tmp = 1.0 - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.0) tmp = Float64(2.0 - sqrt(y)); else tmp = 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)
tmp = 0.0;
if (y <= 1.0)
tmp = 2.0 - sqrt(y);
else
tmp = 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_] := If[LessEqual[y, 1.0], N[(2.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;2 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \sqrt{x}\\
\end{array}
\end{array}
if y < 1Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 47.4%
Taylor expanded in t around inf 17.5%
Taylor expanded in y around 0 17.5%
associate--l+34.2%
rem-square-sqrt34.2%
metadata-eval34.2%
hypot-undefine34.2%
Simplified34.2%
Taylor expanded in y around inf 46.5%
mul-1-neg46.5%
Simplified46.5%
if 1 < y Initial program 85.7%
associate-+l+85.7%
sub-neg85.7%
sub-neg85.7%
+-commutative85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in t around inf 4.3%
associate--l+23.8%
+-commutative23.8%
Simplified23.8%
Taylor expanded in x around inf 23.0%
mul-1-neg23.0%
Simplified23.0%
Taylor expanded in x around 0 21.7%
Final simplification33.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 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.2%
associate-+l+91.2%
sub-neg91.2%
sub-neg91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
Simplified91.2%
Taylor expanded in t around inf 11.9%
associate--l+24.2%
+-commutative24.2%
Simplified24.2%
Taylor expanded in x around inf 17.3%
mul-1-neg17.3%
Simplified17.3%
Taylor expanded in x around 0 15.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return -sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return -Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return -math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(-sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = -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[Sqrt[x], $MachinePrecision])
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
-\sqrt{x}
\end{array}
Initial program 91.2%
associate-+l+91.2%
sub-neg91.2%
sub-neg91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
Simplified91.2%
Taylor expanded in t around inf 11.9%
associate--l+24.2%
+-commutative24.2%
Simplified24.2%
Taylor expanded in x around inf 17.3%
mul-1-neg17.3%
Simplified17.3%
Taylor expanded in x around 0 15.9%
Taylor expanded in x around inf 1.6%
neg-mul-11.6%
Simplified1.6%
(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 2024137
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ (/ 1 (+ (sqrt (+ x 1)) (sqrt x))) (/ 1 (+ (sqrt (+ y 1)) (sqrt y)))) (/ 1 (+ (sqrt (+ z 1)) (sqrt z)))) (- (sqrt (+ t 1)) (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))))