
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ t 1.0)))
(t_2 (sqrt (+ x 1.0)))
(t_3 (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(t_4 (- t_2 (sqrt x)))
(t_5 (sqrt (+ z 1.0))))
(if (<= t_4 0.02)
(+ (+ (- t_1 (- (sqrt t) (- t_5 (sqrt z)))) t_3) (/ 1.0 (+ (sqrt x) t_2)))
(+ (+ (/ 1.0 (+ t_5 (sqrt z))) (- t_1 (sqrt t))) (+ t_4 t_3)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((t + 1.0));
double t_2 = sqrt((x + 1.0));
double t_3 = 1.0 / (sqrt((y + 1.0)) + sqrt(y));
double t_4 = t_2 - sqrt(x);
double t_5 = sqrt((z + 1.0));
double tmp;
if (t_4 <= 0.02) {
tmp = ((t_1 - (sqrt(t) - (t_5 - sqrt(z)))) + t_3) + (1.0 / (sqrt(x) + t_2));
} else {
tmp = ((1.0 / (t_5 + sqrt(z))) + (t_1 - sqrt(t))) + (t_4 + t_3);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = sqrt((t + 1.0d0))
t_2 = sqrt((x + 1.0d0))
t_3 = 1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y))
t_4 = t_2 - sqrt(x)
t_5 = sqrt((z + 1.0d0))
if (t_4 <= 0.02d0) then
tmp = ((t_1 - (sqrt(t) - (t_5 - sqrt(z)))) + t_3) + (1.0d0 / (sqrt(x) + t_2))
else
tmp = ((1.0d0 / (t_5 + sqrt(z))) + (t_1 - sqrt(t))) + (t_4 + t_3)
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((t + 1.0));
double t_2 = Math.sqrt((x + 1.0));
double t_3 = 1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y));
double t_4 = t_2 - Math.sqrt(x);
double t_5 = Math.sqrt((z + 1.0));
double tmp;
if (t_4 <= 0.02) {
tmp = ((t_1 - (Math.sqrt(t) - (t_5 - Math.sqrt(z)))) + t_3) + (1.0 / (Math.sqrt(x) + t_2));
} else {
tmp = ((1.0 / (t_5 + Math.sqrt(z))) + (t_1 - Math.sqrt(t))) + (t_4 + t_3);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((t + 1.0)) t_2 = math.sqrt((x + 1.0)) t_3 = 1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)) t_4 = t_2 - math.sqrt(x) t_5 = math.sqrt((z + 1.0)) tmp = 0 if t_4 <= 0.02: tmp = ((t_1 - (math.sqrt(t) - (t_5 - math.sqrt(z)))) + t_3) + (1.0 / (math.sqrt(x) + t_2)) else: tmp = ((1.0 / (t_5 + math.sqrt(z))) + (t_1 - math.sqrt(t))) + (t_4 + t_3) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(t + 1.0)) t_2 = sqrt(Float64(x + 1.0)) t_3 = Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y))) t_4 = Float64(t_2 - sqrt(x)) t_5 = sqrt(Float64(z + 1.0)) tmp = 0.0 if (t_4 <= 0.02) tmp = Float64(Float64(Float64(t_1 - Float64(sqrt(t) - Float64(t_5 - sqrt(z)))) + t_3) + Float64(1.0 / Float64(sqrt(x) + t_2))); else tmp = Float64(Float64(Float64(1.0 / Float64(t_5 + sqrt(z))) + Float64(t_1 - sqrt(t))) + Float64(t_4 + t_3)); 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((t + 1.0));
t_2 = sqrt((x + 1.0));
t_3 = 1.0 / (sqrt((y + 1.0)) + sqrt(y));
t_4 = t_2 - sqrt(x);
t_5 = sqrt((z + 1.0));
tmp = 0.0;
if (t_4 <= 0.02)
tmp = ((t_1 - (sqrt(t) - (t_5 - sqrt(z)))) + t_3) + (1.0 / (sqrt(x) + t_2));
else
tmp = ((1.0 / (t_5 + sqrt(z))) + (t_1 - sqrt(t))) + (t_4 + t_3);
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[(t + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 0.02], N[(N[(N[(t$95$1 - N[(N[Sqrt[t], $MachinePrecision] - N[(t$95$5 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(t$95$5 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 + t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{t + 1}\\
t_2 := \sqrt{x + 1}\\
t_3 := \frac{1}{\sqrt{y + 1} + \sqrt{y}}\\
t_4 := t\_2 - \sqrt{x}\\
t_5 := \sqrt{z + 1}\\
\mathbf{if}\;t\_4 \leq 0.02:\\
\;\;\;\;\left(\left(t\_1 - \left(\sqrt{t} - \left(t\_5 - \sqrt{z}\right)\right)\right) + t\_3\right) + \frac{1}{\sqrt{x} + t\_2}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t\_5 + \sqrt{z}} + \left(t\_1 - \sqrt{t}\right)\right) + \left(t\_4 + t\_3\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) < 0.0200000000000000004Initial program 80.2%
associate-+l+80.2%
associate-+l+80.2%
+-commutative80.2%
+-commutative80.2%
associate-+l-66.2%
+-commutative66.2%
+-commutative66.2%
Simplified66.2%
flip--66.2%
add-sqr-sqrt36.9%
+-commutative36.9%
add-sqr-sqrt66.8%
+-commutative66.8%
Applied egg-rr66.8%
associate--l+71.4%
+-inverses71.4%
metadata-eval71.4%
Simplified71.4%
flip--71.9%
add-sqr-sqrt58.6%
add-sqr-sqrt72.0%
Applied egg-rr72.0%
associate--l+75.0%
+-inverses75.0%
metadata-eval75.0%
Simplified75.0%
if 0.0200000000000000004 < (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) Initial program 96.4%
associate-+l+96.4%
sub-neg96.4%
sub-neg96.4%
+-commutative96.4%
+-commutative96.4%
+-commutative96.4%
Simplified96.4%
flip--96.5%
add-sqr-sqrt72.4%
add-sqr-sqrt96.7%
Applied egg-rr96.7%
associate--l+97.1%
+-inverses97.1%
metadata-eval97.1%
Simplified97.1%
flip--82.0%
add-sqr-sqrt58.8%
add-sqr-sqrt82.0%
Applied egg-rr97.3%
associate--l+82.4%
+-inverses82.4%
metadata-eval82.4%
Simplified98.3%
Final simplification85.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0)))
(t_2 (- t_1 (sqrt y)))
(t_3 (sqrt (+ z 1.0)))
(t_4 (- t_3 (sqrt z)))
(t_5 (sqrt (+ x 1.0)))
(t_6 (- t_5 (sqrt x)))
(t_7 (+ t_4 (+ t_6 t_2))))
(if (<= t_7 1e-6)
(/ 1.0 (+ (sqrt x) t_5))
(if (<= t_7 2.5)
(+ t_6 (+ (/ 1.0 (+ t_3 (sqrt z))) (/ 1.0 (+ t_1 (sqrt y)))))
(+ (+ t_2 1.0) (+ t_4 (/ 1.0 (+ (sqrt (+ t 1.0)) (sqrt t)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double t_2 = t_1 - sqrt(y);
double t_3 = sqrt((z + 1.0));
double t_4 = t_3 - sqrt(z);
double t_5 = sqrt((x + 1.0));
double t_6 = t_5 - sqrt(x);
double t_7 = t_4 + (t_6 + t_2);
double tmp;
if (t_7 <= 1e-6) {
tmp = 1.0 / (sqrt(x) + t_5);
} else if (t_7 <= 2.5) {
tmp = t_6 + ((1.0 / (t_3 + sqrt(z))) + (1.0 / (t_1 + sqrt(y))));
} else {
tmp = (t_2 + 1.0) + (t_4 + (1.0 / (sqrt((t + 1.0)) + sqrt(t))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
t_2 = t_1 - sqrt(y)
t_3 = sqrt((z + 1.0d0))
t_4 = t_3 - sqrt(z)
t_5 = sqrt((x + 1.0d0))
t_6 = t_5 - sqrt(x)
t_7 = t_4 + (t_6 + t_2)
if (t_7 <= 1d-6) then
tmp = 1.0d0 / (sqrt(x) + t_5)
else if (t_7 <= 2.5d0) then
tmp = t_6 + ((1.0d0 / (t_3 + sqrt(z))) + (1.0d0 / (t_1 + sqrt(y))))
else
tmp = (t_2 + 1.0d0) + (t_4 + (1.0d0 / (sqrt((t + 1.0d0)) + sqrt(t))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double t_2 = t_1 - Math.sqrt(y);
double t_3 = Math.sqrt((z + 1.0));
double t_4 = t_3 - Math.sqrt(z);
double t_5 = Math.sqrt((x + 1.0));
double t_6 = t_5 - Math.sqrt(x);
double t_7 = t_4 + (t_6 + t_2);
double tmp;
if (t_7 <= 1e-6) {
tmp = 1.0 / (Math.sqrt(x) + t_5);
} else if (t_7 <= 2.5) {
tmp = t_6 + ((1.0 / (t_3 + Math.sqrt(z))) + (1.0 / (t_1 + Math.sqrt(y))));
} else {
tmp = (t_2 + 1.0) + (t_4 + (1.0 / (Math.sqrt((t + 1.0)) + Math.sqrt(t))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) t_2 = t_1 - math.sqrt(y) t_3 = math.sqrt((z + 1.0)) t_4 = t_3 - math.sqrt(z) t_5 = math.sqrt((x + 1.0)) t_6 = t_5 - math.sqrt(x) t_7 = t_4 + (t_6 + t_2) tmp = 0 if t_7 <= 1e-6: tmp = 1.0 / (math.sqrt(x) + t_5) elif t_7 <= 2.5: tmp = t_6 + ((1.0 / (t_3 + math.sqrt(z))) + (1.0 / (t_1 + math.sqrt(y)))) else: tmp = (t_2 + 1.0) + (t_4 + (1.0 / (math.sqrt((t + 1.0)) + math.sqrt(t)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) t_2 = Float64(t_1 - sqrt(y)) t_3 = sqrt(Float64(z + 1.0)) t_4 = Float64(t_3 - sqrt(z)) t_5 = sqrt(Float64(x + 1.0)) t_6 = Float64(t_5 - sqrt(x)) t_7 = Float64(t_4 + Float64(t_6 + t_2)) tmp = 0.0 if (t_7 <= 1e-6) tmp = Float64(1.0 / Float64(sqrt(x) + t_5)); elseif (t_7 <= 2.5) tmp = Float64(t_6 + Float64(Float64(1.0 / Float64(t_3 + sqrt(z))) + Float64(1.0 / Float64(t_1 + sqrt(y))))); else tmp = Float64(Float64(t_2 + 1.0) + Float64(t_4 + Float64(1.0 / Float64(sqrt(Float64(t + 1.0)) + sqrt(t))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
t_2 = t_1 - sqrt(y);
t_3 = sqrt((z + 1.0));
t_4 = t_3 - sqrt(z);
t_5 = sqrt((x + 1.0));
t_6 = t_5 - sqrt(x);
t_7 = t_4 + (t_6 + t_2);
tmp = 0.0;
if (t_7 <= 1e-6)
tmp = 1.0 / (sqrt(x) + t_5);
elseif (t_7 <= 2.5)
tmp = t_6 + ((1.0 / (t_3 + sqrt(z))) + (1.0 / (t_1 + sqrt(y))));
else
tmp = (t_2 + 1.0) + (t_4 + (1.0 / (sqrt((t + 1.0)) + sqrt(t))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$4 + N[(t$95$6 + t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$7, 1e-6], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$7, 2.5], N[(t$95$6 + N[(N[(1.0 / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 + 1.0), $MachinePrecision] + N[(t$95$4 + N[(1.0 / N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
t_2 := t\_1 - \sqrt{y}\\
t_3 := \sqrt{z + 1}\\
t_4 := t\_3 - \sqrt{z}\\
t_5 := \sqrt{x + 1}\\
t_6 := t\_5 - \sqrt{x}\\
t_7 := t\_4 + \left(t\_6 + t\_2\right)\\
\mathbf{if}\;t\_7 \leq 10^{-6}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_5}\\
\mathbf{elif}\;t\_7 \leq 2.5:\\
\;\;\;\;t\_6 + \left(\frac{1}{t\_3 + \sqrt{z}} + \frac{1}{t\_1 + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 + 1\right) + \left(t\_4 + \frac{1}{\sqrt{t + 1} + \sqrt{t}}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))) < 9.99999999999999955e-7Initial program 44.1%
+-commutative44.1%
associate-+r+44.1%
associate-+r-44.1%
associate-+l-9.9%
associate-+r-9.9%
Simplified9.9%
Taylor expanded in t around inf 3.3%
associate--l+5.6%
+-commutative5.6%
associate--l+5.3%
+-commutative5.3%
associate-+r+5.2%
Simplified5.2%
Taylor expanded in z around inf 4.8%
+-commutative4.8%
Simplified4.8%
Taylor expanded in y around inf 3.3%
flip--3.3%
add-sqr-sqrt3.9%
add-sqr-sqrt3.3%
+-commutative3.3%
+-commutative3.3%
+-commutative3.3%
Applied egg-rr3.3%
associate--l+19.3%
+-inverses19.3%
metadata-eval19.3%
Simplified19.3%
if 9.99999999999999955e-7 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))) < 2.5Initial program 95.4%
associate-+l+95.4%
sub-neg95.4%
sub-neg95.4%
+-commutative95.4%
+-commutative95.4%
+-commutative95.4%
Simplified95.4%
flip--95.8%
add-sqr-sqrt74.5%
add-sqr-sqrt96.2%
Applied egg-rr96.2%
associate--l+96.7%
+-inverses96.7%
metadata-eval96.7%
Simplified96.7%
flip--81.5%
add-sqr-sqrt63.9%
add-sqr-sqrt81.6%
Applied egg-rr96.9%
associate--l+81.9%
+-inverses81.9%
metadata-eval81.9%
Simplified97.7%
Taylor expanded in t around inf 29.5%
sub-neg29.5%
+-commutative29.5%
+-commutative29.5%
associate-+l+53.0%
+-commutative53.0%
sub-neg53.0%
Simplified53.0%
if 2.5 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))) Initial program 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 93.9%
flip--93.8%
add-sqr-sqrt75.7%
+-commutative75.7%
add-sqr-sqrt96.0%
+-commutative96.0%
Applied egg-rr96.0%
+-commutative96.0%
associate--l+96.5%
+-inverses96.5%
metadata-eval96.5%
+-commutative96.5%
+-commutative96.5%
Simplified96.5%
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 (+ x 1.0))) (t_2 (- t_1 (sqrt x))))
(if (<= t_2 1e-6)
(/ 1.0 (+ (sqrt x) t_1))
(+
(+ (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ t_2 (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double t_2 = t_1 - sqrt(x);
double tmp;
if (t_2 <= 1e-6) {
tmp = 1.0 / (sqrt(x) + t_1);
} else {
tmp = ((1.0 / (sqrt((z + 1.0)) + sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t))) + (t_2 + (1.0 / (sqrt((y + 1.0)) + sqrt(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((x + 1.0d0))
t_2 = t_1 - sqrt(x)
if (t_2 <= 1d-6) then
tmp = 1.0d0 / (sqrt(x) + t_1)
else
tmp = ((1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))) + (t_2 + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(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((x + 1.0));
double t_2 = t_1 - Math.sqrt(x);
double tmp;
if (t_2 <= 1e-6) {
tmp = 1.0 / (Math.sqrt(x) + t_1);
} else {
tmp = ((1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t))) + (t_2 + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) t_2 = t_1 - math.sqrt(x) tmp = 0 if t_2 <= 1e-6: tmp = 1.0 / (math.sqrt(x) + t_1) else: tmp = ((1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))) + (t_2 + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) t_2 = Float64(t_1 - sqrt(x)) tmp = 0.0 if (t_2 <= 1e-6) tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) + Float64(t_2 + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(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((x + 1.0));
t_2 = t_1 - sqrt(x);
tmp = 0.0;
if (t_2 <= 1e-6)
tmp = 1.0 / (sqrt(x) + t_1);
else
tmp = ((1.0 / (sqrt((z + 1.0)) + sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t))) + (t_2 + (1.0 / (sqrt((y + 1.0)) + sqrt(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[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 1e-6], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / 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] + N[(t$95$2 + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
t_2 := t\_1 - \sqrt{x}\\
\mathbf{if}\;t\_2 \leq 10^{-6}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{z + 1} + \sqrt{z}} + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) + \left(t\_2 + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) < 9.99999999999999955e-7Initial program 80.1%
+-commutative80.1%
associate-+r+80.1%
associate-+r-80.1%
associate-+l-60.6%
associate-+r-53.1%
Simplified53.1%
Taylor expanded in t around inf 3.3%
associate--l+4.5%
+-commutative4.5%
associate--l+4.4%
+-commutative4.4%
associate-+r+4.4%
Simplified4.4%
Taylor expanded in z around inf 4.1%
+-commutative4.1%
Simplified4.1%
Taylor expanded in y around inf 3.2%
flip--3.2%
add-sqr-sqrt3.9%
add-sqr-sqrt3.2%
+-commutative3.2%
+-commutative3.2%
+-commutative3.2%
Applied egg-rr3.2%
associate--l+10.2%
+-inverses10.2%
metadata-eval10.2%
Simplified10.2%
if 9.99999999999999955e-7 < (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) Initial program 95.7%
associate-+l+95.7%
sub-neg95.7%
sub-neg95.7%
+-commutative95.7%
+-commutative95.7%
+-commutative95.7%
Simplified95.7%
flip--95.8%
add-sqr-sqrt73.1%
add-sqr-sqrt96.0%
Applied egg-rr96.0%
associate--l+96.4%
+-inverses96.4%
metadata-eval96.4%
Simplified96.4%
flip--80.4%
add-sqr-sqrt58.4%
add-sqr-sqrt80.4%
Applied egg-rr96.6%
associate--l+80.7%
+-inverses80.7%
metadata-eval80.7%
Simplified97.4%
Final simplification53.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 (+ t 1.0)) (sqrt t)))
(t_2 (- (sqrt (+ y 1.0)) (sqrt y))))
(if (<= z 5e+42)
(+ (+ (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))) t_1) (+ t_2 1.0))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) (+ t_1 t_2)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((t + 1.0)) - sqrt(t);
double t_2 = sqrt((y + 1.0)) - sqrt(y);
double tmp;
if (z <= 5e+42) {
tmp = ((1.0 / (sqrt((z + 1.0)) + sqrt(z))) + t_1) + (t_2 + 1.0);
} else {
tmp = (1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (t_1 + 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((t + 1.0d0)) - sqrt(t)
t_2 = sqrt((y + 1.0d0)) - sqrt(y)
if (z <= 5d+42) then
tmp = ((1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z))) + t_1) + (t_2 + 1.0d0)
else
tmp = (1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + (t_1 + 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((t + 1.0)) - Math.sqrt(t);
double t_2 = Math.sqrt((y + 1.0)) - Math.sqrt(y);
double tmp;
if (z <= 5e+42) {
tmp = ((1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z))) + t_1) + (t_2 + 1.0);
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + (t_1 + t_2);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((t + 1.0)) - math.sqrt(t) t_2 = math.sqrt((y + 1.0)) - math.sqrt(y) tmp = 0 if z <= 5e+42: tmp = ((1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z))) + t_1) + (t_2 + 1.0) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + (t_1 + t_2) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(t + 1.0)) - sqrt(t)) t_2 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) tmp = 0.0 if (z <= 5e+42) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z))) + t_1) + Float64(t_2 + 1.0)); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + Float64(t_1 + 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((t + 1.0)) - sqrt(t);
t_2 = sqrt((y + 1.0)) - sqrt(y);
tmp = 0.0;
if (z <= 5e+42)
tmp = ((1.0 / (sqrt((z + 1.0)) + sqrt(z))) + t_1) + (t_2 + 1.0);
else
tmp = (1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (t_1 + 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[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 5e+42], N[(N[(N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(t$95$2 + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{t + 1} - \sqrt{t}\\
t_2 := \sqrt{y + 1} - \sqrt{y}\\
\mathbf{if}\;z \leq 5 \cdot 10^{+42}:\\
\;\;\;\;\left(\frac{1}{\sqrt{z + 1} + \sqrt{z}} + t\_1\right) + \left(t\_2 + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}} + \left(t\_1 + t\_2\right)\\
\end{array}
\end{array}
if z < 5.00000000000000007e42Initial program 91.1%
associate-+l+91.1%
sub-neg91.1%
sub-neg91.1%
+-commutative91.1%
+-commutative91.1%
+-commutative91.1%
Simplified91.1%
Taylor expanded in x around 0 51.4%
flip--91.7%
add-sqr-sqrt89.7%
add-sqr-sqrt92.1%
Applied egg-rr51.6%
associate--l+95.1%
+-inverses95.1%
metadata-eval95.1%
Simplified52.0%
if 5.00000000000000007e42 < z Initial program 83.8%
associate-+l+83.8%
associate-+l+83.8%
+-commutative83.8%
+-commutative83.8%
associate-+l-83.8%
+-commutative83.8%
+-commutative83.8%
Simplified83.8%
flip--83.8%
add-sqr-sqrt67.0%
+-commutative67.0%
add-sqr-sqrt83.8%
+-commutative83.8%
Applied egg-rr83.8%
associate--l+88.9%
+-inverses88.9%
metadata-eval88.9%
Simplified88.9%
Taylor expanded in z around inf 88.9%
Final simplification68.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 (+ t 1.0)) (sqrt t))))
(if (<= y 4.3e-6)
(+
(+ (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))) t_1)
(+ (- (+ (* y 0.5) 1.0) (sqrt y)) 1.0))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0))))
(+ t_1 (- (sqrt (+ y 1.0)) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((t + 1.0)) - sqrt(t);
double tmp;
if (y <= 4.3e-6) {
tmp = ((1.0 / (sqrt((z + 1.0)) + sqrt(z))) + t_1) + ((((y * 0.5) + 1.0) - sqrt(y)) + 1.0);
} else {
tmp = (1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (t_1 + (sqrt((y + 1.0)) - sqrt(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) :: tmp
t_1 = sqrt((t + 1.0d0)) - sqrt(t)
if (y <= 4.3d-6) then
tmp = ((1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z))) + t_1) + ((((y * 0.5d0) + 1.0d0) - sqrt(y)) + 1.0d0)
else
tmp = (1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + (t_1 + (sqrt((y + 1.0d0)) - sqrt(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((t + 1.0)) - Math.sqrt(t);
double tmp;
if (y <= 4.3e-6) {
tmp = ((1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z))) + t_1) + ((((y * 0.5) + 1.0) - Math.sqrt(y)) + 1.0);
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + (t_1 + (Math.sqrt((y + 1.0)) - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((t + 1.0)) - math.sqrt(t) tmp = 0 if y <= 4.3e-6: tmp = ((1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z))) + t_1) + ((((y * 0.5) + 1.0) - math.sqrt(y)) + 1.0) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + (t_1 + (math.sqrt((y + 1.0)) - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(t + 1.0)) - sqrt(t)) tmp = 0.0 if (y <= 4.3e-6) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z))) + t_1) + Float64(Float64(Float64(Float64(y * 0.5) + 1.0) - sqrt(y)) + 1.0)); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + Float64(t_1 + Float64(sqrt(Float64(y + 1.0)) - sqrt(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((t + 1.0)) - sqrt(t);
tmp = 0.0;
if (y <= 4.3e-6)
tmp = ((1.0 / (sqrt((z + 1.0)) + sqrt(z))) + t_1) + ((((y * 0.5) + 1.0) - sqrt(y)) + 1.0);
else
tmp = (1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (t_1 + (sqrt((y + 1.0)) - sqrt(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[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4.3e-6], N[(N[(N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(N[(N[(y * 0.5), $MachinePrecision] + 1.0), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{t + 1} - \sqrt{t}\\
\mathbf{if}\;y \leq 4.3 \cdot 10^{-6}:\\
\;\;\;\;\left(\frac{1}{\sqrt{z + 1} + \sqrt{z}} + t\_1\right) + \left(\left(\left(y \cdot 0.5 + 1\right) - \sqrt{y}\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}} + \left(t\_1 + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if y < 4.30000000000000033e-6Initial program 96.0%
associate-+l+96.0%
sub-neg96.0%
sub-neg96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in x around 0 55.8%
flip--96.6%
add-sqr-sqrt75.0%
add-sqr-sqrt97.0%
Applied egg-rr55.9%
associate--l+97.6%
+-inverses97.6%
metadata-eval97.6%
Simplified56.1%
Taylor expanded in y around 0 56.1%
*-commutative56.1%
Simplified56.1%
if 4.30000000000000033e-6 < y Initial program 79.3%
associate-+l+79.3%
associate-+l+79.3%
+-commutative79.3%
+-commutative79.3%
associate-+l-65.1%
+-commutative65.1%
+-commutative65.1%
Simplified65.1%
flip--65.0%
add-sqr-sqrt54.4%
+-commutative54.4%
add-sqr-sqrt65.1%
+-commutative65.1%
Applied egg-rr65.1%
associate--l+69.9%
+-inverses69.9%
metadata-eval69.9%
Simplified69.9%
Taylor expanded in z around inf 49.5%
Final simplification52.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))))
(if (<= y 4.3e-6)
(+
(+ (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (- (+ (* y 0.5) 1.0) (sqrt y)) 1.0))
(if (<= y 4.6e+24)
(+ t_1 (- (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))) (sqrt x)))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (y <= 4.3e-6) {
tmp = ((1.0 / (sqrt((z + 1.0)) + sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t))) + ((((y * 0.5) + 1.0) - sqrt(y)) + 1.0);
} else if (y <= 4.6e+24) {
tmp = t_1 + ((1.0 / (sqrt((y + 1.0)) + sqrt(y))) - sqrt(x));
} else {
tmp = 1.0 / (sqrt(x) + 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((x + 1.0d0))
if (y <= 4.3d-6) then
tmp = ((1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))) + ((((y * 0.5d0) + 1.0d0) - sqrt(y)) + 1.0d0)
else if (y <= 4.6d+24) then
tmp = t_1 + ((1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y))) - sqrt(x))
else
tmp = 1.0d0 / (sqrt(x) + 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((x + 1.0));
double tmp;
if (y <= 4.3e-6) {
tmp = ((1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t))) + ((((y * 0.5) + 1.0) - Math.sqrt(y)) + 1.0);
} else if (y <= 4.6e+24) {
tmp = t_1 + ((1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y))) - Math.sqrt(x));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 4.3e-6: tmp = ((1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))) + ((((y * 0.5) + 1.0) - math.sqrt(y)) + 1.0) elif y <= 4.6e+24: tmp = t_1 + ((1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y))) - math.sqrt(x)) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 4.3e-6) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) + Float64(Float64(Float64(Float64(y * 0.5) + 1.0) - sqrt(y)) + 1.0)); elseif (y <= 4.6e+24) tmp = Float64(t_1 + Float64(Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y))) - sqrt(x))); else tmp = Float64(1.0 / Float64(sqrt(x) + 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((x + 1.0));
tmp = 0.0;
if (y <= 4.3e-6)
tmp = ((1.0 / (sqrt((z + 1.0)) + sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t))) + ((((y * 0.5) + 1.0) - sqrt(y)) + 1.0);
elseif (y <= 4.6e+24)
tmp = t_1 + ((1.0 / (sqrt((y + 1.0)) + sqrt(y))) - sqrt(x));
else
tmp = 1.0 / (sqrt(x) + 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[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.3e-6], N[(N[(N[(1.0 / 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] + N[(N[(N[(N[(y * 0.5), $MachinePrecision] + 1.0), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e+24], N[(t$95$1 + N[(N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 4.3 \cdot 10^{-6}:\\
\;\;\;\;\left(\frac{1}{\sqrt{z + 1} + \sqrt{z}} + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) + \left(\left(\left(y \cdot 0.5 + 1\right) - \sqrt{y}\right) + 1\right)\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+24}:\\
\;\;\;\;t\_1 + \left(\frac{1}{\sqrt{y + 1} + \sqrt{y}} - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 4.30000000000000033e-6Initial program 96.0%
associate-+l+96.0%
sub-neg96.0%
sub-neg96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in x around 0 55.8%
flip--96.6%
add-sqr-sqrt75.0%
add-sqr-sqrt97.0%
Applied egg-rr55.9%
associate--l+97.6%
+-inverses97.6%
metadata-eval97.6%
Simplified56.1%
Taylor expanded in y around 0 56.1%
*-commutative56.1%
Simplified56.1%
if 4.30000000000000033e-6 < y < 4.5999999999999998e24Initial program 78.3%
associate-+l+78.3%
associate-+l+78.4%
+-commutative78.4%
+-commutative78.4%
associate-+l-61.3%
+-commutative61.3%
+-commutative61.3%
Simplified61.3%
flip--67.7%
add-sqr-sqrt58.7%
add-sqr-sqrt68.7%
Applied egg-rr68.4%
associate--l+72.6%
+-inverses72.6%
metadata-eval72.6%
Simplified72.6%
Taylor expanded in z around inf 62.1%
Taylor expanded in t around inf 21.2%
associate--l+21.2%
Simplified21.2%
if 4.5999999999999998e24 < y Initial program 79.4%
+-commutative79.4%
associate-+r+79.4%
associate-+r-43.9%
associate-+l-18.1%
associate-+r-5.6%
Simplified5.0%
Taylor expanded in t around inf 3.2%
associate--l+15.6%
+-commutative15.6%
associate--l+19.2%
+-commutative19.2%
associate-+r+19.1%
Simplified19.1%
Taylor expanded in z around inf 15.4%
+-commutative15.4%
Simplified15.4%
Taylor expanded in y around inf 15.2%
flip--15.2%
add-sqr-sqrt15.4%
add-sqr-sqrt15.2%
+-commutative15.2%
+-commutative15.2%
+-commutative15.2%
Applied egg-rr15.2%
associate--l+21.4%
+-inverses21.4%
metadata-eval21.4%
Simplified21.4%
Final simplification39.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 (+ y 1.0))) (t_2 (sqrt (+ x 1.0))))
(if (<= z 1.14e-32)
(+ (- (sqrt (+ t 1.0)) (sqrt t)) 3.0)
(if (<= z 2.9e+17)
(+ (- (+ t_1 (sqrt (+ z 1.0))) (+ (sqrt z) (sqrt y))) 1.0)
(if (or (<= z 6.5e+196) (not (<= z 3.1e+224)))
(+ (- t_2 (sqrt x)) (/ 1.0 (+ t_1 (sqrt y))))
(/ 1.0 (+ (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((y + 1.0));
double t_2 = sqrt((x + 1.0));
double tmp;
if (z <= 1.14e-32) {
tmp = (sqrt((t + 1.0)) - sqrt(t)) + 3.0;
} else if (z <= 2.9e+17) {
tmp = ((t_1 + sqrt((z + 1.0))) - (sqrt(z) + sqrt(y))) + 1.0;
} else if ((z <= 6.5e+196) || !(z <= 3.1e+224)) {
tmp = (t_2 - sqrt(x)) + (1.0 / (t_1 + sqrt(y)));
} else {
tmp = 1.0 / (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((y + 1.0d0))
t_2 = sqrt((x + 1.0d0))
if (z <= 1.14d-32) then
tmp = (sqrt((t + 1.0d0)) - sqrt(t)) + 3.0d0
else if (z <= 2.9d+17) then
tmp = ((t_1 + sqrt((z + 1.0d0))) - (sqrt(z) + sqrt(y))) + 1.0d0
else if ((z <= 6.5d+196) .or. (.not. (z <= 3.1d+224))) then
tmp = (t_2 - sqrt(x)) + (1.0d0 / (t_1 + sqrt(y)))
else
tmp = 1.0d0 / (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((y + 1.0));
double t_2 = Math.sqrt((x + 1.0));
double tmp;
if (z <= 1.14e-32) {
tmp = (Math.sqrt((t + 1.0)) - Math.sqrt(t)) + 3.0;
} else if (z <= 2.9e+17) {
tmp = ((t_1 + Math.sqrt((z + 1.0))) - (Math.sqrt(z) + Math.sqrt(y))) + 1.0;
} else if ((z <= 6.5e+196) || !(z <= 3.1e+224)) {
tmp = (t_2 - Math.sqrt(x)) + (1.0 / (t_1 + Math.sqrt(y)));
} else {
tmp = 1.0 / (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((y + 1.0)) t_2 = math.sqrt((x + 1.0)) tmp = 0 if z <= 1.14e-32: tmp = (math.sqrt((t + 1.0)) - math.sqrt(t)) + 3.0 elif z <= 2.9e+17: tmp = ((t_1 + math.sqrt((z + 1.0))) - (math.sqrt(z) + math.sqrt(y))) + 1.0 elif (z <= 6.5e+196) or not (z <= 3.1e+224): tmp = (t_2 - math.sqrt(x)) + (1.0 / (t_1 + math.sqrt(y))) else: tmp = 1.0 / (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(y + 1.0)) t_2 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (z <= 1.14e-32) tmp = Float64(Float64(sqrt(Float64(t + 1.0)) - sqrt(t)) + 3.0); elseif (z <= 2.9e+17) tmp = Float64(Float64(Float64(t_1 + sqrt(Float64(z + 1.0))) - Float64(sqrt(z) + sqrt(y))) + 1.0); elseif ((z <= 6.5e+196) || !(z <= 3.1e+224)) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(1.0 / Float64(t_1 + sqrt(y)))); else tmp = Float64(1.0 / Float64(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((y + 1.0));
t_2 = sqrt((x + 1.0));
tmp = 0.0;
if (z <= 1.14e-32)
tmp = (sqrt((t + 1.0)) - sqrt(t)) + 3.0;
elseif (z <= 2.9e+17)
tmp = ((t_1 + sqrt((z + 1.0))) - (sqrt(z) + sqrt(y))) + 1.0;
elseif ((z <= 6.5e+196) || ~((z <= 3.1e+224)))
tmp = (t_2 - sqrt(x)) + (1.0 / (t_1 + sqrt(y)));
else
tmp = 1.0 / (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[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.14e-32], N[(N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 2.9e+17], N[(N[(N[(t$95$1 + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[Or[LessEqual[z, 6.5e+196], N[Not[LessEqual[z, 3.1e+224]], $MachinePrecision]], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
t_2 := \sqrt{x + 1}\\
\mathbf{if}\;z \leq 1.14 \cdot 10^{-32}:\\
\;\;\;\;\left(\sqrt{t + 1} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+17}:\\
\;\;\;\;\left(\left(t\_1 + \sqrt{z + 1}\right) - \left(\sqrt{z} + \sqrt{y}\right)\right) + 1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+196} \lor \neg \left(z \leq 3.1 \cdot 10^{+224}\right):\\
\;\;\;\;\left(t\_2 - \sqrt{x}\right) + \frac{1}{t\_1 + \sqrt{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_2}\\
\end{array}
\end{array}
if z < 1.14000000000000005e-32Initial program 96.3%
associate-+l+96.3%
sub-neg96.3%
sub-neg96.3%
+-commutative96.3%
+-commutative96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in x around 0 52.3%
Taylor expanded in z around 0 21.9%
associate--l+56.9%
+-commutative56.9%
associate--l+49.4%
Simplified49.4%
Taylor expanded in y around 0 24.4%
associate--l+36.0%
Simplified36.0%
if 1.14000000000000005e-32 < z < 2.9e17Initial program 89.0%
+-commutative89.0%
associate-+r+89.0%
associate-+r-74.8%
associate-+l-64.1%
associate-+r-60.1%
Simplified60.0%
Taylor expanded in t around inf 31.4%
associate--l+34.6%
+-commutative34.6%
associate--l+36.8%
+-commutative36.8%
associate-+r+36.8%
Simplified36.8%
Taylor expanded in x around 0 44.4%
associate--l+49.7%
+-commutative49.7%
Simplified49.7%
if 2.9e17 < z < 6.49999999999999968e196 or 3.0999999999999999e224 < z Initial program 80.8%
associate-+l+80.8%
associate-+l+80.8%
+-commutative80.8%
+-commutative80.8%
associate-+l-80.8%
+-commutative80.8%
+-commutative80.8%
Simplified80.8%
flip--86.6%
add-sqr-sqrt61.4%
add-sqr-sqrt86.7%
Applied egg-rr81.6%
associate--l+89.3%
+-inverses89.3%
metadata-eval89.3%
Simplified84.3%
Taylor expanded in z around inf 84.3%
Taylor expanded in t around inf 39.6%
if 6.49999999999999968e196 < z < 3.0999999999999999e224Initial program 89.3%
+-commutative89.3%
associate-+r+89.3%
associate-+r-80.2%
associate-+l-78.5%
associate-+r-78.5%
Simplified51.6%
Taylor expanded in t around inf 3.1%
associate--l+10.6%
+-commutative10.6%
associate--l+10.6%
+-commutative10.6%
associate-+r+10.6%
Simplified10.6%
Taylor expanded in z around inf 28.3%
+-commutative28.3%
Simplified28.3%
Taylor expanded in y around inf 10.0%
flip--10.0%
add-sqr-sqrt9.6%
add-sqr-sqrt10.0%
+-commutative10.0%
+-commutative10.0%
+-commutative10.0%
Applied egg-rr10.0%
associate--l+11.5%
+-inverses11.5%
metadata-eval11.5%
Simplified11.5%
Final simplification38.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 (+ y 1.0))) (t_2 (sqrt (+ x 1.0))))
(if (<= z 1.55e-30)
(+ (- (sqrt (+ t 1.0)) (sqrt t)) 3.0)
(if (<= z 2.7e+17)
(- (+ (+ t_1 (sqrt (+ z 1.0))) 1.0) (+ (sqrt z) (sqrt y)))
(if (or (<= z 6.5e+196) (not (<= z 3.1e+224)))
(+ (- t_2 (sqrt x)) (/ 1.0 (+ t_1 (sqrt y))))
(/ 1.0 (+ (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((y + 1.0));
double t_2 = sqrt((x + 1.0));
double tmp;
if (z <= 1.55e-30) {
tmp = (sqrt((t + 1.0)) - sqrt(t)) + 3.0;
} else if (z <= 2.7e+17) {
tmp = ((t_1 + sqrt((z + 1.0))) + 1.0) - (sqrt(z) + sqrt(y));
} else if ((z <= 6.5e+196) || !(z <= 3.1e+224)) {
tmp = (t_2 - sqrt(x)) + (1.0 / (t_1 + sqrt(y)));
} else {
tmp = 1.0 / (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((y + 1.0d0))
t_2 = sqrt((x + 1.0d0))
if (z <= 1.55d-30) then
tmp = (sqrt((t + 1.0d0)) - sqrt(t)) + 3.0d0
else if (z <= 2.7d+17) then
tmp = ((t_1 + sqrt((z + 1.0d0))) + 1.0d0) - (sqrt(z) + sqrt(y))
else if ((z <= 6.5d+196) .or. (.not. (z <= 3.1d+224))) then
tmp = (t_2 - sqrt(x)) + (1.0d0 / (t_1 + sqrt(y)))
else
tmp = 1.0d0 / (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((y + 1.0));
double t_2 = Math.sqrt((x + 1.0));
double tmp;
if (z <= 1.55e-30) {
tmp = (Math.sqrt((t + 1.0)) - Math.sqrt(t)) + 3.0;
} else if (z <= 2.7e+17) {
tmp = ((t_1 + Math.sqrt((z + 1.0))) + 1.0) - (Math.sqrt(z) + Math.sqrt(y));
} else if ((z <= 6.5e+196) || !(z <= 3.1e+224)) {
tmp = (t_2 - Math.sqrt(x)) + (1.0 / (t_1 + Math.sqrt(y)));
} else {
tmp = 1.0 / (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((y + 1.0)) t_2 = math.sqrt((x + 1.0)) tmp = 0 if z <= 1.55e-30: tmp = (math.sqrt((t + 1.0)) - math.sqrt(t)) + 3.0 elif z <= 2.7e+17: tmp = ((t_1 + math.sqrt((z + 1.0))) + 1.0) - (math.sqrt(z) + math.sqrt(y)) elif (z <= 6.5e+196) or not (z <= 3.1e+224): tmp = (t_2 - math.sqrt(x)) + (1.0 / (t_1 + math.sqrt(y))) else: tmp = 1.0 / (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(y + 1.0)) t_2 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (z <= 1.55e-30) tmp = Float64(Float64(sqrt(Float64(t + 1.0)) - sqrt(t)) + 3.0); elseif (z <= 2.7e+17) tmp = Float64(Float64(Float64(t_1 + sqrt(Float64(z + 1.0))) + 1.0) - Float64(sqrt(z) + sqrt(y))); elseif ((z <= 6.5e+196) || !(z <= 3.1e+224)) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(1.0 / Float64(t_1 + sqrt(y)))); else tmp = Float64(1.0 / Float64(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((y + 1.0));
t_2 = sqrt((x + 1.0));
tmp = 0.0;
if (z <= 1.55e-30)
tmp = (sqrt((t + 1.0)) - sqrt(t)) + 3.0;
elseif (z <= 2.7e+17)
tmp = ((t_1 + sqrt((z + 1.0))) + 1.0) - (sqrt(z) + sqrt(y));
elseif ((z <= 6.5e+196) || ~((z <= 3.1e+224)))
tmp = (t_2 - sqrt(x)) + (1.0 / (t_1 + sqrt(y)));
else
tmp = 1.0 / (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[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.55e-30], N[(N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 2.7e+17], N[(N[(N[(t$95$1 + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 6.5e+196], N[Not[LessEqual[z, 3.1e+224]], $MachinePrecision]], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
t_2 := \sqrt{x + 1}\\
\mathbf{if}\;z \leq 1.55 \cdot 10^{-30}:\\
\;\;\;\;\left(\sqrt{t + 1} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+17}:\\
\;\;\;\;\left(\left(t\_1 + \sqrt{z + 1}\right) + 1\right) - \left(\sqrt{z} + \sqrt{y}\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+196} \lor \neg \left(z \leq 3.1 \cdot 10^{+224}\right):\\
\;\;\;\;\left(t\_2 - \sqrt{x}\right) + \frac{1}{t\_1 + \sqrt{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_2}\\
\end{array}
\end{array}
if z < 1.54999999999999995e-30Initial program 96.3%
associate-+l+96.3%
sub-neg96.3%
sub-neg96.3%
+-commutative96.3%
+-commutative96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in x around 0 52.8%
Taylor expanded in z around 0 21.7%
associate--l+56.6%
+-commutative56.6%
associate--l+49.1%
Simplified49.1%
Taylor expanded in y around 0 24.4%
associate--l+35.9%
Simplified35.9%
if 1.54999999999999995e-30 < z < 2.7e17Initial program 88.6%
+-commutative88.6%
associate-+r+88.6%
associate-+r-77.1%
associate-+l-66.0%
associate-+r-62.5%
Simplified62.4%
Taylor expanded in t around inf 32.6%
associate--l+35.3%
+-commutative35.3%
associate--l+37.5%
+-commutative37.5%
associate-+r+37.5%
Simplified37.5%
Taylor expanded in x around 0 46.1%
if 2.7e17 < z < 6.49999999999999968e196 or 3.0999999999999999e224 < z Initial program 80.8%
associate-+l+80.8%
associate-+l+80.8%
+-commutative80.8%
+-commutative80.8%
associate-+l-80.8%
+-commutative80.8%
+-commutative80.8%
Simplified80.8%
flip--86.6%
add-sqr-sqrt61.4%
add-sqr-sqrt86.7%
Applied egg-rr81.6%
associate--l+89.3%
+-inverses89.3%
metadata-eval89.3%
Simplified84.3%
Taylor expanded in z around inf 84.3%
Taylor expanded in t around inf 39.6%
if 6.49999999999999968e196 < z < 3.0999999999999999e224Initial program 89.3%
+-commutative89.3%
associate-+r+89.3%
associate-+r-80.2%
associate-+l-78.5%
associate-+r-78.5%
Simplified51.6%
Taylor expanded in t around inf 3.1%
associate--l+10.6%
+-commutative10.6%
associate--l+10.6%
+-commutative10.6%
associate-+r+10.6%
Simplified10.6%
Taylor expanded in z around inf 28.3%
+-commutative28.3%
Simplified28.3%
Taylor expanded in y around inf 10.0%
flip--10.0%
add-sqr-sqrt9.6%
add-sqr-sqrt10.0%
+-commutative10.0%
+-commutative10.0%
+-commutative10.0%
Applied egg-rr10.0%
associate--l+11.5%
+-inverses11.5%
metadata-eval11.5%
Simplified11.5%
Final simplification37.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))) (t_2 (sqrt (+ y 1.0))))
(if (<= z 1.18e-32)
(+ (- (sqrt (+ t 1.0)) (sqrt t)) 3.0)
(if (<= z 5e+17)
(+ (- (+ t_2 (sqrt (+ z 1.0))) (+ (sqrt z) (sqrt y))) 1.0)
(if (<= z 6.5e+196)
(+ t_1 (- (/ 1.0 (+ t_2 (sqrt y))) (sqrt x)))
(if (<= z 4.6e+234)
(/ 1.0 (+ (sqrt x) t_1))
(+ (- t_2 (sqrt y)) 1.0)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double t_2 = sqrt((y + 1.0));
double tmp;
if (z <= 1.18e-32) {
tmp = (sqrt((t + 1.0)) - sqrt(t)) + 3.0;
} else if (z <= 5e+17) {
tmp = ((t_2 + sqrt((z + 1.0))) - (sqrt(z) + sqrt(y))) + 1.0;
} else if (z <= 6.5e+196) {
tmp = t_1 + ((1.0 / (t_2 + sqrt(y))) - sqrt(x));
} else if (z <= 4.6e+234) {
tmp = 1.0 / (sqrt(x) + t_1);
} else {
tmp = (t_2 - sqrt(y)) + 1.0;
}
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((x + 1.0d0))
t_2 = sqrt((y + 1.0d0))
if (z <= 1.18d-32) then
tmp = (sqrt((t + 1.0d0)) - sqrt(t)) + 3.0d0
else if (z <= 5d+17) then
tmp = ((t_2 + sqrt((z + 1.0d0))) - (sqrt(z) + sqrt(y))) + 1.0d0
else if (z <= 6.5d+196) then
tmp = t_1 + ((1.0d0 / (t_2 + sqrt(y))) - sqrt(x))
else if (z <= 4.6d+234) then
tmp = 1.0d0 / (sqrt(x) + t_1)
else
tmp = (t_2 - sqrt(y)) + 1.0d0
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((x + 1.0));
double t_2 = Math.sqrt((y + 1.0));
double tmp;
if (z <= 1.18e-32) {
tmp = (Math.sqrt((t + 1.0)) - Math.sqrt(t)) + 3.0;
} else if (z <= 5e+17) {
tmp = ((t_2 + Math.sqrt((z + 1.0))) - (Math.sqrt(z) + Math.sqrt(y))) + 1.0;
} else if (z <= 6.5e+196) {
tmp = t_1 + ((1.0 / (t_2 + Math.sqrt(y))) - Math.sqrt(x));
} else if (z <= 4.6e+234) {
tmp = 1.0 / (Math.sqrt(x) + t_1);
} else {
tmp = (t_2 - Math.sqrt(y)) + 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) t_2 = math.sqrt((y + 1.0)) tmp = 0 if z <= 1.18e-32: tmp = (math.sqrt((t + 1.0)) - math.sqrt(t)) + 3.0 elif z <= 5e+17: tmp = ((t_2 + math.sqrt((z + 1.0))) - (math.sqrt(z) + math.sqrt(y))) + 1.0 elif z <= 6.5e+196: tmp = t_1 + ((1.0 / (t_2 + math.sqrt(y))) - math.sqrt(x)) elif z <= 4.6e+234: tmp = 1.0 / (math.sqrt(x) + t_1) else: tmp = (t_2 - math.sqrt(y)) + 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) t_2 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 1.18e-32) tmp = Float64(Float64(sqrt(Float64(t + 1.0)) - sqrt(t)) + 3.0); elseif (z <= 5e+17) tmp = Float64(Float64(Float64(t_2 + sqrt(Float64(z + 1.0))) - Float64(sqrt(z) + sqrt(y))) + 1.0); elseif (z <= 6.5e+196) tmp = Float64(t_1 + Float64(Float64(1.0 / Float64(t_2 + sqrt(y))) - sqrt(x))); elseif (z <= 4.6e+234) tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); else tmp = Float64(Float64(t_2 - sqrt(y)) + 1.0); 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((x + 1.0));
t_2 = sqrt((y + 1.0));
tmp = 0.0;
if (z <= 1.18e-32)
tmp = (sqrt((t + 1.0)) - sqrt(t)) + 3.0;
elseif (z <= 5e+17)
tmp = ((t_2 + sqrt((z + 1.0))) - (sqrt(z) + sqrt(y))) + 1.0;
elseif (z <= 6.5e+196)
tmp = t_1 + ((1.0 / (t_2 + sqrt(y))) - sqrt(x));
elseif (z <= 4.6e+234)
tmp = 1.0 / (sqrt(x) + t_1);
else
tmp = (t_2 - sqrt(y)) + 1.0;
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[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.18e-32], N[(N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 5e+17], N[(N[(N[(t$95$2 + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[z, 6.5e+196], N[(t$95$1 + N[(N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.6e+234], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
t_2 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 1.18 \cdot 10^{-32}:\\
\;\;\;\;\left(\sqrt{t + 1} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+17}:\\
\;\;\;\;\left(\left(t\_2 + \sqrt{z + 1}\right) - \left(\sqrt{z} + \sqrt{y}\right)\right) + 1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+196}:\\
\;\;\;\;t\_1 + \left(\frac{1}{t\_2 + \sqrt{y}} - \sqrt{x}\right)\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+234}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 - \sqrt{y}\right) + 1\\
\end{array}
\end{array}
if z < 1.17999999999999997e-32Initial program 96.3%
associate-+l+96.3%
sub-neg96.3%
sub-neg96.3%
+-commutative96.3%
+-commutative96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in x around 0 52.3%
Taylor expanded in z around 0 21.9%
associate--l+56.9%
+-commutative56.9%
associate--l+49.4%
Simplified49.4%
Taylor expanded in y around 0 24.4%
associate--l+36.0%
Simplified36.0%
if 1.17999999999999997e-32 < z < 5e17Initial program 89.0%
+-commutative89.0%
associate-+r+89.0%
associate-+r-74.8%
associate-+l-64.1%
associate-+r-60.1%
Simplified60.0%
Taylor expanded in t around inf 31.4%
associate--l+34.6%
+-commutative34.6%
associate--l+36.8%
+-commutative36.8%
associate-+r+36.8%
Simplified36.8%
Taylor expanded in x around 0 44.4%
associate--l+49.7%
+-commutative49.7%
Simplified49.7%
if 5e17 < z < 6.49999999999999968e196Initial program 78.0%
associate-+l+78.0%
associate-+l+78.0%
+-commutative78.0%
+-commutative78.0%
associate-+l-78.0%
+-commutative78.0%
+-commutative78.0%
Simplified78.0%
flip--83.0%
add-sqr-sqrt61.6%
add-sqr-sqrt83.2%
Applied egg-rr79.0%
associate--l+85.9%
+-inverses85.9%
metadata-eval85.9%
Simplified81.5%
Taylor expanded in z around inf 81.5%
Taylor expanded in t around inf 26.1%
associate--l+26.1%
Simplified26.1%
if 6.49999999999999968e196 < z < 4.6000000000000002e234Initial program 93.1%
+-commutative93.1%
associate-+r+93.1%
associate-+r-87.3%
associate-+l-72.3%
associate-+r-72.3%
Simplified43.6%
Taylor expanded in t around inf 3.1%
associate--l+11.2%
+-commutative11.2%
associate--l+11.2%
+-commutative11.2%
associate-+r+11.2%
Simplified11.2%
Taylor expanded in z around inf 22.2%
+-commutative22.2%
Simplified22.2%
Taylor expanded in y around inf 9.6%
flip--9.6%
add-sqr-sqrt10.3%
add-sqr-sqrt9.6%
+-commutative9.6%
+-commutative9.6%
+-commutative9.6%
Applied egg-rr9.6%
associate--l+11.8%
+-inverses11.8%
metadata-eval11.8%
Simplified11.8%
if 4.6000000000000002e234 < z Initial program 84.1%
+-commutative84.1%
associate-+r+84.1%
associate-+r-68.3%
associate-+l-49.4%
associate-+r-49.4%
Simplified25.0%
Taylor expanded in t around inf 3.2%
associate--l+18.3%
+-commutative18.3%
associate--l+18.3%
+-commutative18.3%
associate-+r+18.3%
Simplified18.3%
Taylor expanded in z around inf 26.5%
+-commutative26.5%
Simplified26.5%
Taylor expanded in x around 0 23.2%
associate--l+50.4%
Simplified50.4%
Final simplification35.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))))
(if (<= z 1.14e-32)
(+ (- (sqrt (+ t 1.0)) (sqrt t)) 3.0)
(if (<= z 2.9e+17)
(+ (- (+ t_1 (sqrt (+ z 1.0))) (+ (sqrt z) (sqrt y))) 1.0)
(if (or (<= z 6.5e+196) (not (<= z 4.6e+234)))
(+ (- t_1 (sqrt y)) 1.0)
(/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double tmp;
if (z <= 1.14e-32) {
tmp = (sqrt((t + 1.0)) - sqrt(t)) + 3.0;
} else if (z <= 2.9e+17) {
tmp = ((t_1 + sqrt((z + 1.0))) - (sqrt(z) + sqrt(y))) + 1.0;
} else if ((z <= 6.5e+196) || !(z <= 4.6e+234)) {
tmp = (t_1 - sqrt(y)) + 1.0;
} else {
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
if (z <= 1.14d-32) then
tmp = (sqrt((t + 1.0d0)) - sqrt(t)) + 3.0d0
else if (z <= 2.9d+17) then
tmp = ((t_1 + sqrt((z + 1.0d0))) - (sqrt(z) + sqrt(y))) + 1.0d0
else if ((z <= 6.5d+196) .or. (.not. (z <= 4.6d+234))) then
tmp = (t_1 - sqrt(y)) + 1.0d0
else
tmp = 1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double tmp;
if (z <= 1.14e-32) {
tmp = (Math.sqrt((t + 1.0)) - Math.sqrt(t)) + 3.0;
} else if (z <= 2.9e+17) {
tmp = ((t_1 + Math.sqrt((z + 1.0))) - (Math.sqrt(z) + Math.sqrt(y))) + 1.0;
} else if ((z <= 6.5e+196) || !(z <= 4.6e+234)) {
tmp = (t_1 - Math.sqrt(y)) + 1.0;
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if z <= 1.14e-32: tmp = (math.sqrt((t + 1.0)) - math.sqrt(t)) + 3.0 elif z <= 2.9e+17: tmp = ((t_1 + math.sqrt((z + 1.0))) - (math.sqrt(z) + math.sqrt(y))) + 1.0 elif (z <= 6.5e+196) or not (z <= 4.6e+234): tmp = (t_1 - math.sqrt(y)) + 1.0 else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((x + 1.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 1.14e-32) tmp = Float64(Float64(sqrt(Float64(t + 1.0)) - sqrt(t)) + 3.0); elseif (z <= 2.9e+17) tmp = Float64(Float64(Float64(t_1 + sqrt(Float64(z + 1.0))) - Float64(sqrt(z) + sqrt(y))) + 1.0); elseif ((z <= 6.5e+196) || !(z <= 4.6e+234)) tmp = Float64(Float64(t_1 - sqrt(y)) + 1.0); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
tmp = 0.0;
if (z <= 1.14e-32)
tmp = (sqrt((t + 1.0)) - sqrt(t)) + 3.0;
elseif (z <= 2.9e+17)
tmp = ((t_1 + sqrt((z + 1.0))) - (sqrt(z) + sqrt(y))) + 1.0;
elseif ((z <= 6.5e+196) || ~((z <= 4.6e+234)))
tmp = (t_1 - sqrt(y)) + 1.0;
else
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.14e-32], N[(N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 2.9e+17], N[(N[(N[(t$95$1 + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[Or[LessEqual[z, 6.5e+196], N[Not[LessEqual[z, 4.6e+234]], $MachinePrecision]], N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 1.14 \cdot 10^{-32}:\\
\;\;\;\;\left(\sqrt{t + 1} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+17}:\\
\;\;\;\;\left(\left(t\_1 + \sqrt{z + 1}\right) - \left(\sqrt{z} + \sqrt{y}\right)\right) + 1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+196} \lor \neg \left(z \leq 4.6 \cdot 10^{+234}\right):\\
\;\;\;\;\left(t\_1 - \sqrt{y}\right) + 1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if z < 1.14000000000000005e-32Initial program 96.3%
associate-+l+96.3%
sub-neg96.3%
sub-neg96.3%
+-commutative96.3%
+-commutative96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in x around 0 52.3%
Taylor expanded in z around 0 21.9%
associate--l+56.9%
+-commutative56.9%
associate--l+49.4%
Simplified49.4%
Taylor expanded in y around 0 24.4%
associate--l+36.0%
Simplified36.0%
if 1.14000000000000005e-32 < z < 2.9e17Initial program 89.0%
+-commutative89.0%
associate-+r+89.0%
associate-+r-74.8%
associate-+l-64.1%
associate-+r-60.1%
Simplified60.0%
Taylor expanded in t around inf 31.4%
associate--l+34.6%
+-commutative34.6%
associate--l+36.8%
+-commutative36.8%
associate-+r+36.8%
Simplified36.8%
Taylor expanded in x around 0 44.4%
associate--l+49.7%
+-commutative49.7%
Simplified49.7%
if 2.9e17 < z < 6.49999999999999968e196 or 4.6000000000000002e234 < z Initial program 80.0%
+-commutative80.0%
associate-+r+80.0%
associate-+r-63.6%
associate-+l-52.0%
associate-+r-52.0%
Simplified30.2%
Taylor expanded in t around inf 4.0%
associate--l+16.4%
+-commutative16.4%
associate--l+13.2%
+-commutative13.2%
associate-+r+13.1%
Simplified13.1%
Taylor expanded in z around inf 25.6%
+-commutative25.6%
Simplified25.6%
Taylor expanded in x around 0 31.0%
associate--l+48.4%
Simplified48.4%
if 6.49999999999999968e196 < z < 4.6000000000000002e234Initial program 93.1%
+-commutative93.1%
associate-+r+93.1%
associate-+r-87.3%
associate-+l-72.3%
associate-+r-72.3%
Simplified43.6%
Taylor expanded in t around inf 3.1%
associate--l+11.2%
+-commutative11.2%
associate--l+11.2%
+-commutative11.2%
associate-+r+11.2%
Simplified11.2%
Taylor expanded in z around inf 22.2%
+-commutative22.2%
Simplified22.2%
Taylor expanded in y around inf 9.6%
flip--9.6%
add-sqr-sqrt10.3%
add-sqr-sqrt9.6%
+-commutative9.6%
+-commutative9.6%
+-commutative9.6%
Applied egg-rr9.6%
associate--l+11.8%
+-inverses11.8%
metadata-eval11.8%
Simplified11.8%
Final simplification41.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))) (t_2 (sqrt (+ y 1.0))))
(if (<= y 4.3e-6)
(+ (- (+ t_2 (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (sqrt y)) 1.0)
(if (<= y 4.6e+24)
(+ t_1 (- (/ 1.0 (+ t_2 (sqrt y))) (sqrt x)))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double t_2 = sqrt((y + 1.0));
double tmp;
if (y <= 4.3e-6) {
tmp = ((t_2 + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) - sqrt(y)) + 1.0;
} else if (y <= 4.6e+24) {
tmp = t_1 + ((1.0 / (t_2 + sqrt(y))) - sqrt(x));
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
t_2 = sqrt((y + 1.0d0))
if (y <= 4.3d-6) then
tmp = ((t_2 + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) - sqrt(y)) + 1.0d0
else if (y <= 4.6d+24) then
tmp = t_1 + ((1.0d0 / (t_2 + sqrt(y))) - sqrt(x))
else
tmp = 1.0d0 / (sqrt(x) + 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((x + 1.0));
double t_2 = Math.sqrt((y + 1.0));
double tmp;
if (y <= 4.3e-6) {
tmp = ((t_2 + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) - Math.sqrt(y)) + 1.0;
} else if (y <= 4.6e+24) {
tmp = t_1 + ((1.0 / (t_2 + Math.sqrt(y))) - Math.sqrt(x));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) t_2 = math.sqrt((y + 1.0)) tmp = 0 if y <= 4.3e-6: tmp = ((t_2 + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) - math.sqrt(y)) + 1.0 elif y <= 4.6e+24: tmp = t_1 + ((1.0 / (t_2 + math.sqrt(y))) - math.sqrt(x)) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) t_2 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (y <= 4.3e-6) tmp = Float64(Float64(Float64(t_2 + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) - sqrt(y)) + 1.0); elseif (y <= 4.6e+24) tmp = Float64(t_1 + Float64(Float64(1.0 / Float64(t_2 + sqrt(y))) - sqrt(x))); else tmp = Float64(1.0 / Float64(sqrt(x) + 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((x + 1.0));
t_2 = sqrt((y + 1.0));
tmp = 0.0;
if (y <= 4.3e-6)
tmp = ((t_2 + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) - sqrt(y)) + 1.0;
elseif (y <= 4.6e+24)
tmp = t_1 + ((1.0 / (t_2 + sqrt(y))) - sqrt(x));
else
tmp = 1.0 / (sqrt(x) + 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[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.3e-6], N[(N[(N[(t$95$2 + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[y, 4.6e+24], N[(t$95$1 + N[(N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
t_2 := \sqrt{y + 1}\\
\mathbf{if}\;y \leq 4.3 \cdot 10^{-6}:\\
\;\;\;\;\left(\left(t\_2 + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) - \sqrt{y}\right) + 1\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+24}:\\
\;\;\;\;t\_1 + \left(\frac{1}{t\_2 + \sqrt{y}} - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 4.30000000000000033e-6Initial program 96.0%
associate-+l+96.0%
sub-neg96.0%
sub-neg96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in x around 0 55.8%
flip--96.6%
add-sqr-sqrt75.0%
add-sqr-sqrt97.0%
Applied egg-rr55.9%
associate--l+97.6%
+-inverses97.6%
metadata-eval97.6%
Simplified56.1%
Taylor expanded in t around inf 55.6%
associate--l+55.6%
+-commutative55.6%
Simplified55.6%
if 4.30000000000000033e-6 < y < 4.5999999999999998e24Initial program 78.3%
associate-+l+78.3%
associate-+l+78.4%
+-commutative78.4%
+-commutative78.4%
associate-+l-61.3%
+-commutative61.3%
+-commutative61.3%
Simplified61.3%
flip--67.7%
add-sqr-sqrt58.7%
add-sqr-sqrt68.7%
Applied egg-rr68.4%
associate--l+72.6%
+-inverses72.6%
metadata-eval72.6%
Simplified72.6%
Taylor expanded in z around inf 62.1%
Taylor expanded in t around inf 21.2%
associate--l+21.2%
Simplified21.2%
if 4.5999999999999998e24 < y Initial program 79.4%
+-commutative79.4%
associate-+r+79.4%
associate-+r-43.9%
associate-+l-18.1%
associate-+r-5.6%
Simplified5.0%
Taylor expanded in t around inf 3.2%
associate--l+15.6%
+-commutative15.6%
associate--l+19.2%
+-commutative19.2%
associate-+r+19.1%
Simplified19.1%
Taylor expanded in z around inf 15.4%
+-commutative15.4%
Simplified15.4%
Taylor expanded in y around inf 15.2%
flip--15.2%
add-sqr-sqrt15.4%
add-sqr-sqrt15.2%
+-commutative15.2%
+-commutative15.2%
+-commutative15.2%
Applied egg-rr15.2%
associate--l+21.4%
+-inverses21.4%
metadata-eval21.4%
Simplified21.4%
Final simplification38.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 (+ x 1.0))) (t_2 (sqrt (+ y 1.0))))
(if (<= y 4.3e-6)
(- (+ (+ t_2 (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) 1.0) (sqrt y))
(if (<= y 4.6e+24)
(+ t_1 (- (/ 1.0 (+ t_2 (sqrt y))) (sqrt x)))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double t_2 = sqrt((y + 1.0));
double tmp;
if (y <= 4.3e-6) {
tmp = ((t_2 + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + 1.0) - sqrt(y);
} else if (y <= 4.6e+24) {
tmp = t_1 + ((1.0 / (t_2 + sqrt(y))) - sqrt(x));
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
t_2 = sqrt((y + 1.0d0))
if (y <= 4.3d-6) then
tmp = ((t_2 + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + 1.0d0) - sqrt(y)
else if (y <= 4.6d+24) then
tmp = t_1 + ((1.0d0 / (t_2 + sqrt(y))) - sqrt(x))
else
tmp = 1.0d0 / (sqrt(x) + 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((x + 1.0));
double t_2 = Math.sqrt((y + 1.0));
double tmp;
if (y <= 4.3e-6) {
tmp = ((t_2 + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + 1.0) - Math.sqrt(y);
} else if (y <= 4.6e+24) {
tmp = t_1 + ((1.0 / (t_2 + Math.sqrt(y))) - Math.sqrt(x));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) t_2 = math.sqrt((y + 1.0)) tmp = 0 if y <= 4.3e-6: tmp = ((t_2 + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + 1.0) - math.sqrt(y) elif y <= 4.6e+24: tmp = t_1 + ((1.0 / (t_2 + math.sqrt(y))) - math.sqrt(x)) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) t_2 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (y <= 4.3e-6) tmp = Float64(Float64(Float64(t_2 + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + 1.0) - sqrt(y)); elseif (y <= 4.6e+24) tmp = Float64(t_1 + Float64(Float64(1.0 / Float64(t_2 + sqrt(y))) - sqrt(x))); else tmp = Float64(1.0 / Float64(sqrt(x) + 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((x + 1.0));
t_2 = sqrt((y + 1.0));
tmp = 0.0;
if (y <= 4.3e-6)
tmp = ((t_2 + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + 1.0) - sqrt(y);
elseif (y <= 4.6e+24)
tmp = t_1 + ((1.0 / (t_2 + sqrt(y))) - sqrt(x));
else
tmp = 1.0 / (sqrt(x) + 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[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.3e-6], N[(N[(N[(t$95$2 + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e+24], N[(t$95$1 + N[(N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
t_2 := \sqrt{y + 1}\\
\mathbf{if}\;y \leq 4.3 \cdot 10^{-6}:\\
\;\;\;\;\left(\left(t\_2 + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + 1\right) - \sqrt{y}\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+24}:\\
\;\;\;\;t\_1 + \left(\frac{1}{t\_2 + \sqrt{y}} - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 4.30000000000000033e-6Initial program 96.0%
associate-+l+96.0%
sub-neg96.0%
sub-neg96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in x around 0 55.8%
flip--96.6%
add-sqr-sqrt75.0%
add-sqr-sqrt97.0%
Applied egg-rr55.9%
associate--l+97.6%
+-inverses97.6%
metadata-eval97.6%
Simplified56.1%
Taylor expanded in t around inf 55.6%
if 4.30000000000000033e-6 < y < 4.5999999999999998e24Initial program 78.3%
associate-+l+78.3%
associate-+l+78.4%
+-commutative78.4%
+-commutative78.4%
associate-+l-61.3%
+-commutative61.3%
+-commutative61.3%
Simplified61.3%
flip--67.7%
add-sqr-sqrt58.7%
add-sqr-sqrt68.7%
Applied egg-rr68.4%
associate--l+72.6%
+-inverses72.6%
metadata-eval72.6%
Simplified72.6%
Taylor expanded in z around inf 62.1%
Taylor expanded in t around inf 21.2%
associate--l+21.2%
Simplified21.2%
if 4.5999999999999998e24 < y Initial program 79.4%
+-commutative79.4%
associate-+r+79.4%
associate-+r-43.9%
associate-+l-18.1%
associate-+r-5.6%
Simplified5.0%
Taylor expanded in t around inf 3.2%
associate--l+15.6%
+-commutative15.6%
associate--l+19.2%
+-commutative19.2%
associate-+r+19.1%
Simplified19.1%
Taylor expanded in z around inf 15.4%
+-commutative15.4%
Simplified15.4%
Taylor expanded in y around inf 15.2%
flip--15.2%
add-sqr-sqrt15.4%
add-sqr-sqrt15.2%
+-commutative15.2%
+-commutative15.2%
+-commutative15.2%
Applied egg-rr15.2%
associate--l+21.4%
+-inverses21.4%
metadata-eval21.4%
Simplified21.4%
Final simplification38.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 (<= z 0.34)
(+ (- (sqrt (+ t 1.0)) (sqrt t)) 3.0)
(if (or (<= z 6.5e+196) (not (<= z 4.6e+234)))
(+ (- (sqrt (+ y 1.0)) (sqrt y)) 1.0)
(/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.34) {
tmp = (sqrt((t + 1.0)) - sqrt(t)) + 3.0;
} else if ((z <= 6.5e+196) || !(z <= 4.6e+234)) {
tmp = (sqrt((y + 1.0)) - sqrt(y)) + 1.0;
} else {
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
}
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.34d0) then
tmp = (sqrt((t + 1.0d0)) - sqrt(t)) + 3.0d0
else if ((z <= 6.5d+196) .or. (.not. (z <= 4.6d+234))) then
tmp = (sqrt((y + 1.0d0)) - sqrt(y)) + 1.0d0
else
tmp = 1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))
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.34) {
tmp = (Math.sqrt((t + 1.0)) - Math.sqrt(t)) + 3.0;
} else if ((z <= 6.5e+196) || !(z <= 4.6e+234)) {
tmp = (Math.sqrt((y + 1.0)) - Math.sqrt(y)) + 1.0;
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.34: tmp = (math.sqrt((t + 1.0)) - math.sqrt(t)) + 3.0 elif (z <= 6.5e+196) or not (z <= 4.6e+234): tmp = (math.sqrt((y + 1.0)) - math.sqrt(y)) + 1.0 else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((x + 1.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.34) tmp = Float64(Float64(sqrt(Float64(t + 1.0)) - sqrt(t)) + 3.0); elseif ((z <= 6.5e+196) || !(z <= 4.6e+234)) tmp = Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + 1.0); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))); 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.34)
tmp = (sqrt((t + 1.0)) - sqrt(t)) + 3.0;
elseif ((z <= 6.5e+196) || ~((z <= 4.6e+234)))
tmp = (sqrt((y + 1.0)) - sqrt(y)) + 1.0;
else
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
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.34], N[(N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[Or[LessEqual[z, 6.5e+196], N[Not[LessEqual[z, 4.6e+234]], $MachinePrecision]], N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $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.34:\\
\;\;\;\;\left(\sqrt{t + 1} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+196} \lor \neg \left(z \leq 4.6 \cdot 10^{+234}\right):\\
\;\;\;\;\left(\sqrt{y + 1} - \sqrt{y}\right) + 1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if z < 0.340000000000000024Initial program 96.1%
associate-+l+96.1%
sub-neg96.1%
sub-neg96.1%
+-commutative96.1%
+-commutative96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in x around 0 53.5%
Taylor expanded in z around 0 19.8%
associate--l+53.9%
+-commutative53.9%
associate--l+46.6%
Simplified46.6%
Taylor expanded in y around 0 22.6%
associate--l+34.4%
Simplified34.4%
if 0.340000000000000024 < z < 6.49999999999999968e196 or 4.6000000000000002e234 < z Initial program 79.8%
+-commutative79.8%
associate-+r+79.8%
associate-+r-63.5%
associate-+l-51.8%
associate-+r-51.6%
Simplified31.3%
Taylor expanded in t around inf 4.5%
associate--l+16.4%
+-commutative16.4%
associate--l+13.3%
+-commutative13.3%
associate-+r+13.3%
Simplified13.3%
Taylor expanded in z around inf 24.8%
+-commutative24.8%
Simplified24.8%
Taylor expanded in x around 0 30.7%
associate--l+47.5%
Simplified47.5%
if 6.49999999999999968e196 < z < 4.6000000000000002e234Initial program 93.1%
+-commutative93.1%
associate-+r+93.1%
associate-+r-87.3%
associate-+l-72.3%
associate-+r-72.3%
Simplified43.6%
Taylor expanded in t around inf 3.1%
associate--l+11.2%
+-commutative11.2%
associate--l+11.2%
+-commutative11.2%
associate-+r+11.2%
Simplified11.2%
Taylor expanded in z around inf 22.2%
+-commutative22.2%
Simplified22.2%
Taylor expanded in y around inf 9.6%
flip--9.6%
add-sqr-sqrt10.3%
add-sqr-sqrt9.6%
+-commutative9.6%
+-commutative9.6%
+-commutative9.6%
Applied egg-rr9.6%
associate--l+11.8%
+-inverses11.8%
metadata-eval11.8%
Simplified11.8%
Final simplification39.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (let* ((t_1 (- (sqrt (+ y 1.0)) (sqrt y)))) (if (<= z 0.62) (+ t_1 2.0) (+ t_1 1.0))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0)) - sqrt(y);
double tmp;
if (z <= 0.62) {
tmp = t_1 + 2.0;
} else {
tmp = t_1 + 1.0;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0)) - sqrt(y)
if (z <= 0.62d0) then
tmp = t_1 + 2.0d0
else
tmp = t_1 + 1.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0)) - Math.sqrt(y);
double tmp;
if (z <= 0.62) {
tmp = t_1 + 2.0;
} else {
tmp = t_1 + 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) - math.sqrt(y) tmp = 0 if z <= 0.62: tmp = t_1 + 2.0 else: tmp = t_1 + 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) tmp = 0.0 if (z <= 0.62) tmp = Float64(t_1 + 2.0); else tmp = Float64(t_1 + 1.0); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0)) - sqrt(y);
tmp = 0.0;
if (z <= 0.62)
tmp = t_1 + 2.0;
else
tmp = t_1 + 1.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 0.62], N[(t$95$1 + 2.0), $MachinePrecision], N[(t$95$1 + 1.0), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1} - \sqrt{y}\\
\mathbf{if}\;z \leq 0.62:\\
\;\;\;\;t\_1 + 2\\
\mathbf{else}:\\
\;\;\;\;t\_1 + 1\\
\end{array}
\end{array}
if z < 0.619999999999999996Initial program 96.1%
associate-+l+96.1%
sub-neg96.1%
sub-neg96.1%
+-commutative96.1%
+-commutative96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in x around 0 53.5%
Taylor expanded in z around 0 19.8%
associate--l+53.9%
+-commutative53.9%
associate--l+46.6%
Simplified46.6%
Taylor expanded in t around inf 55.0%
if 0.619999999999999996 < z Initial program 81.1%
+-commutative81.1%
associate-+r+81.1%
associate-+r-65.8%
associate-+l-53.8%
associate-+r-53.7%
Simplified32.5%
Taylor expanded in t around inf 4.4%
associate--l+15.9%
+-commutative15.9%
associate--l+13.1%
+-commutative13.1%
associate-+r+13.1%
Simplified13.1%
Taylor expanded in z around inf 24.6%
+-commutative24.6%
Simplified24.6%
Taylor expanded in x around 0 31.4%
associate--l+47.8%
Simplified47.8%
Final simplification51.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 0.31) (+ (- (sqrt (+ t 1.0)) (sqrt t)) 3.0) (+ (- (sqrt (+ y 1.0)) (sqrt y)) 1.0)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.31) {
tmp = (sqrt((t + 1.0)) - sqrt(t)) + 3.0;
} else {
tmp = (sqrt((y + 1.0)) - sqrt(y)) + 1.0;
}
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.31d0) then
tmp = (sqrt((t + 1.0d0)) - sqrt(t)) + 3.0d0
else
tmp = (sqrt((y + 1.0d0)) - sqrt(y)) + 1.0d0
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.31) {
tmp = (Math.sqrt((t + 1.0)) - Math.sqrt(t)) + 3.0;
} else {
tmp = (Math.sqrt((y + 1.0)) - Math.sqrt(y)) + 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.31: tmp = (math.sqrt((t + 1.0)) - math.sqrt(t)) + 3.0 else: tmp = (math.sqrt((y + 1.0)) - math.sqrt(y)) + 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.31) tmp = Float64(Float64(sqrt(Float64(t + 1.0)) - sqrt(t)) + 3.0); else tmp = Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + 1.0); 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.31)
tmp = (sqrt((t + 1.0)) - sqrt(t)) + 3.0;
else
tmp = (sqrt((y + 1.0)) - sqrt(y)) + 1.0;
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.31], N[(N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.31:\\
\;\;\;\;\left(\sqrt{t + 1} - \sqrt{t}\right) + 3\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{y + 1} - \sqrt{y}\right) + 1\\
\end{array}
\end{array}
if z < 0.309999999999999998Initial program 96.1%
associate-+l+96.1%
sub-neg96.1%
sub-neg96.1%
+-commutative96.1%
+-commutative96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in x around 0 53.5%
Taylor expanded in z around 0 19.8%
associate--l+53.9%
+-commutative53.9%
associate--l+46.6%
Simplified46.6%
Taylor expanded in y around 0 22.6%
associate--l+34.4%
Simplified34.4%
if 0.309999999999999998 < z Initial program 81.1%
+-commutative81.1%
associate-+r+81.1%
associate-+r-65.8%
associate-+l-53.8%
associate-+r-53.7%
Simplified32.5%
Taylor expanded in t around inf 4.4%
associate--l+15.9%
+-commutative15.9%
associate--l+13.1%
+-commutative13.1%
associate-+r+13.1%
Simplified13.1%
Taylor expanded in z around inf 24.6%
+-commutative24.6%
Simplified24.6%
Taylor expanded in x around 0 31.4%
associate--l+47.8%
Simplified47.8%
Final simplification41.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 (+ y 1.0)) (sqrt y)) 1.0))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (sqrt((y + 1.0)) - sqrt(y)) + 1.0;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (sqrt((y + 1.0d0)) - sqrt(y)) + 1.0d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (Math.sqrt((y + 1.0)) - Math.sqrt(y)) + 1.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (math.sqrt((y + 1.0)) - math.sqrt(y)) + 1.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + 1.0) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (sqrt((y + 1.0)) - sqrt(y)) + 1.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\sqrt{y + 1} - \sqrt{y}\right) + 1
\end{array}
Initial program 87.8%
+-commutative87.8%
associate-+r+87.8%
associate-+r-72.4%
associate-+l-61.2%
associate-+r-55.8%
Simplified44.0%
Taylor expanded in t around inf 11.0%
associate--l+18.9%
+-commutative18.9%
associate--l+20.4%
+-commutative20.4%
associate-+r+20.4%
Simplified20.4%
Taylor expanded in z around inf 18.7%
+-commutative18.7%
Simplified18.7%
Taylor expanded in x around 0 27.6%
associate--l+42.0%
Simplified42.0%
Final simplification42.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt (+ x 1.0)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt((x + 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 = sqrt((x + 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 Math.sqrt((x + 1.0)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt((x + 1.0)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt((x + 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[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{x + 1} - \sqrt{x}
\end{array}
Initial program 87.8%
+-commutative87.8%
associate-+r+87.8%
associate-+r-72.4%
associate-+l-61.2%
associate-+r-55.8%
Simplified44.0%
Taylor expanded in t around inf 11.0%
associate--l+18.9%
+-commutative18.9%
associate--l+20.4%
+-commutative20.4%
associate-+r+20.4%
Simplified20.4%
Taylor expanded in z around inf 18.7%
+-commutative18.7%
Simplified18.7%
Taylor expanded in y around inf 13.0%
Final simplification13.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (+ (* x 0.5) 1.0) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((x * 0.5) + 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 = ((x * 0.5d0) + 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 ((x * 0.5) + 1.0) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((x * 0.5) + 1.0) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) + 1.0) - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((x * 0.5) + 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[(N[(N[(x * 0.5), $MachinePrecision] + 1.0), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(x \cdot 0.5 + 1\right) - \sqrt{x}
\end{array}
Initial program 87.8%
+-commutative87.8%
associate-+r+87.8%
associate-+r-72.4%
associate-+l-61.2%
associate-+r-55.8%
Simplified44.0%
Taylor expanded in t around inf 11.0%
associate--l+18.9%
+-commutative18.9%
associate--l+20.4%
+-commutative20.4%
associate-+r+20.4%
Simplified20.4%
Taylor expanded in z around inf 18.7%
+-commutative18.7%
Simplified18.7%
Taylor expanded in y around inf 13.0%
Taylor expanded in x around 0 13.5%
*-commutative13.5%
Simplified13.5%
Final simplification13.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 1.0)
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return 1.0 end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1
\end{array}
Initial program 87.8%
+-commutative87.8%
associate-+r+87.8%
associate-+r-72.4%
associate-+l-61.2%
associate-+r-55.8%
Simplified44.0%
Taylor expanded in t around inf 11.0%
associate--l+18.9%
+-commutative18.9%
associate--l+20.4%
+-commutative20.4%
associate-+r+20.4%
Simplified20.4%
Taylor expanded in z around inf 18.7%
+-commutative18.7%
Simplified18.7%
Taylor expanded in y around inf 13.0%
Taylor expanded in x around 0 32.0%
Final simplification32.0%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024052
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:herbie-target
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))