
(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 17 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 (+ (+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))) (+ (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))) (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (1.0 / (sqrt(t) + 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 = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + ((1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + (1.0d0 / (sqrt(t) + 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 ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + ((1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + ((1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (1.0 / (math.sqrt(t) + math.sqrt((1.0 + t)))))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (1.0 / (sqrt(t) + 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[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \frac{1}{\sqrt{t} + \sqrt{1 + t}}\right)
\end{array}
Initial program 89.6%
associate-+l+89.6%
+-commutative89.6%
+-commutative89.6%
+-commutative89.6%
Simplified89.6%
flip--89.6%
add-sqr-sqrt70.8%
+-commutative70.8%
add-sqr-sqrt89.9%
+-commutative89.9%
Applied egg-rr89.9%
associate--l+92.2%
+-inverses92.2%
metadata-eval92.2%
Simplified92.2%
flip--92.5%
add-sqr-sqrt66.6%
add-sqr-sqrt92.7%
Applied egg-rr92.7%
associate--l+94.4%
+-inverses94.4%
metadata-eval94.4%
Simplified94.4%
flip--94.7%
add-sqr-sqrt73.1%
add-sqr-sqrt94.9%
Applied egg-rr94.9%
associate--l+96.7%
+-inverses96.7%
metadata-eval96.7%
Simplified96.7%
flip--96.9%
add-sqr-sqrt74.0%
+-commutative74.0%
add-sqr-sqrt97.5%
+-commutative97.5%
Applied egg-rr97.5%
+-commutative97.5%
+-commutative97.5%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Final simplification99.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y)))
(t_2 (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))
(t_3 (sqrt (+ 1.0 x))))
(if (<= t 6.6e+27)
(+
(+ t_2 (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))))
(+ (- t_1 (sqrt y)) (- t_3 (sqrt x))))
(+ (+ (/ 1.0 (+ t_3 (sqrt x))) (/ 1.0 (+ t_1 (sqrt y)))) t_2))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = 1.0 / (sqrt((1.0 + z)) + sqrt(z));
double t_3 = sqrt((1.0 + x));
double tmp;
if (t <= 6.6e+27) {
tmp = (t_2 + (1.0 / (sqrt(t) + sqrt((1.0 + t))))) + ((t_1 - sqrt(y)) + (t_3 - sqrt(x)));
} else {
tmp = ((1.0 / (t_3 + sqrt(x))) + (1.0 / (t_1 + sqrt(y)))) + 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) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = 1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))
t_3 = sqrt((1.0d0 + x))
if (t <= 6.6d+27) then
tmp = (t_2 + (1.0d0 / (sqrt(t) + sqrt((1.0d0 + t))))) + ((t_1 - sqrt(y)) + (t_3 - sqrt(x)))
else
tmp = ((1.0d0 / (t_3 + sqrt(x))) + (1.0d0 / (t_1 + sqrt(y)))) + t_2
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = 1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z));
double t_3 = Math.sqrt((1.0 + x));
double tmp;
if (t <= 6.6e+27) {
tmp = (t_2 + (1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t))))) + ((t_1 - Math.sqrt(y)) + (t_3 - Math.sqrt(x)));
} else {
tmp = ((1.0 / (t_3 + Math.sqrt(x))) + (1.0 / (t_1 + Math.sqrt(y)))) + t_2;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = 1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z)) t_3 = math.sqrt((1.0 + x)) tmp = 0 if t <= 6.6e+27: tmp = (t_2 + (1.0 / (math.sqrt(t) + math.sqrt((1.0 + t))))) + ((t_1 - math.sqrt(y)) + (t_3 - math.sqrt(x))) else: tmp = ((1.0 / (t_3 + math.sqrt(x))) + (1.0 / (t_1 + math.sqrt(y)))) + t_2 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) t_3 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (t <= 6.6e+27) tmp = Float64(Float64(t_2 + Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t))))) + Float64(Float64(t_1 - sqrt(y)) + Float64(t_3 - sqrt(x)))); else tmp = Float64(Float64(Float64(1.0 / Float64(t_3 + sqrt(x))) + Float64(1.0 / Float64(t_1 + sqrt(y)))) + t_2); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = 1.0 / (sqrt((1.0 + z)) + sqrt(z));
t_3 = sqrt((1.0 + x));
tmp = 0.0;
if (t <= 6.6e+27)
tmp = (t_2 + (1.0 / (sqrt(t) + sqrt((1.0 + t))))) + ((t_1 - sqrt(y)) + (t_3 - sqrt(x)));
else
tmp = ((1.0 / (t_3 + sqrt(x))) + (1.0 / (t_1 + sqrt(y)))) + t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 6.6e+27], N[(N[(t$95$2 + N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(t$95$3 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
t_3 := \sqrt{1 + x}\\
\mathbf{if}\;t \leq 6.6 \cdot 10^{+27}:\\
\;\;\;\;\left(t_2 + \frac{1}{\sqrt{t} + \sqrt{1 + t}}\right) + \left(\left(t_1 - \sqrt{y}\right) + \left(t_3 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t_3 + \sqrt{x}} + \frac{1}{t_1 + \sqrt{y}}\right) + t_2\\
\end{array}
\end{array}
if t < 6.5999999999999996e27Initial program 94.7%
associate-+l+94.7%
+-commutative94.7%
+-commutative94.7%
+-commutative94.7%
Simplified94.7%
flip--97.9%
add-sqr-sqrt98.1%
+-commutative98.1%
add-sqr-sqrt98.9%
+-commutative98.9%
Applied egg-rr95.9%
+-commutative98.9%
+-commutative98.9%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified96.8%
flip--96.9%
add-sqr-sqrt74.2%
add-sqr-sqrt97.4%
Applied egg-rr97.5%
associate--l+97.6%
+-inverses97.6%
metadata-eval97.6%
Simplified97.7%
if 6.5999999999999996e27 < t Initial program 82.6%
associate-+l+82.6%
+-commutative82.6%
+-commutative82.6%
+-commutative82.6%
Simplified82.6%
flip--82.6%
add-sqr-sqrt65.0%
+-commutative65.0%
add-sqr-sqrt82.9%
+-commutative82.9%
Applied egg-rr82.9%
associate--l+87.9%
+-inverses87.9%
metadata-eval87.9%
Simplified87.9%
flip--87.9%
add-sqr-sqrt61.4%
add-sqr-sqrt88.0%
Applied egg-rr88.0%
associate--l+91.5%
+-inverses91.5%
metadata-eval91.5%
Simplified91.5%
flip--91.6%
add-sqr-sqrt71.5%
add-sqr-sqrt91.6%
Applied egg-rr91.6%
associate--l+95.5%
+-inverses95.5%
metadata-eval95.5%
Simplified95.5%
Taylor expanded in t around inf 95.5%
Final simplification96.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))) (+ (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))) (- (sqrt (+ 1.0 t)) (sqrt t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + ((1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + (sqrt((1.0d0 + t)) - sqrt(t)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + ((1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + ((1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (math.sqrt((1.0 + t)) - math.sqrt(t)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\end{array}
Initial program 89.6%
associate-+l+89.6%
+-commutative89.6%
+-commutative89.6%
+-commutative89.6%
Simplified89.6%
flip--89.6%
add-sqr-sqrt70.8%
+-commutative70.8%
add-sqr-sqrt89.9%
+-commutative89.9%
Applied egg-rr89.9%
associate--l+92.2%
+-inverses92.2%
metadata-eval92.2%
Simplified92.2%
flip--92.5%
add-sqr-sqrt66.6%
add-sqr-sqrt92.7%
Applied egg-rr92.7%
associate--l+94.4%
+-inverses94.4%
metadata-eval94.4%
Simplified94.4%
flip--94.7%
add-sqr-sqrt73.1%
add-sqr-sqrt94.9%
Applied egg-rr94.9%
associate--l+96.7%
+-inverses96.7%
metadata-eval96.7%
Simplified96.7%
Final simplification96.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 y))))
(if (<= t 6.5e+27)
(+
(+ 1.0 (- t_2 (sqrt y)))
(+ (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))) (- t_1 (sqrt z))))
(+
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ t_2 (sqrt y))))
(/ 1.0 (+ t_1 (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + y));
double tmp;
if (t <= 6.5e+27) {
tmp = (1.0 + (t_2 - sqrt(y))) + ((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + (t_1 - sqrt(z)));
} else {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (t_2 + sqrt(y)))) + (1.0 / (t_1 + sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + y))
if (t <= 6.5d+27) then
tmp = (1.0d0 + (t_2 - sqrt(y))) + ((1.0d0 / (sqrt(t) + sqrt((1.0d0 + t)))) + (t_1 - sqrt(z)))
else
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (t_2 + sqrt(y)))) + (1.0d0 / (t_1 + sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (t <= 6.5e+27) {
tmp = (1.0 + (t_2 - Math.sqrt(y))) + ((1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))) + (t_1 - Math.sqrt(z)));
} else {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (t_2 + Math.sqrt(y)))) + (1.0 / (t_1 + Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + y)) tmp = 0 if t <= 6.5e+27: tmp = (1.0 + (t_2 - math.sqrt(y))) + ((1.0 / (math.sqrt(t) + math.sqrt((1.0 + t)))) + (t_1 - math.sqrt(z))) else: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (t_2 + math.sqrt(y)))) + (1.0 / (t_1 + math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t <= 6.5e+27) tmp = Float64(Float64(1.0 + Float64(t_2 - sqrt(y))) + Float64(Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))) + Float64(t_1 - sqrt(z)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(t_2 + sqrt(y)))) + Float64(1.0 / Float64(t_1 + sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (t <= 6.5e+27)
tmp = (1.0 + (t_2 - sqrt(y))) + ((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + (t_1 - sqrt(z)));
else
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (t_2 + sqrt(y)))) + (1.0 / (t_1 + sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 6.5e+27], N[(N[(1.0 + N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;t \leq 6.5 \cdot 10^{+27}:\\
\;\;\;\;\left(1 + \left(t_2 - \sqrt{y}\right)\right) + \left(\frac{1}{\sqrt{t} + \sqrt{1 + t}} + \left(t_1 - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{t_2 + \sqrt{y}}\right) + \frac{1}{t_1 + \sqrt{z}}\\
\end{array}
\end{array}
if t < 6.5000000000000005e27Initial program 94.7%
associate-+l+94.7%
+-commutative94.7%
+-commutative94.7%
+-commutative94.7%
Simplified94.7%
flip--97.9%
add-sqr-sqrt98.1%
+-commutative98.1%
add-sqr-sqrt98.9%
+-commutative98.9%
Applied egg-rr95.9%
+-commutative98.9%
+-commutative98.9%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified96.8%
Taylor expanded in x around 0 59.7%
if 6.5000000000000005e27 < t Initial program 82.6%
associate-+l+82.6%
+-commutative82.6%
+-commutative82.6%
+-commutative82.6%
Simplified82.6%
flip--82.6%
add-sqr-sqrt65.0%
+-commutative65.0%
add-sqr-sqrt82.9%
+-commutative82.9%
Applied egg-rr82.9%
associate--l+87.9%
+-inverses87.9%
metadata-eval87.9%
Simplified87.9%
flip--87.9%
add-sqr-sqrt61.4%
add-sqr-sqrt88.0%
Applied egg-rr88.0%
associate--l+91.5%
+-inverses91.5%
metadata-eval91.5%
Simplified91.5%
flip--91.6%
add-sqr-sqrt71.5%
add-sqr-sqrt91.6%
Applied egg-rr91.6%
associate--l+95.5%
+-inverses95.5%
metadata-eval95.5%
Simplified95.5%
Taylor expanded in t around inf 95.5%
Final simplification74.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z)))
(t_2 (- (sqrt (+ 1.0 y)) (sqrt y))))
(if (<= z 50000000.0)
(+ (+ 1.0 t_2) (+ (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))) t_1))
(+ t_1 (+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) t_2)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double t_2 = sqrt((1.0 + y)) - sqrt(y);
double tmp;
if (z <= 50000000.0) {
tmp = (1.0 + t_2) + ((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + t_1);
} else {
tmp = t_1 + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + t_2);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
t_2 = sqrt((1.0d0 + y)) - sqrt(y)
if (z <= 50000000.0d0) then
tmp = (1.0d0 + t_2) + ((1.0d0 / (sqrt(t) + sqrt((1.0d0 + t)))) + t_1)
else
tmp = t_1 + ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + t_2)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_2 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double tmp;
if (z <= 50000000.0) {
tmp = (1.0 + t_2) + ((1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))) + t_1);
} else {
tmp = t_1 + ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + t_2);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) t_2 = math.sqrt((1.0 + y)) - math.sqrt(y) tmp = 0 if z <= 50000000.0: tmp = (1.0 + t_2) + ((1.0 / (math.sqrt(t) + math.sqrt((1.0 + t)))) + t_1) else: tmp = t_1 + ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + t_2) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_2 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (z <= 50000000.0) tmp = Float64(Float64(1.0 + t_2) + Float64(Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))) + t_1)); else tmp = Float64(t_1 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + t_2)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
t_2 = sqrt((1.0 + y)) - sqrt(y);
tmp = 0.0;
if (z <= 50000000.0)
tmp = (1.0 + t_2) + ((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + t_1);
else
tmp = t_1 + ((1.0 / (sqrt((1.0 + x)) + 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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 50000000.0], N[(N[(1.0 + t$95$2), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $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{1 + z} - \sqrt{z}\\
t_2 := \sqrt{1 + y} - \sqrt{y}\\
\mathbf{if}\;z \leq 50000000:\\
\;\;\;\;\left(1 + t_2\right) + \left(\frac{1}{\sqrt{t} + \sqrt{1 + t}} + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + t_2\right)\\
\end{array}
\end{array}
if z < 5e7Initial program 96.9%
associate-+l+96.9%
+-commutative96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
flip--98.6%
add-sqr-sqrt75.2%
+-commutative75.2%
add-sqr-sqrt99.1%
+-commutative99.1%
Applied egg-rr97.6%
+-commutative99.1%
+-commutative99.1%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified98.3%
Taylor expanded in x around 0 62.5%
if 5e7 < z Initial program 81.5%
associate-+l+81.5%
+-commutative81.5%
+-commutative81.5%
+-commutative81.5%
Simplified81.5%
flip--81.6%
add-sqr-sqrt65.3%
+-commutative65.3%
add-sqr-sqrt81.7%
+-commutative81.7%
Applied egg-rr81.7%
associate--l+86.5%
+-inverses86.5%
metadata-eval86.5%
Simplified86.5%
Taylor expanded in t around inf 44.6%
Final simplification54.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 48000000.0)
(+ (+ 1.0 (- t_2 (sqrt y))) (+ (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))) t_1))
(+
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ t_2 (sqrt y))))
t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double t_2 = sqrt((1.0 + y));
double tmp;
if (z <= 48000000.0) {
tmp = (1.0 + (t_2 - sqrt(y))) + ((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + t_1);
} else {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (t_2 + 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) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
t_2 = sqrt((1.0d0 + y))
if (z <= 48000000.0d0) then
tmp = (1.0d0 + (t_2 - sqrt(y))) + ((1.0d0 / (sqrt(t) + sqrt((1.0d0 + t)))) + t_1)
else
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (t_2 + sqrt(y)))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 48000000.0) {
tmp = (1.0 + (t_2 - Math.sqrt(y))) + ((1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))) + t_1);
} else {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (t_2 + Math.sqrt(y)))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) t_2 = math.sqrt((1.0 + y)) tmp = 0 if z <= 48000000.0: tmp = (1.0 + (t_2 - math.sqrt(y))) + ((1.0 / (math.sqrt(t) + math.sqrt((1.0 + t)))) + t_1) else: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (t_2 + math.sqrt(y)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 48000000.0) tmp = Float64(Float64(1.0 + Float64(t_2 - sqrt(y))) + Float64(Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))) + t_1)); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(t_2 + sqrt(y)))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 48000000.0)
tmp = (1.0 + (t_2 - sqrt(y))) + ((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + t_1);
else
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (t_2 + 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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 48000000.0], N[(N[(1.0 + N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 48000000:\\
\;\;\;\;\left(1 + \left(t_2 - \sqrt{y}\right)\right) + \left(\frac{1}{\sqrt{t} + \sqrt{1 + t}} + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{t_2 + \sqrt{y}}\right) + t_1\\
\end{array}
\end{array}
if z < 4.8e7Initial program 96.9%
associate-+l+96.9%
+-commutative96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
flip--98.6%
add-sqr-sqrt75.2%
+-commutative75.2%
add-sqr-sqrt99.1%
+-commutative99.1%
Applied egg-rr97.6%
+-commutative99.1%
+-commutative99.1%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified98.3%
Taylor expanded in x around 0 62.5%
if 4.8e7 < z Initial program 81.5%
associate-+l+81.5%
+-commutative81.5%
+-commutative81.5%
+-commutative81.5%
Simplified81.5%
flip--81.6%
add-sqr-sqrt65.3%
+-commutative65.3%
add-sqr-sqrt81.7%
+-commutative81.7%
Applied egg-rr81.7%
associate--l+86.5%
+-inverses86.5%
metadata-eval86.5%
Simplified86.5%
flip--86.9%
add-sqr-sqrt63.5%
add-sqr-sqrt87.0%
Applied egg-rr87.0%
associate--l+90.2%
+-inverses90.2%
metadata-eval90.2%
Simplified90.2%
Taylor expanded in t around inf 47.6%
Final simplification55.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 (<= y 9e+15)
(+
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- (sqrt (+ 1.0 z)) (sqrt z))))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9e+15) {
tmp = (1.0 + (sqrt((1.0 + y)) - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z)));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 9d+15) then
tmp = (1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (sqrt((1.0d0 + z)) - sqrt(z)))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9e+15) {
tmp = (1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z)));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 9e+15: tmp = (1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (math.sqrt((1.0 + z)) - math.sqrt(z))) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 9e+15) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z)))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 9e+15)
tmp = (1.0 + (sqrt((1.0 + y)) - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z)));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 9e+15], N[(N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 9e15Initial program 96.3%
associate-+l+96.3%
+-commutative96.3%
+-commutative96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in x around 0 57.3%
if 9e15 < y Initial program 84.4%
+-commutative84.4%
associate-+r+84.4%
associate-+r-43.7%
associate-+l-23.3%
associate-+r-6.6%
Simplified5.5%
Taylor expanded in t around inf 3.8%
associate--l+21.1%
+-commutative21.1%
associate--l+26.7%
+-commutative26.7%
associate-+r+26.7%
Simplified26.7%
Taylor expanded in y around inf 31.5%
+-commutative31.5%
Simplified31.5%
Taylor expanded in z around inf 20.2%
flip--20.2%
add-sqr-sqrt20.6%
add-sqr-sqrt20.2%
Applied egg-rr20.2%
associate--l+25.2%
+-inverses25.2%
metadata-eval25.2%
Simplified25.2%
Final simplification39.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 y))))
(if (<= t 1.7e+14)
(+
1.0
(- (+ (sqrt (+ 1.0 t)) (+ t_2 t_1)) (+ (sqrt t) (+ (sqrt y) (sqrt z)))))
(+
(- t_1 (sqrt z))
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (- t_2 (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + y));
double tmp;
if (t <= 1.7e+14) {
tmp = 1.0 + ((sqrt((1.0 + t)) + (t_2 + t_1)) - (sqrt(t) + (sqrt(y) + sqrt(z))));
} else {
tmp = (t_1 - sqrt(z)) + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (t_2 - 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((1.0d0 + z))
t_2 = sqrt((1.0d0 + y))
if (t <= 1.7d+14) then
tmp = 1.0d0 + ((sqrt((1.0d0 + t)) + (t_2 + t_1)) - (sqrt(t) + (sqrt(y) + sqrt(z))))
else
tmp = (t_1 - sqrt(z)) + ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (t_2 - 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((1.0 + z));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (t <= 1.7e+14) {
tmp = 1.0 + ((Math.sqrt((1.0 + t)) + (t_2 + t_1)) - (Math.sqrt(t) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = (t_1 - Math.sqrt(z)) + ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (t_2 - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + y)) tmp = 0 if t <= 1.7e+14: tmp = 1.0 + ((math.sqrt((1.0 + t)) + (t_2 + t_1)) - (math.sqrt(t) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = (t_1 - math.sqrt(z)) + ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (t_2 - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t <= 1.7e+14) tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(t_2 + t_1)) - Float64(sqrt(t) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(Float64(t_1 - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(t_2 - 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((1.0 + z));
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (t <= 1.7e+14)
tmp = 1.0 + ((sqrt((1.0 + t)) + (t_2 + t_1)) - (sqrt(t) + (sqrt(y) + sqrt(z))));
else
tmp = (t_1 - sqrt(z)) + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (t_2 - 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[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 1.7e+14], N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(t$95$2 + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - 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{1 + z}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;t \leq 1.7 \cdot 10^{+14}:\\
\;\;\;\;1 + \left(\left(\sqrt{1 + t} + \left(t_2 + t_1\right)\right) - \left(\sqrt{t} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{z}\right) + \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(t_2 - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if t < 1.7e14Initial program 96.1%
+-commutative96.1%
associate-+r+96.1%
associate-+r-73.9%
associate-+l-52.9%
associate-+r-48.6%
Simplified41.6%
Taylor expanded in x around 0 20.5%
associate--l+40.1%
+-commutative40.1%
+-commutative40.1%
+-commutative40.1%
Simplified40.1%
if 1.7e14 < t Initial program 81.7%
associate-+l+81.7%
+-commutative81.7%
+-commutative81.7%
+-commutative81.7%
Simplified81.7%
flip--81.7%
add-sqr-sqrt64.1%
+-commutative64.1%
add-sqr-sqrt82.0%
+-commutative82.0%
Applied egg-rr82.0%
associate--l+86.7%
+-inverses86.7%
metadata-eval86.7%
Simplified86.7%
Taylor expanded in t around inf 86.5%
Final simplification61.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 1.65e-31)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= z 2e+14)
(- (+ (sqrt (+ 1.0 z)) 2.0) (sqrt z))
(+ (sqrt (+ 1.0 x)) (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.65e-31) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (z <= 2e+14) {
tmp = (sqrt((1.0 + z)) + 2.0) - sqrt(z);
} else {
tmp = sqrt((1.0 + x)) + (sqrt((1.0 + y)) - (sqrt(x) + 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 <= 1.65d-31) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (z <= 2d+14) then
tmp = (sqrt((1.0d0 + z)) + 2.0d0) - sqrt(z)
else
tmp = sqrt((1.0d0 + x)) + (sqrt((1.0d0 + y)) - (sqrt(x) + 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 <= 1.65e-31) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (z <= 2e+14) {
tmp = (Math.sqrt((1.0 + z)) + 2.0) - Math.sqrt(z);
} else {
tmp = Math.sqrt((1.0 + x)) + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.65e-31: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif z <= 2e+14: tmp = (math.sqrt((1.0 + z)) + 2.0) - math.sqrt(z) else: tmp = math.sqrt((1.0 + x)) + (math.sqrt((1.0 + y)) - (math.sqrt(x) + 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 <= 1.65e-31) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (z <= 2e+14) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + 2.0) - sqrt(z)); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + 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 <= 1.65e-31)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (z <= 2e+14)
tmp = (sqrt((1.0 + z)) + 2.0) - sqrt(z);
else
tmp = sqrt((1.0 + x)) + (sqrt((1.0 + y)) - (sqrt(x) + 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, 1.65e-31], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 2e+14], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $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.65 \cdot 10^{-31}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+14}:\\
\;\;\;\;\left(\sqrt{1 + z} + 2\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 1.65e-31Initial program 97.0%
+-commutative97.0%
associate-+r+97.0%
associate-+r-73.8%
associate-+l-64.3%
associate-+r-46.1%
Simplified46.1%
Taylor expanded in x around 0 21.6%
associate--l+42.6%
+-commutative42.6%
+-commutative42.6%
+-commutative42.6%
Simplified42.6%
Taylor expanded in y around 0 25.0%
+-commutative25.0%
associate--l+25.0%
Simplified25.0%
Taylor expanded in z around 0 25.0%
associate--l+37.0%
Simplified37.0%
if 1.65e-31 < z < 2e14Initial program 89.8%
+-commutative89.8%
associate-+r+89.8%
associate-+r-61.0%
associate-+l-49.9%
associate-+r-38.4%
Simplified38.4%
Taylor expanded in x around 0 15.0%
associate--l+33.9%
+-commutative33.9%
+-commutative33.9%
+-commutative33.9%
Simplified33.9%
Taylor expanded in y around 0 23.1%
+-commutative23.1%
associate--l+23.0%
Simplified23.0%
Taylor expanded in t around inf 51.1%
+-commutative51.1%
Simplified51.1%
if 2e14 < z Initial program 81.8%
+-commutative81.8%
associate-+r+81.8%
associate-+r-59.8%
associate-+l-46.1%
associate-+r-46.1%
Simplified30.0%
Taylor expanded in t around inf 3.8%
associate--l+22.1%
+-commutative22.1%
associate--l+17.5%
+-commutative17.5%
associate-+r+17.5%
Simplified17.5%
Taylor expanded in z around inf 15.3%
associate--l+28.7%
+-commutative28.7%
Simplified28.7%
Final simplification34.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (sqrt (+ 1.0 y))))
(if (<= y 1.6e-25)
(+ 1.0 (+ t_2 (- (sqrt (+ 1.0 z)) (+ (sqrt y) (sqrt z)))))
(if (<= y 4.5e+15)
(- (+ t_1 t_2) (+ (sqrt x) (sqrt y)))
(/ 1.0 (+ t_1 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + y));
double tmp;
if (y <= 1.6e-25) {
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
} else if (y <= 4.5e+15) {
tmp = (t_1 + t_2) - (sqrt(x) + sqrt(y));
} else {
tmp = 1.0 / (t_1 + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + y))
if (y <= 1.6d-25) then
tmp = 1.0d0 + (t_2 + (sqrt((1.0d0 + z)) - (sqrt(y) + sqrt(z))))
else if (y <= 4.5d+15) then
tmp = (t_1 + t_2) - (sqrt(x) + sqrt(y))
else
tmp = 1.0d0 / (t_1 + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (y <= 1.6e-25) {
tmp = 1.0 + (t_2 + (Math.sqrt((1.0 + z)) - (Math.sqrt(y) + Math.sqrt(z))));
} else if (y <= 4.5e+15) {
tmp = (t_1 + t_2) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = 1.0 / (t_1 + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + y)) tmp = 0 if y <= 1.6e-25: tmp = 1.0 + (t_2 + (math.sqrt((1.0 + z)) - (math.sqrt(y) + math.sqrt(z)))) elif y <= 4.5e+15: tmp = (t_1 + t_2) - (math.sqrt(x) + math.sqrt(y)) else: tmp = 1.0 / (t_1 + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (y <= 1.6e-25) tmp = Float64(1.0 + Float64(t_2 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(y) + sqrt(z))))); elseif (y <= 4.5e+15) tmp = Float64(Float64(t_1 + t_2) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(1.0 / Float64(t_1 + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (y <= 1.6e-25)
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
elseif (y <= 4.5e+15)
tmp = (t_1 + t_2) - (sqrt(x) + sqrt(y));
else
tmp = 1.0 / (t_1 + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.6e-25], N[(1.0 + N[(t$95$2 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+15], N[(N[(t$95$1 + t$95$2), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;y \leq 1.6 \cdot 10^{-25}:\\
\;\;\;\;1 + \left(t_2 + \left(\sqrt{1 + z} - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;\left(t_1 + t_2\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 1.6000000000000001e-25Initial program 97.6%
+-commutative97.6%
associate-+r+97.5%
associate-+r-97.5%
associate-+l-97.5%
associate-+r-97.5%
Simplified80.9%
Taylor expanded in t around inf 17.9%
associate--l+21.4%
+-commutative21.4%
associate--l+21.2%
+-commutative21.2%
associate-+r+21.2%
Simplified21.2%
Taylor expanded in x around 0 31.1%
associate--l+45.7%
associate--l+53.2%
+-commutative53.2%
Simplified53.2%
if 1.6000000000000001e-25 < y < 4.5e15Initial program 87.3%
+-commutative87.3%
associate-+r+87.3%
associate-+r-87.3%
associate-+l-87.3%
associate-+r-87.4%
Simplified81.7%
Taylor expanded in t around inf 17.1%
associate--l+19.6%
+-commutative19.6%
associate--l+19.6%
+-commutative19.6%
associate-+r+19.6%
Simplified19.6%
Taylor expanded in z around inf 9.8%
if 4.5e15 < y Initial program 84.4%
+-commutative84.4%
associate-+r+84.4%
associate-+r-43.7%
associate-+l-23.3%
associate-+r-6.6%
Simplified5.5%
Taylor expanded in t around inf 3.8%
associate--l+21.1%
+-commutative21.1%
associate--l+26.7%
+-commutative26.7%
associate-+r+26.7%
Simplified26.7%
Taylor expanded in y around inf 31.5%
+-commutative31.5%
Simplified31.5%
Taylor expanded in z around inf 20.2%
flip--20.2%
add-sqr-sqrt20.6%
add-sqr-sqrt20.2%
Applied egg-rr20.2%
associate--l+25.2%
+-inverses25.2%
metadata-eval25.2%
Simplified25.2%
Final simplification34.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 3.3e-96)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= y 3.7) (- (+ 1.0 t_1) (sqrt x)) (- t_1 (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 3.3e-96) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (y <= 3.7) {
tmp = (1.0 + t_1) - sqrt(x);
} else {
tmp = t_1 - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 3.3d-96) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (y <= 3.7d0) then
tmp = (1.0d0 + t_1) - sqrt(x)
else
tmp = t_1 - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 3.3e-96) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (y <= 3.7) {
tmp = (1.0 + t_1) - Math.sqrt(x);
} else {
tmp = t_1 - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if y <= 3.3e-96: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif y <= 3.7: tmp = (1.0 + t_1) - math.sqrt(x) else: tmp = t_1 - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 3.3e-96) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (y <= 3.7) tmp = Float64(Float64(1.0 + t_1) - sqrt(x)); else tmp = Float64(t_1 - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 3.3e-96)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (y <= 3.7)
tmp = (1.0 + t_1) - sqrt(x);
else
tmp = t_1 - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 3.3e-96], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[y, 3.7], N[(N[(1.0 + t$95$1), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 3.3 \cdot 10^{-96}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;y \leq 3.7:\\
\;\;\;\;\left(1 + t_1\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;t_1 - \sqrt{x}\\
\end{array}
\end{array}
if y < 3.2999999999999999e-96Initial program 97.2%
+-commutative97.2%
associate-+r+97.2%
associate-+r-97.2%
associate-+l-97.2%
associate-+r-97.2%
Simplified81.3%
Taylor expanded in x around 0 27.0%
associate--l+43.7%
+-commutative43.7%
+-commutative43.7%
+-commutative43.7%
Simplified43.7%
Taylor expanded in y around 0 27.2%
+-commutative27.2%
associate--l+27.2%
Simplified27.2%
Taylor expanded in z around 0 30.4%
associate--l+43.0%
Simplified43.0%
if 3.2999999999999999e-96 < y < 3.7000000000000002Initial program 98.2%
+-commutative98.2%
associate-+r+98.1%
associate-+r-98.1%
associate-+l-98.1%
associate-+r-98.2%
Simplified81.1%
Taylor expanded in t around inf 15.9%
associate--l+19.8%
+-commutative19.8%
associate--l+19.8%
+-commutative19.8%
associate-+r+19.8%
Simplified19.8%
Taylor expanded in y around inf 11.0%
+-commutative11.0%
Simplified11.0%
Taylor expanded in z around 0 21.9%
if 3.7000000000000002 < y Initial program 84.1%
+-commutative84.1%
associate-+r+84.1%
associate-+r-45.2%
associate-+l-25.8%
associate-+r-9.9%
Simplified8.8%
Taylor expanded in t around inf 4.4%
associate--l+21.0%
+-commutative21.0%
associate--l+26.3%
+-commutative26.3%
associate-+r+26.3%
Simplified26.3%
Taylor expanded in y around inf 30.7%
+-commutative30.7%
Simplified30.7%
Taylor expanded in z around inf 19.7%
Final simplification26.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 3.3e-96)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= y 1.28) (- (+ 1.0 t_1) (sqrt x)) (/ 1.0 (+ t_1 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 3.3e-96) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (y <= 1.28) {
tmp = (1.0 + t_1) - sqrt(x);
} else {
tmp = 1.0 / (t_1 + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 3.3d-96) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (y <= 1.28d0) then
tmp = (1.0d0 + t_1) - sqrt(x)
else
tmp = 1.0d0 / (t_1 + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 3.3e-96) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (y <= 1.28) {
tmp = (1.0 + t_1) - Math.sqrt(x);
} else {
tmp = 1.0 / (t_1 + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if y <= 3.3e-96: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif y <= 1.28: tmp = (1.0 + t_1) - math.sqrt(x) else: tmp = 1.0 / (t_1 + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 3.3e-96) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (y <= 1.28) tmp = Float64(Float64(1.0 + t_1) - sqrt(x)); else tmp = Float64(1.0 / Float64(t_1 + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 3.3e-96)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (y <= 1.28)
tmp = (1.0 + t_1) - sqrt(x);
else
tmp = 1.0 / (t_1 + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 3.3e-96], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[y, 1.28], N[(N[(1.0 + t$95$1), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 3.3 \cdot 10^{-96}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;y \leq 1.28:\\
\;\;\;\;\left(1 + t_1\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 3.2999999999999999e-96Initial program 97.2%
+-commutative97.2%
associate-+r+97.2%
associate-+r-97.2%
associate-+l-97.2%
associate-+r-97.2%
Simplified81.3%
Taylor expanded in x around 0 27.0%
associate--l+43.7%
+-commutative43.7%
+-commutative43.7%
+-commutative43.7%
Simplified43.7%
Taylor expanded in y around 0 27.2%
+-commutative27.2%
associate--l+27.2%
Simplified27.2%
Taylor expanded in z around 0 30.4%
associate--l+43.0%
Simplified43.0%
if 3.2999999999999999e-96 < y < 1.28000000000000003Initial program 98.2%
+-commutative98.2%
associate-+r+98.1%
associate-+r-98.1%
associate-+l-98.1%
associate-+r-98.2%
Simplified82.8%
Taylor expanded in t around inf 16.3%
associate--l+19.8%
+-commutative19.8%
associate--l+19.8%
+-commutative19.8%
associate-+r+19.8%
Simplified19.8%
Taylor expanded in y around inf 10.8%
+-commutative10.8%
Simplified10.8%
Taylor expanded in z around 0 21.9%
if 1.28000000000000003 < y Initial program 84.2%
+-commutative84.2%
associate-+r+84.2%
associate-+r-45.6%
associate-+l-26.2%
associate-+r-10.5%
Simplified8.9%
Taylor expanded in t around inf 4.4%
associate--l+21.0%
+-commutative21.0%
associate--l+26.2%
+-commutative26.2%
associate-+r+26.2%
Simplified26.2%
Taylor expanded in y around inf 30.6%
+-commutative30.6%
Simplified30.6%
Taylor expanded in z around inf 19.7%
flip--19.7%
add-sqr-sqrt20.0%
add-sqr-sqrt19.7%
Applied egg-rr19.7%
associate--l+24.5%
+-inverses24.5%
metadata-eval24.5%
Simplified24.5%
Final simplification29.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 (<= y 3.3e-96) 3.0 (if (<= y 3.25) 2.0 (- (sqrt (+ 1.0 x)) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.3e-96) {
tmp = 3.0;
} else if (y <= 3.25) {
tmp = 2.0;
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 3.3d-96) then
tmp = 3.0d0
else if (y <= 3.25d0) then
tmp = 2.0d0
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.3e-96) {
tmp = 3.0;
} else if (y <= 3.25) {
tmp = 2.0;
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 3.3e-96: tmp = 3.0 elif y <= 3.25: tmp = 2.0 else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 3.3e-96) tmp = 3.0; elseif (y <= 3.25) tmp = 2.0; else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 3.3e-96)
tmp = 3.0;
elseif (y <= 3.25)
tmp = 2.0;
else
tmp = sqrt((1.0 + x)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 3.3e-96], 3.0, If[LessEqual[y, 3.25], 2.0, N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.3 \cdot 10^{-96}:\\
\;\;\;\;3\\
\mathbf{elif}\;y \leq 3.25:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 3.2999999999999999e-96Initial program 97.2%
+-commutative97.2%
associate-+r+97.2%
associate-+r-97.2%
associate-+l-97.2%
associate-+r-97.2%
Simplified81.3%
Taylor expanded in x around 0 27.0%
associate--l+43.7%
+-commutative43.7%
+-commutative43.7%
+-commutative43.7%
Simplified43.7%
Taylor expanded in y around 0 27.2%
+-commutative27.2%
associate--l+27.2%
Simplified27.2%
Taylor expanded in t around inf 31.5%
+-commutative31.5%
Simplified31.5%
Taylor expanded in z around 0 44.4%
if 3.2999999999999999e-96 < y < 3.25Initial program 98.2%
+-commutative98.2%
associate-+r+98.1%
associate-+r-98.1%
associate-+l-98.1%
associate-+r-98.2%
Simplified81.1%
Taylor expanded in x around 0 19.0%
associate--l+41.1%
+-commutative41.1%
+-commutative41.1%
+-commutative41.1%
Simplified41.1%
Taylor expanded in y around 0 19.0%
+-commutative19.0%
associate--l+19.0%
Simplified19.0%
Taylor expanded in t around inf 27.0%
+-commutative27.0%
Simplified27.0%
Taylor expanded in z around inf 41.5%
if 3.25 < y Initial program 84.1%
+-commutative84.1%
associate-+r+84.1%
associate-+r-45.2%
associate-+l-25.8%
associate-+r-9.9%
Simplified8.8%
Taylor expanded in t around inf 4.4%
associate--l+21.0%
+-commutative21.0%
associate--l+26.3%
+-commutative26.3%
associate-+r+26.3%
Simplified26.3%
Taylor expanded in y around inf 30.7%
+-commutative30.7%
Simplified30.7%
Taylor expanded in z around inf 19.7%
Final simplification29.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 3.3e-96) (+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0) (if (<= y 7.6) 2.0 (- (sqrt (+ 1.0 x)) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.3e-96) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (y <= 7.6) {
tmp = 2.0;
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 3.3d-96) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (y <= 7.6d0) then
tmp = 2.0d0
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.3e-96) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (y <= 7.6) {
tmp = 2.0;
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 3.3e-96: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif y <= 7.6: tmp = 2.0 else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 3.3e-96) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (y <= 7.6) tmp = 2.0; else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 3.3e-96)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (y <= 7.6)
tmp = 2.0;
else
tmp = sqrt((1.0 + x)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 3.3e-96], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[y, 7.6], 2.0, N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.3 \cdot 10^{-96}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;y \leq 7.6:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 3.2999999999999999e-96Initial program 97.2%
+-commutative97.2%
associate-+r+97.2%
associate-+r-97.2%
associate-+l-97.2%
associate-+r-97.2%
Simplified81.3%
Taylor expanded in x around 0 27.0%
associate--l+43.7%
+-commutative43.7%
+-commutative43.7%
+-commutative43.7%
Simplified43.7%
Taylor expanded in y around 0 27.2%
+-commutative27.2%
associate--l+27.2%
Simplified27.2%
Taylor expanded in z around 0 30.4%
associate--l+43.0%
Simplified43.0%
if 3.2999999999999999e-96 < y < 7.5999999999999996Initial program 98.2%
+-commutative98.2%
associate-+r+98.1%
associate-+r-98.1%
associate-+l-98.1%
associate-+r-98.2%
Simplified81.1%
Taylor expanded in x around 0 19.0%
associate--l+41.1%
+-commutative41.1%
+-commutative41.1%
+-commutative41.1%
Simplified41.1%
Taylor expanded in y around 0 19.0%
+-commutative19.0%
associate--l+19.0%
Simplified19.0%
Taylor expanded in t around inf 27.0%
+-commutative27.0%
Simplified27.0%
Taylor expanded in z around inf 41.5%
if 7.5999999999999996 < y Initial program 84.1%
+-commutative84.1%
associate-+r+84.1%
associate-+r-45.2%
associate-+l-25.8%
associate-+r-9.9%
Simplified8.8%
Taylor expanded in t around inf 4.4%
associate--l+21.0%
+-commutative21.0%
associate--l+26.3%
+-commutative26.3%
associate-+r+26.3%
Simplified26.3%
Taylor expanded in y around inf 30.7%
+-commutative30.7%
Simplified30.7%
Taylor expanded in z around inf 19.7%
Final simplification29.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 (<= y 3.3e-96) 3.0 (if (<= y 4.2) 2.0 (- (+ 1.0 (* x 0.5)) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.3e-96) {
tmp = 3.0;
} else if (y <= 4.2) {
tmp = 2.0;
} else {
tmp = (1.0 + (x * 0.5)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 3.3d-96) then
tmp = 3.0d0
else if (y <= 4.2d0) then
tmp = 2.0d0
else
tmp = (1.0d0 + (x * 0.5d0)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.3e-96) {
tmp = 3.0;
} else if (y <= 4.2) {
tmp = 2.0;
} else {
tmp = (1.0 + (x * 0.5)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 3.3e-96: tmp = 3.0 elif y <= 4.2: tmp = 2.0 else: tmp = (1.0 + (x * 0.5)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 3.3e-96) tmp = 3.0; elseif (y <= 4.2) tmp = 2.0; else tmp = Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 3.3e-96)
tmp = 3.0;
elseif (y <= 4.2)
tmp = 2.0;
else
tmp = (1.0 + (x * 0.5)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 3.3e-96], 3.0, If[LessEqual[y, 4.2], 2.0, N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.3 \cdot 10^{-96}:\\
\;\;\;\;3\\
\mathbf{elif}\;y \leq 4.2:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 3.2999999999999999e-96Initial program 97.2%
+-commutative97.2%
associate-+r+97.2%
associate-+r-97.2%
associate-+l-97.2%
associate-+r-97.2%
Simplified81.3%
Taylor expanded in x around 0 27.0%
associate--l+43.7%
+-commutative43.7%
+-commutative43.7%
+-commutative43.7%
Simplified43.7%
Taylor expanded in y around 0 27.2%
+-commutative27.2%
associate--l+27.2%
Simplified27.2%
Taylor expanded in t around inf 31.5%
+-commutative31.5%
Simplified31.5%
Taylor expanded in z around 0 44.4%
if 3.2999999999999999e-96 < y < 4.20000000000000018Initial program 98.2%
+-commutative98.2%
associate-+r+98.1%
associate-+r-98.1%
associate-+l-98.1%
associate-+r-98.2%
Simplified81.1%
Taylor expanded in x around 0 19.0%
associate--l+41.1%
+-commutative41.1%
+-commutative41.1%
+-commutative41.1%
Simplified41.1%
Taylor expanded in y around 0 19.0%
+-commutative19.0%
associate--l+19.0%
Simplified19.0%
Taylor expanded in t around inf 27.0%
+-commutative27.0%
Simplified27.0%
Taylor expanded in z around inf 41.5%
if 4.20000000000000018 < y Initial program 84.1%
+-commutative84.1%
associate-+r+84.1%
associate-+r-45.2%
associate-+l-25.8%
associate-+r-9.9%
Simplified8.8%
Taylor expanded in t around inf 4.4%
associate--l+21.0%
+-commutative21.0%
associate--l+26.3%
+-commutative26.3%
associate-+r+26.3%
Simplified26.3%
Taylor expanded in y around inf 30.7%
+-commutative30.7%
Simplified30.7%
Taylor expanded in z around inf 19.7%
Taylor expanded in x around 0 20.3%
*-commutative20.3%
Simplified20.3%
Final simplification29.7%
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.4) 3.0 2.0))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.4) {
tmp = 3.0;
} else {
tmp = 2.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.4d0) then
tmp = 3.0d0
else
tmp = 2.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.4) {
tmp = 3.0;
} else {
tmp = 2.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.4: tmp = 3.0 else: tmp = 2.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.4) tmp = 3.0; else tmp = 2.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.4)
tmp = 3.0;
else
tmp = 2.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.4], 3.0, 2.0]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.4:\\
\;\;\;\;3\\
\mathbf{else}:\\
\;\;\;\;2\\
\end{array}
\end{array}
if z < 0.40000000000000002Initial program 97.0%
+-commutative97.0%
associate-+r+97.0%
associate-+r-72.8%
associate-+l-64.0%
associate-+r-46.0%
Simplified46.0%
Taylor expanded in x around 0 21.1%
associate--l+41.5%
+-commutative41.5%
+-commutative41.5%
+-commutative41.5%
Simplified41.5%
Taylor expanded in y around 0 24.6%
+-commutative24.6%
associate--l+24.6%
Simplified24.6%
Taylor expanded in t around inf 44.2%
+-commutative44.2%
Simplified44.2%
Taylor expanded in z around 0 43.2%
if 0.40000000000000002 < z Initial program 81.8%
+-commutative81.8%
associate-+r+81.8%
associate-+r-59.8%
associate-+l-45.4%
associate-+r-44.9%
Simplified30.0%
Taylor expanded in x around 0 4.3%
associate--l+44.0%
+-commutative44.0%
+-commutative44.0%
+-commutative44.0%
Simplified44.0%
Taylor expanded in y around 0 5.3%
+-commutative5.3%
associate--l+5.3%
Simplified5.3%
Taylor expanded in t around inf 8.2%
+-commutative8.2%
Simplified8.2%
Taylor expanded in z around inf 39.4%
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 2.0)
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 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 = 2.0d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 2.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 2.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return 2.0 end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 2.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := 2.0
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
2
\end{array}
Initial program 89.6%
+-commutative89.6%
associate-+r+89.6%
associate-+r-66.5%
associate-+l-54.9%
associate-+r-45.5%
Simplified38.2%
Taylor expanded in x around 0 12.9%
associate--l+42.7%
+-commutative42.7%
+-commutative42.7%
+-commutative42.7%
Simplified42.7%
Taylor expanded in y around 0 15.2%
+-commutative15.2%
associate--l+15.2%
Simplified15.2%
Taylor expanded in t around inf 26.7%
+-commutative26.7%
Simplified26.7%
Taylor expanded in z around inf 41.9%
Final simplification41.9%
(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 2024021
(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))))