
(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 (+ y 1.0))) (t_2 (sqrt (+ t 1.0))) (t_3 (sqrt (+ z 1.0))))
(if (<= (- t_1 (sqrt y)) 3.2e-5)
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(+ (* 0.5 (sqrt (/ 1.0 y))) (+ t_2 (- (- t_3 (sqrt z)) (sqrt t)))))
(+
(- (+ t_1 (+ (- t_3 (+ (sqrt x) (sqrt z))) 1.0)) (sqrt y))
(/ 1.0 (+ t_2 (sqrt t)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double t_2 = sqrt((t + 1.0));
double t_3 = sqrt((z + 1.0));
double tmp;
if ((t_1 - sqrt(y)) <= 3.2e-5) {
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) + ((0.5 * sqrt((1.0 / y))) + (t_2 + ((t_3 - sqrt(z)) - sqrt(t))));
} else {
tmp = ((t_1 + ((t_3 - (sqrt(x) + sqrt(z))) + 1.0)) - sqrt(y)) + (1.0 / (t_2 + sqrt(t)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
t_2 = sqrt((t + 1.0d0))
t_3 = sqrt((z + 1.0d0))
if ((t_1 - sqrt(y)) <= 3.2d-5) then
tmp = (1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + ((0.5d0 * sqrt((1.0d0 / y))) + (t_2 + ((t_3 - sqrt(z)) - sqrt(t))))
else
tmp = ((t_1 + ((t_3 - (sqrt(x) + sqrt(z))) + 1.0d0)) - sqrt(y)) + (1.0d0 / (t_2 + sqrt(t)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double t_2 = Math.sqrt((t + 1.0));
double t_3 = Math.sqrt((z + 1.0));
double tmp;
if ((t_1 - Math.sqrt(y)) <= 3.2e-5) {
tmp = (1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + ((0.5 * Math.sqrt((1.0 / y))) + (t_2 + ((t_3 - Math.sqrt(z)) - Math.sqrt(t))));
} else {
tmp = ((t_1 + ((t_3 - (Math.sqrt(x) + Math.sqrt(z))) + 1.0)) - Math.sqrt(y)) + (1.0 / (t_2 + Math.sqrt(t)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) t_2 = math.sqrt((t + 1.0)) t_3 = math.sqrt((z + 1.0)) tmp = 0 if (t_1 - math.sqrt(y)) <= 3.2e-5: tmp = (1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + ((0.5 * math.sqrt((1.0 / y))) + (t_2 + ((t_3 - math.sqrt(z)) - math.sqrt(t)))) else: tmp = ((t_1 + ((t_3 - (math.sqrt(x) + math.sqrt(z))) + 1.0)) - math.sqrt(y)) + (1.0 / (t_2 + math.sqrt(t))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) t_2 = sqrt(Float64(t + 1.0)) t_3 = sqrt(Float64(z + 1.0)) tmp = 0.0 if (Float64(t_1 - sqrt(y)) <= 3.2e-5) tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(t_2 + Float64(Float64(t_3 - sqrt(z)) - sqrt(t))))); else tmp = Float64(Float64(Float64(t_1 + Float64(Float64(t_3 - Float64(sqrt(x) + sqrt(z))) + 1.0)) - sqrt(y)) + Float64(1.0 / Float64(t_2 + sqrt(t)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
t_2 = sqrt((t + 1.0));
t_3 = sqrt((z + 1.0));
tmp = 0.0;
if ((t_1 - sqrt(y)) <= 3.2e-5)
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) + ((0.5 * sqrt((1.0 / y))) + (t_2 + ((t_3 - sqrt(z)) - sqrt(t))));
else
tmp = ((t_1 + ((t_3 - (sqrt(x) + sqrt(z))) + 1.0)) - sqrt(y)) + (1.0 / (t_2 + sqrt(t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], 3.2e-5], N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 + N[(N[(t$95$3 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
t_2 := \sqrt{t + 1}\\
t_3 := \sqrt{z + 1}\\
\mathbf{if}\;t\_1 - \sqrt{y} \leq 3.2 \cdot 10^{-5}:\\
\;\;\;\;\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \left(0.5 \cdot \sqrt{\frac{1}{y}} + \left(t\_2 + \left(\left(t\_3 - \sqrt{z}\right) - \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_1 + \left(\left(t\_3 - \left(\sqrt{x} + \sqrt{z}\right)\right) + 1\right)\right) - \sqrt{y}\right) + \frac{1}{t\_2 + \sqrt{t}}\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) < 3.19999999999999986e-5Initial program 83.2%
associate-+l+83.2%
associate-+l+83.2%
+-commutative83.2%
+-commutative83.2%
associate-+l-67.4%
+-commutative67.4%
+-commutative67.4%
Simplified67.4%
flip--67.5%
add-sqr-sqrt55.4%
+-commutative55.4%
add-sqr-sqrt67.6%
+-commutative67.6%
Applied egg-rr67.6%
associate--l+69.1%
+-inverses69.1%
metadata-eval69.1%
Simplified69.1%
Taylor expanded in y around inf 74.6%
if 3.19999999999999986e-5 < (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) Initial program 97.5%
+-commutative97.5%
associate-+r+97.5%
associate-+r-97.4%
associate-+l-97.5%
associate-+r-97.5%
Simplified75.6%
Taylor expanded in x around 0 40.5%
flip--40.5%
add-sqr-sqrt30.8%
add-sqr-sqrt40.5%
+-commutative40.5%
+-commutative40.5%
Applied egg-rr40.5%
associate--r+40.8%
+-inverses40.8%
metadata-eval40.8%
Simplified40.8%
associate-+r-40.8%
associate--l+58.7%
+-commutative58.7%
+-commutative58.7%
+-commutative58.7%
add-sqr-sqrt58.7%
hypot-1-def58.7%
Applied egg-rr58.7%
associate--r+58.7%
sub-neg58.7%
associate-+r-40.8%
+-commutative40.8%
associate--l+58.7%
metadata-eval58.7%
associate-*r/58.7%
mul-1-neg58.7%
remove-double-neg58.7%
+-commutative58.7%
hypot-undefine58.7%
Simplified58.7%
Final simplification67.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 (+ z 1.0))) (t_2 (sqrt (+ y 1.0))))
(if (<= y 4.5e+19)
(+
(- (+ t_2 (+ (- t_1 (+ (sqrt x) (sqrt z))) 1.0)) (sqrt y))
(/ 1.0 (+ (sqrt (+ t 1.0)) (sqrt t))))
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(- (+ t_1 t_2) (+ (sqrt z) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0));
double t_2 = sqrt((y + 1.0));
double tmp;
if (y <= 4.5e+19) {
tmp = ((t_2 + ((t_1 - (sqrt(x) + sqrt(z))) + 1.0)) - sqrt(y)) + (1.0 / (sqrt((t + 1.0)) + sqrt(t)));
} else {
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) + ((t_1 + t_2) - (sqrt(z) + 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((z + 1.0d0))
t_2 = sqrt((y + 1.0d0))
if (y <= 4.5d+19) then
tmp = ((t_2 + ((t_1 - (sqrt(x) + sqrt(z))) + 1.0d0)) - sqrt(y)) + (1.0d0 / (sqrt((t + 1.0d0)) + sqrt(t)))
else
tmp = (1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + ((t_1 + t_2) - (sqrt(z) + 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((z + 1.0));
double t_2 = Math.sqrt((y + 1.0));
double tmp;
if (y <= 4.5e+19) {
tmp = ((t_2 + ((t_1 - (Math.sqrt(x) + Math.sqrt(z))) + 1.0)) - Math.sqrt(y)) + (1.0 / (Math.sqrt((t + 1.0)) + Math.sqrt(t)));
} else {
tmp = (1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + ((t_1 + t_2) - (Math.sqrt(z) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) t_2 = math.sqrt((y + 1.0)) tmp = 0 if y <= 4.5e+19: tmp = ((t_2 + ((t_1 - (math.sqrt(x) + math.sqrt(z))) + 1.0)) - math.sqrt(y)) + (1.0 / (math.sqrt((t + 1.0)) + math.sqrt(t))) else: tmp = (1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + ((t_1 + t_2) - (math.sqrt(z) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(z + 1.0)) t_2 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (y <= 4.5e+19) tmp = Float64(Float64(Float64(t_2 + Float64(Float64(t_1 - Float64(sqrt(x) + sqrt(z))) + 1.0)) - sqrt(y)) + Float64(1.0 / Float64(sqrt(Float64(t + 1.0)) + sqrt(t)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(Float64(t_1 + t_2) - Float64(sqrt(z) + 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((z + 1.0));
t_2 = sqrt((y + 1.0));
tmp = 0.0;
if (y <= 4.5e+19)
tmp = ((t_2 + ((t_1 - (sqrt(x) + sqrt(z))) + 1.0)) - sqrt(y)) + (1.0 / (sqrt((t + 1.0)) + sqrt(t)));
else
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) + ((t_1 + t_2) - (sqrt(z) + 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[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.5e+19], N[(N[(N[(t$95$2 + N[(N[(t$95$1 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 + t$95$2), $MachinePrecision] - N[(N[Sqrt[z], $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{z + 1}\\
t_2 := \sqrt{y + 1}\\
\mathbf{if}\;y \leq 4.5 \cdot 10^{+19}:\\
\;\;\;\;\left(\left(t\_2 + \left(\left(t\_1 - \left(\sqrt{x} + \sqrt{z}\right)\right) + 1\right)\right) - \sqrt{y}\right) + \frac{1}{\sqrt{t + 1} + \sqrt{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \left(\left(t\_1 + t\_2\right) - \left(\sqrt{z} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if y < 4.5e19Initial program 96.1%
+-commutative96.1%
associate-+r+96.1%
associate-+r-96.0%
associate-+l-96.1%
associate-+r-96.1%
Simplified73.9%
Taylor expanded in x around 0 39.1%
flip--39.1%
add-sqr-sqrt29.9%
add-sqr-sqrt39.1%
+-commutative39.1%
+-commutative39.1%
Applied egg-rr39.1%
associate--r+39.4%
+-inverses39.4%
metadata-eval39.4%
Simplified39.4%
associate-+r-39.4%
associate--l+57.8%
+-commutative57.8%
+-commutative57.8%
+-commutative57.8%
add-sqr-sqrt57.8%
hypot-1-def57.8%
Applied egg-rr57.8%
associate--r+57.8%
sub-neg57.8%
associate-+r-39.4%
+-commutative39.4%
associate--l+57.8%
metadata-eval57.8%
associate-*r/57.8%
mul-1-neg57.8%
remove-double-neg57.8%
+-commutative57.8%
hypot-undefine57.8%
Simplified57.8%
if 4.5e19 < y Initial program 83.9%
associate-+l+83.9%
associate-+l+83.9%
+-commutative83.9%
+-commutative83.9%
associate-+l-68.5%
+-commutative68.5%
+-commutative68.5%
Simplified68.5%
flip--68.7%
add-sqr-sqrt56.4%
+-commutative56.4%
add-sqr-sqrt68.8%
+-commutative68.8%
Applied egg-rr68.8%
associate--l+70.3%
+-inverses70.3%
metadata-eval70.3%
Simplified70.3%
Taylor expanded in t around inf 24.5%
Final simplification41.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (sqrt z) (sqrt y)))
(t_2 (sqrt (+ z 1.0)))
(t_3 (sqrt (+ y 1.0))))
(if (<= z 39000.0)
(- (+ (/ 1.0 (+ (sqrt (+ t 1.0)) (sqrt t))) (+ t_2 2.0)) (+ (sqrt x) t_1))
(if (<= z 7.5e+219)
(+
(-
(+
t_3
(+ (* -0.125 (sqrt (/ 1.0 (pow z 3.0)))) (* 0.5 (sqrt (/ 1.0 z)))))
(+ (sqrt x) (sqrt y)))
1.0)
(+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (- (+ t_2 t_3) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(z) + sqrt(y);
double t_2 = sqrt((z + 1.0));
double t_3 = sqrt((y + 1.0));
double tmp;
if (z <= 39000.0) {
tmp = ((1.0 / (sqrt((t + 1.0)) + sqrt(t))) + (t_2 + 2.0)) - (sqrt(x) + t_1);
} else if (z <= 7.5e+219) {
tmp = ((t_3 + ((-0.125 * sqrt((1.0 / pow(z, 3.0)))) + (0.5 * sqrt((1.0 / z))))) - (sqrt(x) + sqrt(y))) + 1.0;
} else {
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) + ((t_2 + t_3) - 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) :: t_3
real(8) :: tmp
t_1 = sqrt(z) + sqrt(y)
t_2 = sqrt((z + 1.0d0))
t_3 = sqrt((y + 1.0d0))
if (z <= 39000.0d0) then
tmp = ((1.0d0 / (sqrt((t + 1.0d0)) + sqrt(t))) + (t_2 + 2.0d0)) - (sqrt(x) + t_1)
else if (z <= 7.5d+219) then
tmp = ((t_3 + (((-0.125d0) * sqrt((1.0d0 / (z ** 3.0d0)))) + (0.5d0 * sqrt((1.0d0 / z))))) - (sqrt(x) + sqrt(y))) + 1.0d0
else
tmp = (1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + ((t_2 + t_3) - 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(z) + Math.sqrt(y);
double t_2 = Math.sqrt((z + 1.0));
double t_3 = Math.sqrt((y + 1.0));
double tmp;
if (z <= 39000.0) {
tmp = ((1.0 / (Math.sqrt((t + 1.0)) + Math.sqrt(t))) + (t_2 + 2.0)) - (Math.sqrt(x) + t_1);
} else if (z <= 7.5e+219) {
tmp = ((t_3 + ((-0.125 * Math.sqrt((1.0 / Math.pow(z, 3.0)))) + (0.5 * Math.sqrt((1.0 / z))))) - (Math.sqrt(x) + Math.sqrt(y))) + 1.0;
} else {
tmp = (1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + ((t_2 + t_3) - t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(z) + math.sqrt(y) t_2 = math.sqrt((z + 1.0)) t_3 = math.sqrt((y + 1.0)) tmp = 0 if z <= 39000.0: tmp = ((1.0 / (math.sqrt((t + 1.0)) + math.sqrt(t))) + (t_2 + 2.0)) - (math.sqrt(x) + t_1) elif z <= 7.5e+219: tmp = ((t_3 + ((-0.125 * math.sqrt((1.0 / math.pow(z, 3.0)))) + (0.5 * math.sqrt((1.0 / z))))) - (math.sqrt(x) + math.sqrt(y))) + 1.0 else: tmp = (1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + ((t_2 + t_3) - t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(z) + sqrt(y)) t_2 = sqrt(Float64(z + 1.0)) t_3 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 39000.0) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(t + 1.0)) + sqrt(t))) + Float64(t_2 + 2.0)) - Float64(sqrt(x) + t_1)); elseif (z <= 7.5e+219) tmp = Float64(Float64(Float64(t_3 + Float64(Float64(-0.125 * sqrt(Float64(1.0 / (z ^ 3.0)))) + Float64(0.5 * sqrt(Float64(1.0 / z))))) - Float64(sqrt(x) + sqrt(y))) + 1.0); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(Float64(t_2 + t_3) - 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(z) + sqrt(y);
t_2 = sqrt((z + 1.0));
t_3 = sqrt((y + 1.0));
tmp = 0.0;
if (z <= 39000.0)
tmp = ((1.0 / (sqrt((t + 1.0)) + sqrt(t))) + (t_2 + 2.0)) - (sqrt(x) + t_1);
elseif (z <= 7.5e+219)
tmp = ((t_3 + ((-0.125 * sqrt((1.0 / (z ^ 3.0)))) + (0.5 * sqrt((1.0 / z))))) - (sqrt(x) + sqrt(y))) + 1.0;
else
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) + ((t_2 + t_3) - t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 39000.0], N[(N[(N[(1.0 / N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + 2.0), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e+219], N[(N[(N[(t$95$3 + N[(N[(-0.125 * N[Sqrt[N[(1.0 / N[Power[z, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 + t$95$3), $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{z} + \sqrt{y}\\
t_2 := \sqrt{z + 1}\\
t_3 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 39000:\\
\;\;\;\;\left(\frac{1}{\sqrt{t + 1} + \sqrt{t}} + \left(t\_2 + 2\right)\right) - \left(\sqrt{x} + t\_1\right)\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+219}:\\
\;\;\;\;\left(\left(t\_3 + \left(-0.125 \cdot \sqrt{\frac{1}{{z}^{3}}} + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\right) + 1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \left(\left(t\_2 + t\_3\right) - t\_1\right)\\
\end{array}
\end{array}
if z < 39000Initial program 96.7%
+-commutative96.7%
associate-+r+96.7%
associate-+r-76.9%
associate-+l-70.2%
associate-+r-56.8%
Simplified56.8%
Taylor expanded in x around 0 32.2%
flip--32.2%
add-sqr-sqrt22.7%
add-sqr-sqrt32.2%
+-commutative32.2%
+-commutative32.2%
Applied egg-rr32.2%
associate--r+32.5%
+-inverses32.5%
metadata-eval32.5%
Simplified32.5%
Taylor expanded in y around 0 26.8%
associate-+r+26.9%
+-commutative26.9%
Simplified26.9%
if 39000 < z < 7.5000000000000006e219Initial program 84.0%
+-commutative84.0%
associate-+r+84.0%
associate-+r-62.4%
associate-+l-50.0%
associate-+r-49.8%
Simplified28.3%
Taylor expanded in t around inf 4.8%
associate--l+21.7%
associate--l+28.8%
associate-+r+28.8%
Simplified28.8%
Taylor expanded in x around 0 4.3%
associate--l+24.5%
associate--l+33.4%
associate-+r+33.4%
+-commutative33.4%
associate--l-33.4%
associate--l-33.4%
+-commutative33.4%
associate-+r+33.4%
associate--r+33.4%
Simplified33.4%
Taylor expanded in z around inf 35.5%
if 7.5000000000000006e219 < 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-sqrt68.0%
+-commutative68.0%
add-sqr-sqrt83.8%
+-commutative83.8%
Applied egg-rr83.8%
associate--l+85.6%
+-inverses85.6%
metadata-eval85.6%
Simplified85.6%
Taylor expanded in t around inf 27.3%
Final simplification30.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 z) (sqrt y)))
(t_2 (sqrt (+ y 1.0)))
(t_3 (sqrt (+ z 1.0))))
(if (<= y 4.8e-19)
(+ 2.0 (- (- t_3 (sqrt x)) t_1))
(if (<= y 1.15e+15)
(- (+ (+ t_2 (* 0.5 (sqrt (/ 1.0 z)))) 1.0) (+ (sqrt x) (sqrt y)))
(+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (- (+ t_3 t_2) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(z) + sqrt(y);
double t_2 = sqrt((y + 1.0));
double t_3 = sqrt((z + 1.0));
double tmp;
if (y <= 4.8e-19) {
tmp = 2.0 + ((t_3 - sqrt(x)) - t_1);
} else if (y <= 1.15e+15) {
tmp = ((t_2 + (0.5 * sqrt((1.0 / z)))) + 1.0) - (sqrt(x) + sqrt(y));
} else {
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) + ((t_3 + t_2) - 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) :: t_3
real(8) :: tmp
t_1 = sqrt(z) + sqrt(y)
t_2 = sqrt((y + 1.0d0))
t_3 = sqrt((z + 1.0d0))
if (y <= 4.8d-19) then
tmp = 2.0d0 + ((t_3 - sqrt(x)) - t_1)
else if (y <= 1.15d+15) then
tmp = ((t_2 + (0.5d0 * sqrt((1.0d0 / z)))) + 1.0d0) - (sqrt(x) + sqrt(y))
else
tmp = (1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + ((t_3 + t_2) - 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(z) + Math.sqrt(y);
double t_2 = Math.sqrt((y + 1.0));
double t_3 = Math.sqrt((z + 1.0));
double tmp;
if (y <= 4.8e-19) {
tmp = 2.0 + ((t_3 - Math.sqrt(x)) - t_1);
} else if (y <= 1.15e+15) {
tmp = ((t_2 + (0.5 * Math.sqrt((1.0 / z)))) + 1.0) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = (1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + ((t_3 + t_2) - t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(z) + math.sqrt(y) t_2 = math.sqrt((y + 1.0)) t_3 = math.sqrt((z + 1.0)) tmp = 0 if y <= 4.8e-19: tmp = 2.0 + ((t_3 - math.sqrt(x)) - t_1) elif y <= 1.15e+15: tmp = ((t_2 + (0.5 * math.sqrt((1.0 / z)))) + 1.0) - (math.sqrt(x) + math.sqrt(y)) else: tmp = (1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + ((t_3 + t_2) - t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(z) + sqrt(y)) t_2 = sqrt(Float64(y + 1.0)) t_3 = sqrt(Float64(z + 1.0)) tmp = 0.0 if (y <= 4.8e-19) tmp = Float64(2.0 + Float64(Float64(t_3 - sqrt(x)) - t_1)); elseif (y <= 1.15e+15) tmp = Float64(Float64(Float64(t_2 + Float64(0.5 * sqrt(Float64(1.0 / z)))) + 1.0) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(Float64(t_3 + t_2) - 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(z) + sqrt(y);
t_2 = sqrt((y + 1.0));
t_3 = sqrt((z + 1.0));
tmp = 0.0;
if (y <= 4.8e-19)
tmp = 2.0 + ((t_3 - sqrt(x)) - t_1);
elseif (y <= 1.15e+15)
tmp = ((t_2 + (0.5 * sqrt((1.0 / z)))) + 1.0) - (sqrt(x) + sqrt(y));
else
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) + ((t_3 + t_2) - t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.8e-19], N[(2.0 + N[(N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+15], N[(N[(N[(t$95$2 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 + t$95$2), $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{z} + \sqrt{y}\\
t_2 := \sqrt{y + 1}\\
t_3 := \sqrt{z + 1}\\
\mathbf{if}\;y \leq 4.8 \cdot 10^{-19}:\\
\;\;\;\;2 + \left(\left(t\_3 - \sqrt{x}\right) - t\_1\right)\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(t\_2 + 0.5 \cdot \sqrt{\frac{1}{z}}\right) + 1\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \left(\left(t\_3 + t\_2\right) - t\_1\right)\\
\end{array}
\end{array}
if y < 4.80000000000000046e-19Initial program 97.6%
+-commutative97.6%
associate-+r+97.6%
associate-+r-97.6%
associate-+l-97.6%
associate-+r-97.6%
Simplified77.2%
Taylor expanded in t around inf 24.1%
associate--l+28.3%
associate--l+37.5%
associate-+r+37.5%
Simplified37.5%
Taylor expanded in x around 0 22.3%
associate--l+27.9%
associate--l+39.1%
associate-+r+39.1%
+-commutative39.1%
associate--l-39.1%
associate--l-39.1%
+-commutative39.1%
associate-+r+39.1%
associate--r+39.1%
Simplified39.1%
Taylor expanded in y around 0 22.3%
associate--l+39.1%
associate--r+39.1%
+-commutative39.1%
Simplified39.1%
if 4.80000000000000046e-19 < y < 1.15e15Initial program 88.6%
+-commutative88.6%
associate-+r+88.6%
associate-+r-88.4%
associate-+l-88.5%
associate-+r-88.4%
Simplified58.2%
Taylor expanded in t around inf 26.0%
associate--l+33.9%
associate--l+37.2%
associate-+r+37.2%
Simplified37.2%
Taylor expanded in x around 0 21.0%
associate--l+28.9%
associate--l+32.2%
associate-+r+32.2%
+-commutative32.2%
associate--l-32.2%
associate--l-32.2%
+-commutative32.2%
associate-+r+32.2%
associate--r+32.2%
Simplified32.2%
Taylor expanded in z around inf 25.0%
if 1.15e15 < y Initial program 83.6%
associate-+l+83.6%
associate-+l+83.6%
+-commutative83.6%
+-commutative83.6%
associate-+l-68.5%
+-commutative68.5%
+-commutative68.5%
Simplified68.5%
flip--68.7%
add-sqr-sqrt56.6%
+-commutative56.6%
add-sqr-sqrt68.8%
+-commutative68.8%
Applied egg-rr68.8%
associate--l+70.3%
+-inverses70.3%
metadata-eval70.3%
Simplified70.3%
Taylor expanded in t around inf 25.2%
Final simplification31.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))))
(if (<= z 4.3e+14)
(+
(*
x
(+
(* (+ (sqrt (+ z 1.0)) t_1) (/ 1.0 x))
(- (* (+ (sqrt z) (sqrt y)) (/ -1.0 x)) (sqrt (/ 1.0 x)))))
1.0)
(+
(- (sqrt (+ x 1.0)) (sqrt x))
(+ (- t_1 (sqrt y)) (- (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 tmp;
if (z <= 4.3e+14) {
tmp = (x * (((sqrt((z + 1.0)) + t_1) * (1.0 / x)) + (((sqrt(z) + sqrt(y)) * (-1.0 / x)) - sqrt((1.0 / x))))) + 1.0;
} else {
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((t_1 - sqrt(y)) + (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) :: tmp
t_1 = sqrt((y + 1.0d0))
if (z <= 4.3d+14) then
tmp = (x * (((sqrt((z + 1.0d0)) + t_1) * (1.0d0 / x)) + (((sqrt(z) + sqrt(y)) * ((-1.0d0) / x)) - sqrt((1.0d0 / x))))) + 1.0d0
else
tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + ((t_1 - sqrt(y)) + (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 tmp;
if (z <= 4.3e+14) {
tmp = (x * (((Math.sqrt((z + 1.0)) + t_1) * (1.0 / x)) + (((Math.sqrt(z) + Math.sqrt(y)) * (-1.0 / x)) - Math.sqrt((1.0 / x))))) + 1.0;
} else {
tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + (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)) tmp = 0 if z <= 4.3e+14: tmp = (x * (((math.sqrt((z + 1.0)) + t_1) * (1.0 / x)) + (((math.sqrt(z) + math.sqrt(y)) * (-1.0 / x)) - math.sqrt((1.0 / x))))) + 1.0 else: tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + (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)) tmp = 0.0 if (z <= 4.3e+14) tmp = Float64(Float64(x * Float64(Float64(Float64(sqrt(Float64(z + 1.0)) + t_1) * Float64(1.0 / x)) + Float64(Float64(Float64(sqrt(z) + sqrt(y)) * Float64(-1.0 / x)) - sqrt(Float64(1.0 / x))))) + 1.0); else tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + 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));
tmp = 0.0;
if (z <= 4.3e+14)
tmp = (x * (((sqrt((z + 1.0)) + t_1) * (1.0 / x)) + (((sqrt(z) + sqrt(y)) * (-1.0 / x)) - sqrt((1.0 / x))))) + 1.0;
else
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((t_1 - sqrt(y)) + (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]}, If[LessEqual[z, 4.3e+14], N[(N[(x * N[(N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision] - N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 4.3 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \left(\left(\sqrt{z + 1} + t\_1\right) \cdot \frac{1}{x} + \left(\left(\sqrt{z} + \sqrt{y}\right) \cdot \frac{-1}{x} - \sqrt{\frac{1}{x}}\right)\right) + 1\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{y}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\\
\end{array}
\end{array}
if z < 4.3e14Initial program 96.1%
+-commutative96.1%
associate-+r+96.1%
associate-+r-76.4%
associate-+l-69.4%
associate-+r-56.3%
Simplified56.3%
Taylor expanded in t around inf 25.1%
associate--l+29.3%
associate--l+29.3%
associate-+r+29.3%
Simplified29.3%
Taylor expanded in x around 0 23.0%
associate--l+29.5%
associate--l+29.6%
associate-+r+29.6%
+-commutative29.6%
associate--l-29.6%
associate--l-29.6%
+-commutative29.6%
associate-+r+29.6%
associate--r+29.6%
Simplified29.6%
Taylor expanded in x around inf 26.7%
distribute-lft-out26.7%
+-commutative26.7%
distribute-lft-out26.7%
+-commutative26.7%
Simplified26.7%
if 4.3e14 < z Initial program 84.2%
associate-+l+84.2%
associate-+l+84.2%
+-commutative84.2%
+-commutative84.2%
associate-+l-84.2%
+-commutative84.2%
+-commutative84.2%
Simplified84.2%
Taylor expanded in z around inf 84.2%
+-commutative84.2%
Simplified84.2%
Final simplification55.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))))
(if (<= z 2e+15)
(+
(*
x
(+
(* (+ (sqrt (+ z 1.0)) t_1) (/ 1.0 x))
(- (* (+ (sqrt z) (sqrt y)) (/ -1.0 x)) (sqrt (/ 1.0 x)))))
1.0)
(- (sqrt (+ x 1.0)) (- (+ (sqrt x) (sqrt y)) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double tmp;
if (z <= 2e+15) {
tmp = (x * (((sqrt((z + 1.0)) + t_1) * (1.0 / x)) + (((sqrt(z) + sqrt(y)) * (-1.0 / x)) - sqrt((1.0 / x))))) + 1.0;
} else {
tmp = sqrt((x + 1.0)) - ((sqrt(x) + sqrt(y)) - t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
if (z <= 2d+15) then
tmp = (x * (((sqrt((z + 1.0d0)) + t_1) * (1.0d0 / x)) + (((sqrt(z) + sqrt(y)) * ((-1.0d0) / x)) - sqrt((1.0d0 / x))))) + 1.0d0
else
tmp = sqrt((x + 1.0d0)) - ((sqrt(x) + sqrt(y)) - t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double tmp;
if (z <= 2e+15) {
tmp = (x * (((Math.sqrt((z + 1.0)) + t_1) * (1.0 / x)) + (((Math.sqrt(z) + Math.sqrt(y)) * (-1.0 / x)) - Math.sqrt((1.0 / x))))) + 1.0;
} else {
tmp = Math.sqrt((x + 1.0)) - ((Math.sqrt(x) + Math.sqrt(y)) - t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if z <= 2e+15: tmp = (x * (((math.sqrt((z + 1.0)) + t_1) * (1.0 / x)) + (((math.sqrt(z) + math.sqrt(y)) * (-1.0 / x)) - math.sqrt((1.0 / x))))) + 1.0 else: tmp = math.sqrt((x + 1.0)) - ((math.sqrt(x) + math.sqrt(y)) - t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 2e+15) tmp = Float64(Float64(x * Float64(Float64(Float64(sqrt(Float64(z + 1.0)) + t_1) * Float64(1.0 / x)) + Float64(Float64(Float64(sqrt(z) + sqrt(y)) * Float64(-1.0 / x)) - sqrt(Float64(1.0 / x))))) + 1.0); else tmp = Float64(sqrt(Float64(x + 1.0)) - Float64(Float64(sqrt(x) + sqrt(y)) - t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
tmp = 0.0;
if (z <= 2e+15)
tmp = (x * (((sqrt((z + 1.0)) + t_1) * (1.0 / x)) + (((sqrt(z) + sqrt(y)) * (-1.0 / x)) - sqrt((1.0 / x))))) + 1.0;
else
tmp = sqrt((x + 1.0)) - ((sqrt(x) + sqrt(y)) - t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2e+15], N[(N[(x * N[(N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision] - N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 2 \cdot 10^{+15}:\\
\;\;\;\;x \cdot \left(\left(\sqrt{z + 1} + t\_1\right) \cdot \frac{1}{x} + \left(\left(\sqrt{z} + \sqrt{y}\right) \cdot \frac{-1}{x} - \sqrt{\frac{1}{x}}\right)\right) + 1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} - \left(\left(\sqrt{x} + \sqrt{y}\right) - t\_1\right)\\
\end{array}
\end{array}
if z < 2e15Initial program 96.1%
+-commutative96.1%
associate-+r+96.1%
associate-+r-76.4%
associate-+l-69.4%
associate-+r-56.3%
Simplified56.3%
Taylor expanded in t around inf 25.1%
associate--l+29.3%
associate--l+29.3%
associate-+r+29.3%
Simplified29.3%
Taylor expanded in x around 0 23.0%
associate--l+29.5%
associate--l+29.6%
associate-+r+29.6%
+-commutative29.6%
associate--l-29.6%
associate--l-29.6%
+-commutative29.6%
associate-+r+29.6%
associate--r+29.6%
Simplified29.6%
Taylor expanded in x around inf 26.7%
distribute-lft-out26.7%
+-commutative26.7%
distribute-lft-out26.7%
+-commutative26.7%
Simplified26.7%
if 2e15 < z Initial program 84.2%
+-commutative84.2%
associate-+r+84.2%
associate-+r-62.3%
associate-+l-47.7%
associate-+r-47.7%
Simplified24.9%
Taylor expanded in t around inf 4.0%
associate--l+22.1%
associate--l+24.7%
associate-+r+24.7%
Simplified24.7%
Taylor expanded in z around inf 31.8%
+-commutative31.8%
Simplified31.8%
Final simplification29.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))))
(if (<= z 1.4e+19)
(+ (+ t_1 (- (- (sqrt (+ z 1.0)) (sqrt x)) (+ (sqrt z) (sqrt y)))) 1.0)
(- (sqrt (+ x 1.0)) (- (+ (sqrt x) (sqrt y)) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double tmp;
if (z <= 1.4e+19) {
tmp = (t_1 + ((sqrt((z + 1.0)) - sqrt(x)) - (sqrt(z) + sqrt(y)))) + 1.0;
} else {
tmp = sqrt((x + 1.0)) - ((sqrt(x) + sqrt(y)) - t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
if (z <= 1.4d+19) then
tmp = (t_1 + ((sqrt((z + 1.0d0)) - sqrt(x)) - (sqrt(z) + sqrt(y)))) + 1.0d0
else
tmp = sqrt((x + 1.0d0)) - ((sqrt(x) + sqrt(y)) - t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double tmp;
if (z <= 1.4e+19) {
tmp = (t_1 + ((Math.sqrt((z + 1.0)) - Math.sqrt(x)) - (Math.sqrt(z) + Math.sqrt(y)))) + 1.0;
} else {
tmp = Math.sqrt((x + 1.0)) - ((Math.sqrt(x) + Math.sqrt(y)) - t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if z <= 1.4e+19: tmp = (t_1 + ((math.sqrt((z + 1.0)) - math.sqrt(x)) - (math.sqrt(z) + math.sqrt(y)))) + 1.0 else: tmp = math.sqrt((x + 1.0)) - ((math.sqrt(x) + math.sqrt(y)) - t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 1.4e+19) tmp = Float64(Float64(t_1 + Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(x)) - Float64(sqrt(z) + sqrt(y)))) + 1.0); else tmp = Float64(sqrt(Float64(x + 1.0)) - Float64(Float64(sqrt(x) + sqrt(y)) - t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
tmp = 0.0;
if (z <= 1.4e+19)
tmp = (t_1 + ((sqrt((z + 1.0)) - sqrt(x)) - (sqrt(z) + sqrt(y)))) + 1.0;
else
tmp = sqrt((x + 1.0)) - ((sqrt(x) + sqrt(y)) - t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.4e+19], N[(N[(t$95$1 + N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 1.4 \cdot 10^{+19}:\\
\;\;\;\;\left(t\_1 + \left(\left(\sqrt{z + 1} - \sqrt{x}\right) - \left(\sqrt{z} + \sqrt{y}\right)\right)\right) + 1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} - \left(\left(\sqrt{x} + \sqrt{y}\right) - t\_1\right)\\
\end{array}
\end{array}
if z < 1.4e19Initial program 96.1%
+-commutative96.1%
associate-+r+96.1%
associate-+r-76.4%
associate-+l-69.4%
associate-+r-56.3%
Simplified56.3%
Taylor expanded in t around inf 25.1%
associate--l+29.3%
associate--l+29.3%
associate-+r+29.3%
Simplified29.3%
Taylor expanded in x around 0 23.0%
associate--l+29.5%
associate--l+29.6%
associate-+r+29.6%
+-commutative29.6%
associate--l-29.6%
associate--l-29.6%
+-commutative29.6%
associate-+r+29.6%
associate--r+29.6%
Simplified29.6%
if 1.4e19 < z Initial program 84.2%
+-commutative84.2%
associate-+r+84.2%
associate-+r-62.3%
associate-+l-47.7%
associate-+r-47.7%
Simplified24.9%
Taylor expanded in t around inf 4.0%
associate--l+22.1%
associate--l+24.7%
associate-+r+24.7%
Simplified24.7%
Taylor expanded in z around inf 31.8%
+-commutative31.8%
Simplified31.8%
Final simplification30.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))))
(if (<= z 5.6e+14)
(- (+ (+ (sqrt (+ z 1.0)) t_1) 1.0) (+ (sqrt x) (+ (sqrt z) (sqrt y))))
(- (sqrt (+ x 1.0)) (- (+ (sqrt x) (sqrt y)) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double tmp;
if (z <= 5.6e+14) {
tmp = ((sqrt((z + 1.0)) + t_1) + 1.0) - (sqrt(x) + (sqrt(z) + sqrt(y)));
} else {
tmp = sqrt((x + 1.0)) - ((sqrt(x) + sqrt(y)) - t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
if (z <= 5.6d+14) then
tmp = ((sqrt((z + 1.0d0)) + t_1) + 1.0d0) - (sqrt(x) + (sqrt(z) + sqrt(y)))
else
tmp = sqrt((x + 1.0d0)) - ((sqrt(x) + sqrt(y)) - t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double tmp;
if (z <= 5.6e+14) {
tmp = ((Math.sqrt((z + 1.0)) + t_1) + 1.0) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y)));
} else {
tmp = Math.sqrt((x + 1.0)) - ((Math.sqrt(x) + Math.sqrt(y)) - t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if z <= 5.6e+14: tmp = ((math.sqrt((z + 1.0)) + t_1) + 1.0) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y))) else: tmp = math.sqrt((x + 1.0)) - ((math.sqrt(x) + math.sqrt(y)) - t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 5.6e+14) tmp = Float64(Float64(Float64(sqrt(Float64(z + 1.0)) + t_1) + 1.0) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y)))); else tmp = Float64(sqrt(Float64(x + 1.0)) - Float64(Float64(sqrt(x) + sqrt(y)) - t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
tmp = 0.0;
if (z <= 5.6e+14)
tmp = ((sqrt((z + 1.0)) + t_1) + 1.0) - (sqrt(x) + (sqrt(z) + sqrt(y)));
else
tmp = sqrt((x + 1.0)) - ((sqrt(x) + sqrt(y)) - t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 5.6e+14], N[(N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] + 1.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 5.6 \cdot 10^{+14}:\\
\;\;\;\;\left(\left(\sqrt{z + 1} + t\_1\right) + 1\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} - \left(\left(\sqrt{x} + \sqrt{y}\right) - t\_1\right)\\
\end{array}
\end{array}
if z < 5.6e14Initial program 96.1%
+-commutative96.1%
associate-+r+96.1%
associate-+r-76.4%
associate-+l-69.4%
associate-+r-56.3%
Simplified56.3%
Taylor expanded in t around inf 25.1%
associate--l+29.3%
associate--l+29.3%
associate-+r+29.3%
Simplified29.3%
Taylor expanded in x around 0 23.0%
if 5.6e14 < z Initial program 84.2%
+-commutative84.2%
associate-+r+84.2%
associate-+r-62.3%
associate-+l-47.7%
associate-+r-47.7%
Simplified24.9%
Taylor expanded in t around inf 4.0%
associate--l+22.1%
associate--l+24.7%
associate-+r+24.7%
Simplified24.7%
Taylor expanded in z around inf 31.8%
+-commutative31.8%
Simplified31.8%
Final simplification27.4%
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 480000000000.0) (+ 2.0 (- (- (sqrt (+ z 1.0)) (sqrt x)) (+ (sqrt z) (sqrt y)))) (+ (sqrt (+ x 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 tmp;
if (z <= 480000000000.0) {
tmp = 2.0 + ((sqrt((z + 1.0)) - sqrt(x)) - (sqrt(z) + sqrt(y)));
} else {
tmp = sqrt((x + 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) :: tmp
if (z <= 480000000000.0d0) then
tmp = 2.0d0 + ((sqrt((z + 1.0d0)) - sqrt(x)) - (sqrt(z) + sqrt(y)))
else
tmp = sqrt((x + 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 tmp;
if (z <= 480000000000.0) {
tmp = 2.0 + ((Math.sqrt((z + 1.0)) - Math.sqrt(x)) - (Math.sqrt(z) + Math.sqrt(y)));
} else {
tmp = Math.sqrt((x + 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): tmp = 0 if z <= 480000000000.0: tmp = 2.0 + ((math.sqrt((z + 1.0)) - math.sqrt(x)) - (math.sqrt(z) + math.sqrt(y))) else: tmp = math.sqrt((x + 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) tmp = 0.0 if (z <= 480000000000.0) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(x)) - Float64(sqrt(z) + sqrt(y)))); else tmp = Float64(sqrt(Float64(x + 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)
tmp = 0.0;
if (z <= 480000000000.0)
tmp = 2.0 + ((sqrt((z + 1.0)) - sqrt(x)) - (sqrt(z) + sqrt(y)));
else
tmp = sqrt((x + 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_] := If[LessEqual[z, 480000000000.0], N[(2.0 + N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 480000000000:\\
\;\;\;\;2 + \left(\left(\sqrt{z + 1} - \sqrt{x}\right) - \left(\sqrt{z} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\sqrt{y + 1} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 4.8e11Initial program 96.3%
+-commutative96.3%
associate-+r+96.3%
associate-+r-76.5%
associate-+l-69.4%
associate-+r-56.1%
Simplified56.1%
Taylor expanded in t around inf 25.0%
associate--l+29.1%
associate--l+29.2%
associate-+r+29.2%
Simplified29.2%
Taylor expanded in x around 0 22.8%
associate--l+29.4%
associate--l+29.4%
associate-+r+29.4%
+-commutative29.4%
associate--l-29.4%
associate--l-29.4%
+-commutative29.4%
associate-+r+29.4%
associate--r+29.4%
Simplified29.4%
Taylor expanded in y around 0 18.4%
associate--l+18.4%
associate--r+18.4%
+-commutative18.4%
Simplified18.4%
if 4.8e11 < z Initial program 84.1%
+-commutative84.1%
associate-+r+84.1%
associate-+r-62.4%
associate-+l-47.9%
associate-+r-47.9%
Simplified25.2%
Taylor expanded in t around inf 4.3%
associate--l+22.3%
associate--l+24.9%
associate-+r+24.9%
Simplified24.9%
Taylor expanded in y around inf 32.5%
mul-1-neg32.5%
Simplified32.5%
Final simplification25.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 58000000000.0) (+ 2.0 (- (- (sqrt (+ z 1.0)) (sqrt x)) (+ (sqrt z) (sqrt y)))) (- (sqrt (+ x 1.0)) (- (+ (sqrt x) (sqrt y)) (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 <= 58000000000.0) {
tmp = 2.0 + ((sqrt((z + 1.0)) - sqrt(x)) - (sqrt(z) + sqrt(y)));
} else {
tmp = sqrt((x + 1.0)) - ((sqrt(x) + sqrt(y)) - 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 <= 58000000000.0d0) then
tmp = 2.0d0 + ((sqrt((z + 1.0d0)) - sqrt(x)) - (sqrt(z) + sqrt(y)))
else
tmp = sqrt((x + 1.0d0)) - ((sqrt(x) + sqrt(y)) - 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 <= 58000000000.0) {
tmp = 2.0 + ((Math.sqrt((z + 1.0)) - Math.sqrt(x)) - (Math.sqrt(z) + Math.sqrt(y)));
} else {
tmp = Math.sqrt((x + 1.0)) - ((Math.sqrt(x) + Math.sqrt(y)) - 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 <= 58000000000.0: tmp = 2.0 + ((math.sqrt((z + 1.0)) - math.sqrt(x)) - (math.sqrt(z) + math.sqrt(y))) else: tmp = math.sqrt((x + 1.0)) - ((math.sqrt(x) + math.sqrt(y)) - 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 <= 58000000000.0) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(x)) - Float64(sqrt(z) + sqrt(y)))); else tmp = Float64(sqrt(Float64(x + 1.0)) - Float64(Float64(sqrt(x) + sqrt(y)) - sqrt(Float64(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 <= 58000000000.0)
tmp = 2.0 + ((sqrt((z + 1.0)) - sqrt(x)) - (sqrt(z) + sqrt(y)));
else
tmp = sqrt((x + 1.0)) - ((sqrt(x) + sqrt(y)) - 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, 58000000000.0], N[(2.0 + N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[N[(y + 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 58000000000:\\
\;\;\;\;2 + \left(\left(\sqrt{z + 1} - \sqrt{x}\right) - \left(\sqrt{z} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} - \left(\left(\sqrt{x} + \sqrt{y}\right) - \sqrt{y + 1}\right)\\
\end{array}
\end{array}
if z < 5.8e10Initial program 96.3%
+-commutative96.3%
associate-+r+96.3%
associate-+r-76.5%
associate-+l-69.4%
associate-+r-56.1%
Simplified56.1%
Taylor expanded in t around inf 25.0%
associate--l+29.1%
associate--l+29.2%
associate-+r+29.2%
Simplified29.2%
Taylor expanded in x around 0 22.8%
associate--l+29.4%
associate--l+29.4%
associate-+r+29.4%
+-commutative29.4%
associate--l-29.4%
associate--l-29.4%
+-commutative29.4%
associate-+r+29.4%
associate--r+29.4%
Simplified29.4%
Taylor expanded in y around 0 18.4%
associate--l+18.4%
associate--r+18.4%
+-commutative18.4%
Simplified18.4%
if 5.8e10 < z Initial program 84.1%
+-commutative84.1%
associate-+r+84.1%
associate-+r-62.4%
associate-+l-47.9%
associate-+r-47.9%
Simplified25.2%
Taylor expanded in t around inf 4.3%
associate--l+22.3%
associate--l+24.9%
associate-+r+24.9%
Simplified24.9%
Taylor expanded in z around inf 31.9%
+-commutative31.9%
Simplified31.9%
Final simplification25.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 1.58e-24) (- (+ 2.0 (+ (sqrt (+ z 1.0)) 1.0)) (sqrt x)) (- 1.0 (- (+ (sqrt x) (sqrt y)) (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 <= 1.58e-24) {
tmp = (2.0 + (sqrt((z + 1.0)) + 1.0)) - sqrt(x);
} else {
tmp = 1.0 - ((sqrt(x) + sqrt(y)) - 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 <= 1.58d-24) then
tmp = (2.0d0 + (sqrt((z + 1.0d0)) + 1.0d0)) - sqrt(x)
else
tmp = 1.0d0 - ((sqrt(x) + sqrt(y)) - 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 <= 1.58e-24) {
tmp = (2.0 + (Math.sqrt((z + 1.0)) + 1.0)) - Math.sqrt(x);
} else {
tmp = 1.0 - ((Math.sqrt(x) + Math.sqrt(y)) - 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 <= 1.58e-24: tmp = (2.0 + (math.sqrt((z + 1.0)) + 1.0)) - math.sqrt(x) else: tmp = 1.0 - ((math.sqrt(x) + math.sqrt(y)) - 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 <= 1.58e-24) tmp = Float64(Float64(2.0 + Float64(sqrt(Float64(z + 1.0)) + 1.0)) - sqrt(x)); else tmp = Float64(1.0 - Float64(Float64(sqrt(x) + sqrt(y)) - sqrt(Float64(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 <= 1.58e-24)
tmp = (2.0 + (sqrt((z + 1.0)) + 1.0)) - sqrt(x);
else
tmp = 1.0 - ((sqrt(x) + sqrt(y)) - 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, 1.58e-24], N[(N[(2.0 + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[N[(y + 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 1.58 \cdot 10^{-24}:\\
\;\;\;\;\left(2 + \left(\sqrt{z + 1} + 1\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;1 - \left(\left(\sqrt{x} + \sqrt{y}\right) - \sqrt{y + 1}\right)\\
\end{array}
\end{array}
if z < 1.5799999999999999e-24Initial program 96.7%
+-commutative96.7%
associate-+r+96.7%
associate-+r-77.9%
associate-+l-70.8%
associate-+r-57.0%
Simplified57.0%
Taylor expanded in x around 0 33.2%
Taylor expanded in y around 0 12.5%
Taylor expanded in x around inf 15.3%
Taylor expanded in t around 0 19.0%
if 1.5799999999999999e-24 < z Initial program 84.5%
+-commutative84.5%
associate-+r+84.5%
associate-+r-62.3%
associate-+l-48.3%
associate-+r-47.8%
Simplified26.7%
Taylor expanded in t around inf 4.4%
associate--l+21.6%
associate--l+24.0%
associate-+r+24.0%
Simplified24.0%
Taylor expanded in x around 0 3.9%
associate--l+28.4%
associate--l+29.7%
associate-+r+29.7%
+-commutative29.7%
associate--l-29.7%
associate--l-29.7%
+-commutative29.7%
associate-+r+29.7%
associate--r+29.7%
Simplified29.7%
Taylor expanded in z around inf 34.4%
Final simplification27.4%
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 3.8e-24) (- (+ 2.0 (+ (sqrt (+ z 1.0)) 1.0)) (sqrt x)) (+ (sqrt (+ x 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 tmp;
if (z <= 3.8e-24) {
tmp = (2.0 + (sqrt((z + 1.0)) + 1.0)) - sqrt(x);
} else {
tmp = sqrt((x + 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) :: tmp
if (z <= 3.8d-24) then
tmp = (2.0d0 + (sqrt((z + 1.0d0)) + 1.0d0)) - sqrt(x)
else
tmp = sqrt((x + 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 tmp;
if (z <= 3.8e-24) {
tmp = (2.0 + (Math.sqrt((z + 1.0)) + 1.0)) - Math.sqrt(x);
} else {
tmp = Math.sqrt((x + 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): tmp = 0 if z <= 3.8e-24: tmp = (2.0 + (math.sqrt((z + 1.0)) + 1.0)) - math.sqrt(x) else: tmp = math.sqrt((x + 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) tmp = 0.0 if (z <= 3.8e-24) tmp = Float64(Float64(2.0 + Float64(sqrt(Float64(z + 1.0)) + 1.0)) - sqrt(x)); else tmp = Float64(sqrt(Float64(x + 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)
tmp = 0.0;
if (z <= 3.8e-24)
tmp = (2.0 + (sqrt((z + 1.0)) + 1.0)) - sqrt(x);
else
tmp = sqrt((x + 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_] := If[LessEqual[z, 3.8e-24], N[(N[(2.0 + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.8 \cdot 10^{-24}:\\
\;\;\;\;\left(2 + \left(\sqrt{z + 1} + 1\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\sqrt{y + 1} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 3.80000000000000026e-24Initial program 96.7%
+-commutative96.7%
associate-+r+96.7%
associate-+r-77.9%
associate-+l-70.8%
associate-+r-57.0%
Simplified57.0%
Taylor expanded in x around 0 33.2%
Taylor expanded in y around 0 12.5%
Taylor expanded in x around inf 15.3%
Taylor expanded in t around 0 19.0%
if 3.80000000000000026e-24 < z Initial program 84.5%
+-commutative84.5%
associate-+r+84.5%
associate-+r-62.3%
associate-+l-48.3%
associate-+r-47.8%
Simplified26.7%
Taylor expanded in t around inf 4.4%
associate--l+21.6%
associate--l+24.0%
associate-+r+24.0%
Simplified24.0%
Taylor expanded in y around inf 31.1%
mul-1-neg31.1%
Simplified31.1%
Final simplification25.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 0.8) (- (+ 2.0 (+ (sqrt (+ z 1.0)) 1.0)) (sqrt x)) (- (sqrt (+ x 1.0)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.8) {
tmp = (2.0 + (sqrt((z + 1.0)) + 1.0)) - sqrt(x);
} else {
tmp = sqrt((x + 1.0)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 0.8d0) then
tmp = (2.0d0 + (sqrt((z + 1.0d0)) + 1.0d0)) - sqrt(x)
else
tmp = sqrt((x + 1.0d0)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.8) {
tmp = (2.0 + (Math.sqrt((z + 1.0)) + 1.0)) - Math.sqrt(x);
} else {
tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.8: tmp = (2.0 + (math.sqrt((z + 1.0)) + 1.0)) - math.sqrt(x) else: tmp = math.sqrt((x + 1.0)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.8) tmp = Float64(Float64(2.0 + Float64(sqrt(Float64(z + 1.0)) + 1.0)) - sqrt(x)); else tmp = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 0.8)
tmp = (2.0 + (sqrt((z + 1.0)) + 1.0)) - sqrt(x);
else
tmp = sqrt((x + 1.0)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 0.8], N[(N[(2.0 + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.8:\\
\;\;\;\;\left(2 + \left(\sqrt{z + 1} + 1\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
\end{array}
\end{array}
if z < 0.80000000000000004Initial program 96.7%
+-commutative96.7%
associate-+r+96.7%
associate-+r-76.9%
associate-+l-70.2%
associate-+r-56.8%
Simplified56.8%
Taylor expanded in x around 0 32.2%
Taylor expanded in y around 0 12.7%
Taylor expanded in x around inf 15.3%
Taylor expanded in t around 0 19.0%
if 0.80000000000000004 < z Initial program 83.9%
+-commutative83.9%
associate-+r+83.9%
associate-+r-62.3%
associate-+l-47.6%
associate-+r-47.4%
Simplified25.3%
Taylor expanded in t around inf 4.3%
associate--l+22.1%
associate--l+24.6%
associate-+r+24.6%
Simplified24.6%
Taylor expanded in y around -inf 0.0%
mul-1-neg0.0%
*-commutative0.0%
distribute-rgt-neg-in0.0%
Simplified27.0%
Taylor expanded in x around inf 23.1%
Taylor expanded in x around inf 21.8%
mul-1-neg21.8%
Simplified21.8%
Final simplification20.4%
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 90.1%
+-commutative90.1%
associate-+r+90.1%
associate-+r-69.3%
associate-+l-58.5%
associate-+r-52.0%
Simplified40.4%
Taylor expanded in t around inf 14.5%
associate--l+25.7%
associate--l+27.0%
associate-+r+27.0%
Simplified27.0%
Taylor expanded in y around -inf 0.0%
mul-1-neg0.0%
*-commutative0.0%
distribute-rgt-neg-in0.0%
Simplified27.5%
Taylor expanded in x around inf 24.9%
Taylor expanded in x around inf 17.0%
mul-1-neg17.0%
Simplified17.0%
Final simplification17.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)) (* y 0.0)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt((x + 1.0)) + (y * 0.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((x + 1.0d0)) + (y * 0.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((x + 1.0)) + (y * 0.0);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt((x + 1.0)) + (y * 0.0)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(sqrt(Float64(x + 1.0)) + Float64(y * 0.0)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt((x + 1.0)) + (y * 0.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[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(y * 0.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{x + 1} + y \cdot 0
\end{array}
Initial program 90.1%
+-commutative90.1%
associate-+r+90.1%
associate-+r-69.3%
associate-+l-58.5%
associate-+r-52.0%
Simplified40.4%
Taylor expanded in t around inf 14.5%
associate--l+25.7%
associate--l+27.0%
associate-+r+27.0%
Simplified27.0%
Taylor expanded in y around -inf 0.0%
mul-1-neg0.0%
*-commutative0.0%
distribute-rgt-neg-in0.0%
Simplified27.5%
Taylor expanded in y around inf 17.6%
distribute-rgt1-in17.6%
metadata-eval17.6%
mul0-lft17.6%
Simplified17.6%
Final simplification17.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* 0.5 (sqrt (/ 1.0 t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 0.5 * sqrt((1.0 / t));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 0.5d0 * sqrt((1.0d0 / t))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 0.5 * Math.sqrt((1.0 / t));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 0.5 * math.sqrt((1.0 / t))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(0.5 * sqrt(Float64(1.0 / t))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 0.5 * sqrt((1.0 / t));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
0.5 \cdot \sqrt{\frac{1}{t}}
\end{array}
Initial program 90.1%
+-commutative90.1%
associate-+r+90.1%
associate-+r-69.3%
associate-+l-58.5%
associate-+r-52.0%
Simplified40.4%
Taylor expanded in x around 0 22.3%
Taylor expanded in y around 0 7.8%
Taylor expanded in t around inf 11.0%
associate--r+11.0%
associate-+r+11.0%
+-commutative11.0%
Simplified11.0%
Taylor expanded in t around 0 9.3%
Final simplification9.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* 0.5 (sqrt (/ 1.0 z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 0.5 * sqrt((1.0 / z));
}
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 = 0.5d0 * sqrt((1.0d0 / z))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 0.5 * Math.sqrt((1.0 / z));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 0.5 * math.sqrt((1.0 / z))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(0.5 * sqrt(Float64(1.0 / z))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 0.5 * sqrt((1.0 / z));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
0.5 \cdot \sqrt{\frac{1}{z}}
\end{array}
Initial program 90.1%
+-commutative90.1%
associate-+r+90.1%
associate-+r-69.3%
associate-+l-58.5%
associate-+r-52.0%
Simplified40.4%
Taylor expanded in x around 0 22.3%
flip--22.3%
add-sqr-sqrt17.0%
add-sqr-sqrt22.2%
+-commutative22.2%
+-commutative22.2%
Applied egg-rr22.2%
associate--r+22.4%
+-inverses22.4%
metadata-eval22.4%
Simplified22.4%
Taylor expanded in z around inf 18.5%
Taylor expanded in z around 0 7.1%
Final simplification7.1%
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) (- -2.0)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt(x) * -(-2.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(x) * -(-2.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(x) * -(-2.0);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt(x) * -(-2.0)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(sqrt(x) * Float64(-(-2.0))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt(x) * -(-2.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[Sqrt[x], $MachinePrecision] * (--2.0)), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{x} \cdot \left(--2\right)
\end{array}
Initial program 90.1%
+-commutative90.1%
associate-+r+90.1%
associate-+r-69.3%
associate-+l-58.5%
associate-+r-52.0%
Simplified40.4%
Taylor expanded in t around inf 14.5%
associate--l+25.7%
associate--l+27.0%
associate-+r+27.0%
Simplified27.0%
Taylor expanded in y around -inf 0.0%
mul-1-neg0.0%
*-commutative0.0%
distribute-rgt-neg-in0.0%
Simplified27.5%
Taylor expanded in x around inf 24.9%
Taylor expanded in x around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt6.7%
mul-1-neg6.7%
Simplified6.7%
Final simplification6.7%
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.0))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return x * 0.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 = x * 0.0d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return x * 0.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return x * 0.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(x * 0.0) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = x * 0.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(x * 0.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
x \cdot 0
\end{array}
Initial program 90.1%
+-commutative90.1%
associate-+r+90.1%
associate-+r-69.3%
associate-+l-58.5%
associate-+r-52.0%
Simplified40.4%
Taylor expanded in t around inf 14.5%
associate--l+25.7%
associate--l+27.0%
associate-+r+27.0%
Simplified27.0%
Taylor expanded in y around -inf 0.0%
mul-1-neg0.0%
*-commutative0.0%
distribute-rgt-neg-in0.0%
Simplified27.5%
Taylor expanded in x around inf 3.1%
distribute-rgt1-in3.1%
metadata-eval3.1%
mul0-lft3.1%
Simplified3.1%
Final simplification3.1%
(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 2024096
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))