
(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 28 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 (+ 1.0 x)))
(t_2 (- (sqrt (+ z 1.0)) (sqrt z)))
(t_3 (sqrt (+ 1.0 y))))
(if (<= t_2 5e-5)
(+
(+ (/ 1.0 (+ (sqrt x) t_1)) (/ 1.0 (+ (sqrt y) t_3)))
(* 0.5 (sqrt (/ 1.0 z))))
(+
(+ (- t_1 (sqrt x)) (- t_3 (sqrt y)))
(+ t_2 (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((z + 1.0)) - sqrt(z);
double t_3 = sqrt((1.0 + y));
double tmp;
if (t_2 <= 5e-5) {
tmp = ((1.0 / (sqrt(x) + t_1)) + (1.0 / (sqrt(y) + t_3))) + (0.5 * sqrt((1.0 / z)));
} else {
tmp = ((t_1 - sqrt(x)) + (t_3 - sqrt(y))) + (t_2 + (1.0 / (sqrt(t) + sqrt((1.0 + t)))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((z + 1.0d0)) - sqrt(z)
t_3 = sqrt((1.0d0 + y))
if (t_2 <= 5d-5) then
tmp = ((1.0d0 / (sqrt(x) + t_1)) + (1.0d0 / (sqrt(y) + t_3))) + (0.5d0 * sqrt((1.0d0 / z)))
else
tmp = ((t_1 - sqrt(x)) + (t_3 - sqrt(y))) + (t_2 + (1.0d0 / (sqrt(t) + sqrt((1.0d0 + t)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((z + 1.0)) - Math.sqrt(z);
double t_3 = Math.sqrt((1.0 + y));
double tmp;
if (t_2 <= 5e-5) {
tmp = ((1.0 / (Math.sqrt(x) + t_1)) + (1.0 / (Math.sqrt(y) + t_3))) + (0.5 * Math.sqrt((1.0 / z)));
} else {
tmp = ((t_1 - Math.sqrt(x)) + (t_3 - Math.sqrt(y))) + (t_2 + (1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((z + 1.0)) - math.sqrt(z) t_3 = math.sqrt((1.0 + y)) tmp = 0 if t_2 <= 5e-5: tmp = ((1.0 / (math.sqrt(x) + t_1)) + (1.0 / (math.sqrt(y) + t_3))) + (0.5 * math.sqrt((1.0 / z))) else: tmp = ((t_1 - math.sqrt(x)) + (t_3 - math.sqrt(y))) + (t_2 + (1.0 / (math.sqrt(t) + math.sqrt((1.0 + t))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) t_3 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t_2 <= 5e-5) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(1.0 / Float64(sqrt(y) + t_3))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); else tmp = Float64(Float64(Float64(t_1 - sqrt(x)) + Float64(t_3 - sqrt(y))) + Float64(t_2 + Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((z + 1.0)) - sqrt(z);
t_3 = sqrt((1.0 + y));
tmp = 0.0;
if (t_2 <= 5e-5)
tmp = ((1.0 / (sqrt(x) + t_1)) + (1.0 / (sqrt(y) + t_3))) + (0.5 * sqrt((1.0 / z)));
else
tmp = ((t_1 - sqrt(x)) + (t_3 - sqrt(y))) + (t_2 + (1.0 / (sqrt(t) + sqrt((1.0 + t)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 5e-5], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{z + 1} - \sqrt{z}\\
t_3 := \sqrt{1 + y}\\
\mathbf{if}\;t\_2 \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + t\_1} + \frac{1}{\sqrt{y} + t\_3}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{x}\right) + \left(t\_3 - \sqrt{y}\right)\right) + \left(t\_2 + \frac{1}{\sqrt{t} + \sqrt{1 + t}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) < 5.00000000000000024e-5Initial program 82.8%
associate-+l+82.8%
sub-neg82.8%
sub-neg82.8%
+-commutative82.8%
+-commutative82.8%
+-commutative82.8%
Simplified82.8%
flip--82.8%
div-inv82.8%
add-sqr-sqrt73.4%
+-commutative73.4%
add-sqr-sqrt83.4%
+-commutative83.4%
Applied egg-rr83.4%
associate--l+86.0%
+-inverses86.0%
metadata-eval86.0%
*-lft-identity86.0%
+-commutative86.0%
Simplified86.0%
flip--86.1%
div-inv86.1%
add-sqr-sqrt74.1%
add-sqr-sqrt86.5%
associate--l+90.4%
Applied egg-rr90.4%
+-inverses90.4%
metadata-eval90.4%
*-lft-identity90.4%
+-commutative90.4%
Simplified90.4%
Taylor expanded in t around inf 48.8%
Taylor expanded in z around inf 53.7%
if 5.00000000000000024e-5 < (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
flip--97.4%
div-inv97.4%
add-sqr-sqrt78.5%
+-commutative78.5%
add-sqr-sqrt97.9%
associate--l+97.9%
Applied egg-rr97.9%
associate-*r/97.9%
*-rgt-identity97.9%
associate-+r-97.9%
+-commutative97.9%
associate-+r-98.1%
+-inverses98.1%
metadata-eval98.1%
+-commutative98.1%
Simplified98.1%
Final simplification75.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 (+ z 1.0)) (sqrt z))) (t_2 (sqrt (+ 1.0 y))))
(if (<= t_1 5e-5)
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt y) t_2)))
(* 0.5 (sqrt (/ 1.0 z))))
(+
(+ t_1 (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))))
(+ (- t_2 (sqrt y)) (- 1.0 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0)) - sqrt(z);
double t_2 = sqrt((1.0 + y));
double tmp;
if (t_1 <= 5e-5) {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_2))) + (0.5 * sqrt((1.0 / z)));
} else {
tmp = (t_1 + (1.0 / (sqrt(t) + sqrt((1.0 + t))))) + ((t_2 - sqrt(y)) + (1.0 - sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((z + 1.0d0)) - sqrt(z)
t_2 = sqrt((1.0d0 + y))
if (t_1 <= 5d-5) then
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + t_2))) + (0.5d0 * sqrt((1.0d0 / z)))
else
tmp = (t_1 + (1.0d0 / (sqrt(t) + sqrt((1.0d0 + t))))) + ((t_2 - sqrt(y)) + (1.0d0 - sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z + 1.0)) - Math.sqrt(z);
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (t_1 <= 5e-5) {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + t_2))) + (0.5 * Math.sqrt((1.0 / z)));
} else {
tmp = (t_1 + (1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t))))) + ((t_2 - Math.sqrt(y)) + (1.0 - Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) - math.sqrt(z) t_2 = math.sqrt((1.0 + y)) tmp = 0 if t_1 <= 5e-5: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + t_2))) + (0.5 * math.sqrt((1.0 / z))) else: tmp = (t_1 + (1.0 / (math.sqrt(t) + math.sqrt((1.0 + t))))) + ((t_2 - math.sqrt(y)) + (1.0 - math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t_1 <= 5e-5) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + t_2))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); else tmp = Float64(Float64(t_1 + Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t))))) + Float64(Float64(t_2 - sqrt(y)) + Float64(1.0 - sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((z + 1.0)) - sqrt(z);
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (t_1 <= 5e-5)
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_2))) + (0.5 * sqrt((1.0 / z)));
else
tmp = (t_1 + (1.0 / (sqrt(t) + sqrt((1.0 + t))))) + ((t_2 - sqrt(y)) + (1.0 - sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 5e-5], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z + 1} - \sqrt{z}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + t\_2}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 + \frac{1}{\sqrt{t} + \sqrt{1 + t}}\right) + \left(\left(t\_2 - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) < 5.00000000000000024e-5Initial program 82.8%
associate-+l+82.8%
sub-neg82.8%
sub-neg82.8%
+-commutative82.8%
+-commutative82.8%
+-commutative82.8%
Simplified82.8%
flip--82.8%
div-inv82.8%
add-sqr-sqrt73.4%
+-commutative73.4%
add-sqr-sqrt83.4%
+-commutative83.4%
Applied egg-rr83.4%
associate--l+86.0%
+-inverses86.0%
metadata-eval86.0%
*-lft-identity86.0%
+-commutative86.0%
Simplified86.0%
flip--86.1%
div-inv86.1%
add-sqr-sqrt74.1%
add-sqr-sqrt86.5%
associate--l+90.4%
Applied egg-rr90.4%
+-inverses90.4%
metadata-eval90.4%
*-lft-identity90.4%
+-commutative90.4%
Simplified90.4%
Taylor expanded in t around inf 48.8%
Taylor expanded in z around inf 53.7%
if 5.00000000000000024e-5 < (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in x around 0 39.6%
flip--97.4%
div-inv97.4%
add-sqr-sqrt78.5%
+-commutative78.5%
add-sqr-sqrt97.9%
associate--l+97.9%
Applied egg-rr39.7%
associate-*r/97.9%
*-rgt-identity97.9%
associate-+r-97.9%
+-commutative97.9%
associate-+r-98.1%
+-inverses98.1%
metadata-eval98.1%
+-commutative98.1%
Simplified39.7%
Final simplification46.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))))
(if (<= z 70000000.0)
(+
(+ (- t_1 (sqrt y)) (- 1.0 (sqrt x)))
(+ (- (sqrt (+ z 1.0)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt y) t_1)))
(* 0.5 (sqrt (/ 1.0 z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (z <= 70000000.0) {
tmp = ((t_1 - sqrt(y)) + (1.0 - sqrt(x))) + ((sqrt((z + 1.0)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_1))) + (0.5 * sqrt((1.0 / z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (z <= 70000000.0d0) then
tmp = ((t_1 - sqrt(y)) + (1.0d0 - sqrt(x))) + ((sqrt((z + 1.0d0)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t)))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + t_1))) + (0.5d0 * sqrt((1.0d0 / z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 70000000.0) {
tmp = ((t_1 - Math.sqrt(y)) + (1.0 - Math.sqrt(x))) + ((Math.sqrt((z + 1.0)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + t_1))) + (0.5 * Math.sqrt((1.0 / z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if z <= 70000000.0: tmp = ((t_1 - math.sqrt(y)) + (1.0 - math.sqrt(x))) + ((math.sqrt((z + 1.0)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + t_1))) + (0.5 * math.sqrt((1.0 / z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 70000000.0) tmp = Float64(Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 - sqrt(x))) + Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + t_1))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 70000000.0)
tmp = ((t_1 - sqrt(y)) + (1.0 - sqrt(x))) + ((sqrt((z + 1.0)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_1))) + (0.5 * sqrt((1.0 / z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 70000000.0], N[(N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / 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 + y}\\
\mathbf{if}\;z \leq 70000000:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + t\_1}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\end{array}
\end{array}
if z < 7e7Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in x around 0 39.6%
if 7e7 < z Initial program 82.8%
associate-+l+82.8%
sub-neg82.8%
sub-neg82.8%
+-commutative82.8%
+-commutative82.8%
+-commutative82.8%
Simplified82.8%
flip--82.8%
div-inv82.8%
add-sqr-sqrt73.4%
+-commutative73.4%
add-sqr-sqrt83.4%
+-commutative83.4%
Applied egg-rr83.4%
associate--l+86.0%
+-inverses86.0%
metadata-eval86.0%
*-lft-identity86.0%
+-commutative86.0%
Simplified86.0%
flip--86.1%
div-inv86.1%
add-sqr-sqrt74.1%
add-sqr-sqrt86.5%
associate--l+90.4%
Applied egg-rr90.4%
+-inverses90.4%
metadata-eval90.4%
*-lft-identity90.4%
+-commutative90.4%
Simplified90.4%
Taylor expanded in t around inf 48.8%
Taylor expanded in z around inf 53.7%
Final simplification46.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 2100000.0)
(+
(+ (- (sqrt (+ z 1.0)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ (- 1.0 (sqrt x)) (- 1.0 (sqrt y))))
(+
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))
(* 0.5 (sqrt (/ 1.0 z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2100000.0) {
tmp = ((sqrt((z + 1.0)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 - sqrt(x)) + (1.0 - sqrt(y)));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + (0.5 * sqrt((1.0 / z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 2100000.0d0) then
tmp = ((sqrt((z + 1.0d0)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))) + ((1.0d0 - sqrt(x)) + (1.0d0 - sqrt(y)))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y))))) + (0.5d0 * sqrt((1.0d0 / z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2100000.0) {
tmp = ((Math.sqrt((z + 1.0)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((1.0 - Math.sqrt(x)) + (1.0 - Math.sqrt(y)));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y))))) + (0.5 * Math.sqrt((1.0 / z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 2100000.0: tmp = ((math.sqrt((z + 1.0)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((1.0 - math.sqrt(x)) + (1.0 - math.sqrt(y))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))))) + (0.5 * math.sqrt((1.0 / z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 2100000.0) tmp = Float64(Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 - sqrt(y)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y))))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 2100000.0)
tmp = ((sqrt((z + 1.0)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 - sqrt(x)) + (1.0 - sqrt(y)));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + (0.5 * sqrt((1.0 / z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 2100000.0], N[(N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2100000:\\
\;\;\;\;\left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(1 - \sqrt{x}\right) + \left(1 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\end{array}
\end{array}
if z < 2.1e6Initial program 97.5%
associate-+l+97.5%
sub-neg97.5%
sub-neg97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 40.5%
Taylor expanded in y around 0 19.8%
if 2.1e6 < z Initial program 82.8%
associate-+l+82.8%
sub-neg82.8%
sub-neg82.8%
+-commutative82.8%
+-commutative82.8%
+-commutative82.8%
Simplified82.8%
flip--82.8%
div-inv82.8%
add-sqr-sqrt73.1%
+-commutative73.1%
add-sqr-sqrt83.4%
+-commutative83.4%
Applied egg-rr83.4%
associate--l+85.9%
+-inverses85.9%
metadata-eval85.9%
*-lft-identity85.9%
+-commutative85.9%
Simplified85.9%
flip--86.0%
div-inv86.0%
add-sqr-sqrt74.2%
add-sqr-sqrt86.4%
associate--l+90.2%
Applied egg-rr90.2%
+-inverses90.2%
metadata-eval90.2%
*-lft-identity90.2%
+-commutative90.2%
Simplified90.2%
Taylor expanded in t around inf 48.4%
Taylor expanded in z around inf 53.2%
Final simplification37.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))))
(if (<= z 1200000000.0)
(+
(+ (- t_1 (sqrt y)) (- 1.0 (sqrt x)))
(/ 1.0 (+ (sqrt z) (sqrt (+ z 1.0)))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt y) t_1)))
(* 0.5 (sqrt (/ 1.0 z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (z <= 1200000000.0) {
tmp = ((t_1 - sqrt(y)) + (1.0 - sqrt(x))) + (1.0 / (sqrt(z) + sqrt((z + 1.0))));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_1))) + (0.5 * sqrt((1.0 / z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (z <= 1200000000.0d0) then
tmp = ((t_1 - sqrt(y)) + (1.0d0 - sqrt(x))) + (1.0d0 / (sqrt(z) + sqrt((z + 1.0d0))))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + t_1))) + (0.5d0 * sqrt((1.0d0 / z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 1200000000.0) {
tmp = ((t_1 - Math.sqrt(y)) + (1.0 - Math.sqrt(x))) + (1.0 / (Math.sqrt(z) + Math.sqrt((z + 1.0))));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + t_1))) + (0.5 * Math.sqrt((1.0 / z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if z <= 1200000000.0: tmp = ((t_1 - math.sqrt(y)) + (1.0 - math.sqrt(x))) + (1.0 / (math.sqrt(z) + math.sqrt((z + 1.0)))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + t_1))) + (0.5 * math.sqrt((1.0 / z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 1200000000.0) tmp = Float64(Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 - sqrt(x))) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(z + 1.0))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + t_1))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 1200000000.0)
tmp = ((t_1 - sqrt(y)) + (1.0 - sqrt(x))) + (1.0 / (sqrt(z) + sqrt((z + 1.0))));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_1))) + (0.5 * sqrt((1.0 / z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1200000000.0], N[(N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / 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 + y}\\
\mathbf{if}\;z \leq 1200000000:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right) + \frac{1}{\sqrt{z} + \sqrt{z + 1}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + t\_1}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\end{array}
\end{array}
if z < 1.2e9Initial program 96.9%
associate-+l+96.9%
sub-neg96.9%
sub-neg96.9%
+-commutative96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in x around 0 40.3%
Taylor expanded in t around inf 24.8%
flip--24.9%
div-inv24.9%
add-sqr-sqrt25.0%
add-sqr-sqrt25.0%
associate--l+25.0%
Applied egg-rr25.0%
+-inverses25.0%
metadata-eval25.0%
*-lft-identity25.0%
+-commutative25.0%
Simplified25.0%
if 1.2e9 < z Initial program 82.8%
associate-+l+82.8%
sub-neg82.8%
sub-neg82.8%
+-commutative82.8%
+-commutative82.8%
+-commutative82.8%
Simplified82.8%
flip--82.8%
div-inv82.8%
add-sqr-sqrt73.2%
+-commutative73.2%
add-sqr-sqrt83.4%
+-commutative83.4%
Applied egg-rr83.4%
associate--l+86.1%
+-inverses86.1%
metadata-eval86.1%
*-lft-identity86.1%
+-commutative86.1%
Simplified86.1%
flip--86.1%
div-inv86.1%
add-sqr-sqrt73.9%
add-sqr-sqrt86.5%
associate--l+90.5%
Applied egg-rr90.5%
+-inverses90.5%
metadata-eval90.5%
*-lft-identity90.5%
+-commutative90.5%
Simplified90.5%
Taylor expanded in t around inf 48.3%
Taylor expanded in z around inf 53.1%
Final simplification39.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ z 1.0))))
(if (<= y 1450000.0)
(+
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- 1.0 (sqrt x)))
(/ 1.0 (+ (sqrt z) t_1)))
(+
(- t_1 (sqrt z))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (pow y -0.5)))))))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 tmp;
if (y <= 1450000.0) {
tmp = ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x))) + (1.0 / (sqrt(z) + t_1));
} else {
tmp = (t_1 - sqrt(z)) + ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * pow(y, -0.5)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((z + 1.0d0))
if (y <= 1450000.0d0) then
tmp = ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 - sqrt(x))) + (1.0d0 / (sqrt(z) + t_1))
else
tmp = (t_1 - sqrt(z)) + ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * (y ** (-0.5d0))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z + 1.0));
double tmp;
if (y <= 1450000.0) {
tmp = ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x))) + (1.0 / (Math.sqrt(z) + t_1));
} else {
tmp = (t_1 - Math.sqrt(z)) + ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.pow(y, -0.5)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) tmp = 0 if y <= 1450000.0: tmp = ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 - math.sqrt(x))) + (1.0 / (math.sqrt(z) + t_1)) else: tmp = (t_1 - math.sqrt(z)) + ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.pow(y, -0.5))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(z + 1.0)) tmp = 0.0 if (y <= 1450000.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 - sqrt(x))) + Float64(1.0 / Float64(sqrt(z) + t_1))); else tmp = Float64(Float64(t_1 - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * (y ^ -0.5)))); 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));
tmp = 0.0;
if (y <= 1450000.0)
tmp = ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x))) + (1.0 / (sqrt(z) + t_1));
else
tmp = (t_1 - sqrt(z)) + ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * (y ^ -0.5)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1450000.0], N[(N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Power[y, -0.5], $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}\\
\mathbf{if}\;y \leq 1450000:\\
\;\;\;\;\left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right) + \frac{1}{\sqrt{z} + t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - \sqrt{z}\right) + \left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot {y}^{-0.5}\right)\\
\end{array}
\end{array}
if y < 1.45e6Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in x around 0 47.7%
Taylor expanded in t around inf 27.7%
flip--27.8%
div-inv27.8%
add-sqr-sqrt18.9%
add-sqr-sqrt28.0%
associate--l+28.2%
Applied egg-rr28.2%
+-inverses28.2%
metadata-eval28.2%
*-lft-identity28.2%
+-commutative28.2%
Simplified28.2%
if 1.45e6 < y Initial program 82.6%
associate-+l+82.6%
sub-neg82.6%
sub-neg82.6%
+-commutative82.6%
+-commutative82.6%
+-commutative82.6%
Simplified82.6%
flip--82.7%
div-inv82.7%
add-sqr-sqrt64.3%
+-commutative64.3%
add-sqr-sqrt83.3%
+-commutative83.3%
Applied egg-rr83.3%
associate--l+86.0%
+-inverses86.0%
metadata-eval86.0%
*-lft-identity86.0%
+-commutative86.0%
Simplified86.0%
flip--86.1%
div-inv86.1%
add-sqr-sqrt51.0%
add-sqr-sqrt86.6%
associate--l+91.1%
Applied egg-rr91.1%
+-inverses91.1%
metadata-eval91.1%
*-lft-identity91.1%
+-commutative91.1%
Simplified91.1%
Taylor expanded in t around inf 48.6%
Taylor expanded in y around inf 48.5%
rem-exp-log48.4%
exp-neg48.4%
unpow1/248.4%
exp-prod48.3%
distribute-lft-neg-out48.3%
distribute-rgt-neg-in48.3%
metadata-eval48.3%
exp-to-pow48.5%
Simplified48.5%
Final simplification38.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))))
(if (<= z 4.5e+26)
(+
(+ (- t_1 (sqrt y)) (- 1.0 (sqrt x)))
(/ 1.0 (+ (sqrt z) (sqrt (+ z 1.0)))))
(+
(+ (/ 1.0 (+ (sqrt y) t_1)) (+ 1.0 (- (* x 0.5) (sqrt x))))
(* 0.5 (sqrt (/ 1.0 t)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (z <= 4.5e+26) {
tmp = ((t_1 - sqrt(y)) + (1.0 - sqrt(x))) + (1.0 / (sqrt(z) + sqrt((z + 1.0))));
} else {
tmp = ((1.0 / (sqrt(y) + t_1)) + (1.0 + ((x * 0.5) - sqrt(x)))) + (0.5 * sqrt((1.0 / t)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (z <= 4.5d+26) then
tmp = ((t_1 - sqrt(y)) + (1.0d0 - sqrt(x))) + (1.0d0 / (sqrt(z) + sqrt((z + 1.0d0))))
else
tmp = ((1.0d0 / (sqrt(y) + t_1)) + (1.0d0 + ((x * 0.5d0) - sqrt(x)))) + (0.5d0 * sqrt((1.0d0 / t)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 4.5e+26) {
tmp = ((t_1 - Math.sqrt(y)) + (1.0 - Math.sqrt(x))) + (1.0 / (Math.sqrt(z) + Math.sqrt((z + 1.0))));
} else {
tmp = ((1.0 / (Math.sqrt(y) + t_1)) + (1.0 + ((x * 0.5) - Math.sqrt(x)))) + (0.5 * Math.sqrt((1.0 / t)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if z <= 4.5e+26: tmp = ((t_1 - math.sqrt(y)) + (1.0 - math.sqrt(x))) + (1.0 / (math.sqrt(z) + math.sqrt((z + 1.0)))) else: tmp = ((1.0 / (math.sqrt(y) + t_1)) + (1.0 + ((x * 0.5) - math.sqrt(x)))) + (0.5 * math.sqrt((1.0 / t))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 4.5e+26) tmp = Float64(Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 - sqrt(x))) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(z + 1.0))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(y) + t_1)) + Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x)))) + Float64(0.5 * sqrt(Float64(1.0 / t)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 4.5e+26)
tmp = ((t_1 - sqrt(y)) + (1.0 - sqrt(x))) + (1.0 / (sqrt(z) + sqrt((z + 1.0))));
else
tmp = ((1.0 / (sqrt(y) + t_1)) + (1.0 + ((x * 0.5) - sqrt(x)))) + (0.5 * sqrt((1.0 / t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 4.5e+26], N[(N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 4.5 \cdot 10^{+26}:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right) + \frac{1}{\sqrt{z} + \sqrt{z + 1}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{y} + t\_1} + \left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right)\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\\
\end{array}
\end{array}
if z < 4.49999999999999978e26Initial program 94.2%
associate-+l+94.2%
sub-neg94.2%
sub-neg94.2%
+-commutative94.2%
+-commutative94.2%
+-commutative94.2%
Simplified94.2%
Taylor expanded in x around 0 39.0%
Taylor expanded in t around inf 24.2%
flip--24.3%
div-inv24.3%
add-sqr-sqrt24.1%
add-sqr-sqrt24.4%
associate--l+24.7%
Applied egg-rr24.7%
+-inverses24.7%
metadata-eval24.7%
*-lft-identity24.7%
+-commutative24.7%
Simplified24.7%
if 4.49999999999999978e26 < z Initial program 84.7%
associate-+l+84.7%
sub-neg84.7%
sub-neg84.7%
+-commutative84.7%
+-commutative84.7%
+-commutative84.7%
Simplified84.7%
Taylor expanded in t around inf 40.6%
Taylor expanded in x around 0 28.4%
associate--l+28.4%
Simplified28.4%
Taylor expanded in z around inf 28.4%
flip--88.2%
div-inv88.2%
add-sqr-sqrt75.5%
add-sqr-sqrt88.7%
associate--l+93.1%
Applied egg-rr28.5%
+-inverses93.1%
metadata-eval93.1%
*-lft-identity93.1%
+-commutative93.1%
Simplified28.5%
Final simplification26.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 y))))
(if (<= z 1.95e+25)
(+ (- (sqrt (+ z 1.0)) (sqrt z)) (+ 1.0 (- t_1 (+ (sqrt x) (sqrt y)))))
(+
(+ (/ 1.0 (+ (sqrt y) t_1)) (+ 1.0 (- (* x 0.5) (sqrt x))))
(* 0.5 (sqrt (/ 1.0 t)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (z <= 1.95e+25) {
tmp = (sqrt((z + 1.0)) - sqrt(z)) + (1.0 + (t_1 - (sqrt(x) + sqrt(y))));
} else {
tmp = ((1.0 / (sqrt(y) + t_1)) + (1.0 + ((x * 0.5) - sqrt(x)))) + (0.5 * sqrt((1.0 / t)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (z <= 1.95d+25) then
tmp = (sqrt((z + 1.0d0)) - sqrt(z)) + (1.0d0 + (t_1 - (sqrt(x) + sqrt(y))))
else
tmp = ((1.0d0 / (sqrt(y) + t_1)) + (1.0d0 + ((x * 0.5d0) - sqrt(x)))) + (0.5d0 * sqrt((1.0d0 / t)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 1.95e+25) {
tmp = (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + (1.0 + (t_1 - (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = ((1.0 / (Math.sqrt(y) + t_1)) + (1.0 + ((x * 0.5) - Math.sqrt(x)))) + (0.5 * Math.sqrt((1.0 / t)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if z <= 1.95e+25: tmp = (math.sqrt((z + 1.0)) - math.sqrt(z)) + (1.0 + (t_1 - (math.sqrt(x) + math.sqrt(y)))) else: tmp = ((1.0 / (math.sqrt(y) + t_1)) + (1.0 + ((x * 0.5) - math.sqrt(x)))) + (0.5 * math.sqrt((1.0 / t))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 1.95e+25) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + Float64(1.0 + Float64(t_1 - Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(y) + t_1)) + Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x)))) + Float64(0.5 * sqrt(Float64(1.0 / t)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 1.95e+25)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + (1.0 + (t_1 - (sqrt(x) + sqrt(y))));
else
tmp = ((1.0 / (sqrt(y) + t_1)) + (1.0 + ((x * 0.5) - sqrt(x)))) + (0.5 * sqrt((1.0 / t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.95e+25], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$1 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.95 \cdot 10^{+25}:\\
\;\;\;\;\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(1 + \left(t\_1 - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{y} + t\_1} + \left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right)\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\\
\end{array}
\end{array}
if z < 1.9500000000000001e25Initial program 94.3%
associate-+l+94.3%
sub-neg94.3%
sub-neg94.3%
+-commutative94.3%
+-commutative94.3%
+-commutative94.3%
Simplified94.3%
Taylor expanded in x around 0 38.6%
Taylor expanded in t around inf 24.2%
Taylor expanded in x around 0 19.4%
associate--l+31.7%
+-commutative31.7%
Simplified31.7%
if 1.9500000000000001e25 < z Initial program 84.7%
associate-+l+84.7%
sub-neg84.7%
sub-neg84.7%
+-commutative84.7%
+-commutative84.7%
+-commutative84.7%
Simplified84.7%
Taylor expanded in t around inf 40.3%
Taylor expanded in x around 0 28.2%
associate--l+28.2%
Simplified28.2%
Taylor expanded in z around inf 28.2%
flip--88.2%
div-inv88.2%
add-sqr-sqrt75.6%
add-sqr-sqrt88.7%
associate--l+93.0%
Applied egg-rr28.3%
+-inverses93.0%
metadata-eval93.0%
*-lft-identity93.0%
+-commutative93.0%
Simplified28.3%
Final simplification30.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 4.5e-7)
(+
(- (sqrt (+ z 1.0)) (sqrt z))
(+ 2.0 (- (* y 0.5) (+ (sqrt x) (sqrt y)))))
(+
(+ (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))) (+ 1.0 (- (* x 0.5) (sqrt x))))
(* 0.5 (sqrt (/ 1.0 t))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.5e-7) {
tmp = (sqrt((z + 1.0)) - sqrt(z)) + (2.0 + ((y * 0.5) - (sqrt(x) + sqrt(y))));
} else {
tmp = ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 + ((x * 0.5) - sqrt(x)))) + (0.5 * sqrt((1.0 / t)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 4.5d-7) then
tmp = (sqrt((z + 1.0d0)) - sqrt(z)) + (2.0d0 + ((y * 0.5d0) - (sqrt(x) + sqrt(y))))
else
tmp = ((1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))) + (1.0d0 + ((x * 0.5d0) - sqrt(x)))) + (0.5d0 * sqrt((1.0d0 / t)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.5e-7) {
tmp = (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + (2.0 + ((y * 0.5) - (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = ((1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))) + (1.0 + ((x * 0.5) - Math.sqrt(x)))) + (0.5 * Math.sqrt((1.0 / t)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 4.5e-7: tmp = (math.sqrt((z + 1.0)) - math.sqrt(z)) + (2.0 + ((y * 0.5) - (math.sqrt(x) + math.sqrt(y)))) else: tmp = ((1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) + (1.0 + ((x * 0.5) - math.sqrt(x)))) + (0.5 * math.sqrt((1.0 / t))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 4.5e-7) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + Float64(2.0 + Float64(Float64(y * 0.5) - Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) + Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x)))) + Float64(0.5 * sqrt(Float64(1.0 / t)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 4.5e-7)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + (2.0 + ((y * 0.5) - (sqrt(x) + sqrt(y))));
else
tmp = ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 + ((x * 0.5) - sqrt(x)))) + (0.5 * sqrt((1.0 / t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 4.5e-7], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.5 \cdot 10^{-7}:\\
\;\;\;\;\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(2 + \left(y \cdot 0.5 - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{y} + \sqrt{1 + y}} + \left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right)\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\\
\end{array}
\end{array}
if y < 4.4999999999999998e-7Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in x around 0 46.8%
Taylor expanded in t around inf 26.6%
Taylor expanded in y around 0 26.7%
associate--l+26.7%
*-commutative26.7%
+-commutative26.7%
Simplified26.7%
if 4.4999999999999998e-7 < y Initial program 83.0%
associate-+l+83.0%
sub-neg83.0%
sub-neg83.0%
+-commutative83.0%
+-commutative83.0%
+-commutative83.0%
Simplified83.0%
Taylor expanded in t around inf 40.5%
Taylor expanded in x around 0 25.8%
associate--l+25.8%
Simplified25.8%
Taylor expanded in z around inf 16.0%
flip--86.4%
div-inv86.4%
add-sqr-sqrt52.1%
add-sqr-sqrt86.9%
associate--l+91.3%
Applied egg-rr16.1%
+-inverses91.3%
metadata-eval91.3%
*-lft-identity91.3%
+-commutative91.3%
Simplified16.1%
Final simplification21.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 0.00047)
(+
(- (sqrt (+ z 1.0)) (sqrt z))
(+ (- 1.0 (sqrt x)) (+ 1.0 (- (* y (+ 0.5 (* y -0.125))) (sqrt y)))))
(+
(+ (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))) (+ 1.0 (- (* x 0.5) (sqrt x))))
(* 0.5 (sqrt (/ 1.0 t))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.00047) {
tmp = (sqrt((z + 1.0)) - sqrt(z)) + ((1.0 - sqrt(x)) + (1.0 + ((y * (0.5 + (y * -0.125))) - sqrt(y))));
} else {
tmp = ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 + ((x * 0.5) - sqrt(x)))) + (0.5 * sqrt((1.0 / t)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 0.00047d0) then
tmp = (sqrt((z + 1.0d0)) - sqrt(z)) + ((1.0d0 - sqrt(x)) + (1.0d0 + ((y * (0.5d0 + (y * (-0.125d0)))) - sqrt(y))))
else
tmp = ((1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))) + (1.0d0 + ((x * 0.5d0) - sqrt(x)))) + (0.5d0 * sqrt((1.0d0 / t)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.00047) {
tmp = (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + ((1.0 - Math.sqrt(x)) + (1.0 + ((y * (0.5 + (y * -0.125))) - Math.sqrt(y))));
} else {
tmp = ((1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))) + (1.0 + ((x * 0.5) - Math.sqrt(x)))) + (0.5 * Math.sqrt((1.0 / t)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 0.00047: tmp = (math.sqrt((z + 1.0)) - math.sqrt(z)) + ((1.0 - math.sqrt(x)) + (1.0 + ((y * (0.5 + (y * -0.125))) - math.sqrt(y)))) else: tmp = ((1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) + (1.0 + ((x * 0.5) - math.sqrt(x)))) + (0.5 * math.sqrt((1.0 / t))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 0.00047) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 + Float64(Float64(y * Float64(0.5 + Float64(y * -0.125))) - sqrt(y))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) + Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x)))) + Float64(0.5 * sqrt(Float64(1.0 / t)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 0.00047)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + ((1.0 - sqrt(x)) + (1.0 + ((y * (0.5 + (y * -0.125))) - sqrt(y))));
else
tmp = ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 + ((x * 0.5) - sqrt(x)))) + (0.5 * sqrt((1.0 / t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 0.00047], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(y * N[(0.5 + N[(y * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.00047:\\
\;\;\;\;\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\left(1 - \sqrt{x}\right) + \left(1 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{y} + \sqrt{1 + y}} + \left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right)\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\\
\end{array}
\end{array}
if y < 4.69999999999999986e-4Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in x around 0 46.9%
Taylor expanded in t around inf 26.6%
Taylor expanded in y around 0 26.6%
associate--l+20.5%
Simplified26.6%
if 4.69999999999999986e-4 < y Initial program 82.8%
associate-+l+82.8%
sub-neg82.8%
sub-neg82.8%
+-commutative82.8%
+-commutative82.8%
+-commutative82.8%
Simplified82.8%
Taylor expanded in t around inf 40.7%
Taylor expanded in x around 0 25.9%
associate--l+25.9%
Simplified25.9%
Taylor expanded in z around inf 16.0%
flip--86.3%
div-inv86.3%
add-sqr-sqrt51.7%
add-sqr-sqrt86.8%
associate--l+91.2%
Applied egg-rr16.1%
+-inverses91.2%
metadata-eval91.2%
*-lft-identity91.2%
+-commutative91.2%
Simplified16.1%
Final simplification21.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 (<= z 2800000000000.0)
(+ (- (sqrt (+ z 1.0)) (sqrt z)) (- (- 2.0 (sqrt y)) (sqrt x)))
(+
(* 0.5 (sqrt (/ 1.0 t)))
(+ 1.0 (- (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 <= 2800000000000.0) {
tmp = (sqrt((z + 1.0)) - sqrt(z)) + ((2.0 - sqrt(y)) - sqrt(x));
} else {
tmp = (0.5 * sqrt((1.0 / t))) + (1.0 + (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 <= 2800000000000.0d0) then
tmp = (sqrt((z + 1.0d0)) - sqrt(z)) + ((2.0d0 - sqrt(y)) - sqrt(x))
else
tmp = (0.5d0 * sqrt((1.0d0 / t))) + (1.0d0 + (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 <= 2800000000000.0) {
tmp = (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + ((2.0 - Math.sqrt(y)) - Math.sqrt(x));
} else {
tmp = (0.5 * Math.sqrt((1.0 / t))) + (1.0 + (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 <= 2800000000000.0: tmp = (math.sqrt((z + 1.0)) - math.sqrt(z)) + ((2.0 - math.sqrt(y)) - math.sqrt(x)) else: tmp = (0.5 * math.sqrt((1.0 / t))) + (1.0 + (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 <= 2800000000000.0) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + Float64(Float64(2.0 - sqrt(y)) - sqrt(x))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / t))) + Float64(1.0 + 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 <= 2800000000000.0)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + ((2.0 - sqrt(y)) - sqrt(x));
else
tmp = (0.5 * sqrt((1.0 / t))) + (1.0 + (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, 2800000000000.0], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2800000000000:\\
\;\;\;\;\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\left(2 - \sqrt{y}\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{t}} + \left(1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\end{array}
\end{array}
if z < 2.8e12Initial program 96.2%
associate-+l+96.2%
sub-neg96.2%
sub-neg96.2%
+-commutative96.2%
+-commutative96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in x around 0 39.4%
Taylor expanded in t around inf 24.2%
Taylor expanded in y around 0 11.0%
+-commutative11.0%
associate--r+11.0%
Simplified11.0%
if 2.8e12 < z Initial program 83.2%
associate-+l+83.2%
sub-neg83.2%
sub-neg83.2%
+-commutative83.2%
+-commutative83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in t around inf 40.3%
Taylor expanded in x around 0 28.1%
associate--l+28.1%
Simplified28.1%
Taylor expanded in z around inf 28.1%
Taylor expanded in x around 0 20.4%
associate--l+26.4%
+-commutative26.4%
Simplified26.4%
Final simplification18.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (sqrt x) (sqrt y))))
(if (<= z 3000000000000.0)
(+ (- (sqrt (+ z 1.0)) (sqrt z)) (+ 2.0 (- (* y 0.5) t_1)))
(+ (* 0.5 (sqrt (/ 1.0 t))) (+ 1.0 (- (sqrt (+ 1.0 y)) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(x) + sqrt(y);
double tmp;
if (z <= 3000000000000.0) {
tmp = (sqrt((z + 1.0)) - sqrt(z)) + (2.0 + ((y * 0.5) - t_1));
} else {
tmp = (0.5 * sqrt((1.0 / t))) + (1.0 + (sqrt((1.0 + 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(x) + sqrt(y)
if (z <= 3000000000000.0d0) then
tmp = (sqrt((z + 1.0d0)) - sqrt(z)) + (2.0d0 + ((y * 0.5d0) - t_1))
else
tmp = (0.5d0 * sqrt((1.0d0 / t))) + (1.0d0 + (sqrt((1.0d0 + 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(x) + Math.sqrt(y);
double tmp;
if (z <= 3000000000000.0) {
tmp = (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + (2.0 + ((y * 0.5) - t_1));
} else {
tmp = (0.5 * Math.sqrt((1.0 / t))) + (1.0 + (Math.sqrt((1.0 + y)) - t_1));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(x) + math.sqrt(y) tmp = 0 if z <= 3000000000000.0: tmp = (math.sqrt((z + 1.0)) - math.sqrt(z)) + (2.0 + ((y * 0.5) - t_1)) else: tmp = (0.5 * math.sqrt((1.0 / t))) + (1.0 + (math.sqrt((1.0 + y)) - t_1)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(x) + sqrt(y)) tmp = 0.0 if (z <= 3000000000000.0) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + Float64(2.0 + Float64(Float64(y * 0.5) - t_1))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / t))) + Float64(1.0 + Float64(sqrt(Float64(1.0 + 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(x) + sqrt(y);
tmp = 0.0;
if (z <= 3000000000000.0)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + (2.0 + ((y * 0.5) - t_1));
else
tmp = (0.5 * sqrt((1.0 / t))) + (1.0 + (sqrt((1.0 + 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[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 3000000000000.0], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x} + \sqrt{y}\\
\mathbf{if}\;z \leq 3000000000000:\\
\;\;\;\;\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(2 + \left(y \cdot 0.5 - t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{t}} + \left(1 + \left(\sqrt{1 + y} - t\_1\right)\right)\\
\end{array}
\end{array}
if z < 3e12Initial program 96.2%
associate-+l+96.2%
sub-neg96.2%
sub-neg96.2%
+-commutative96.2%
+-commutative96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in x around 0 39.4%
Taylor expanded in t around inf 24.2%
Taylor expanded in y around 0 12.6%
associate--l+12.6%
*-commutative12.6%
+-commutative12.6%
Simplified12.6%
if 3e12 < z Initial program 83.2%
associate-+l+83.2%
sub-neg83.2%
sub-neg83.2%
+-commutative83.2%
+-commutative83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in t around inf 40.3%
Taylor expanded in x around 0 28.1%
associate--l+28.1%
Simplified28.1%
Taylor expanded in z around inf 28.1%
Taylor expanded in x around 0 20.4%
associate--l+26.4%
+-commutative26.4%
Simplified26.4%
Final simplification19.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 (<= z 1020000.0)
(+
(- (sqrt (+ z 1.0)) (sqrt z))
(+ 2.0 (- (* y 0.5) (+ (sqrt x) (sqrt y)))))
(+
(* 0.5 (sqrt (/ 1.0 z)))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- 1.0 (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1020000.0) {
tmp = (sqrt((z + 1.0)) - sqrt(z)) + (2.0 + ((y * 0.5) - (sqrt(x) + sqrt(y))));
} else {
tmp = (0.5 * sqrt((1.0 / z))) + ((sqrt((1.0 + y)) - sqrt(y)) + (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 <= 1020000.0d0) then
tmp = (sqrt((z + 1.0d0)) - sqrt(z)) + (2.0d0 + ((y * 0.5d0) - (sqrt(x) + sqrt(y))))
else
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (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 <= 1020000.0) {
tmp = (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + (2.0 + ((y * 0.5) - (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (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 <= 1020000.0: tmp = (math.sqrt((z + 1.0)) - math.sqrt(z)) + (2.0 + ((y * 0.5) - (math.sqrt(x) + math.sqrt(y)))) else: tmp = (0.5 * math.sqrt((1.0 / z))) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (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 <= 1020000.0) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + Float64(2.0 + Float64(Float64(y * 0.5) - Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 - sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1020000.0)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + (2.0 + ((y * 0.5) - (sqrt(x) + sqrt(y))));
else
tmp = (0.5 * sqrt((1.0 / z))) + ((sqrt((1.0 + y)) - sqrt(y)) + (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, 1020000.0], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1020000:\\
\;\;\;\;\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(2 + \left(y \cdot 0.5 - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if z < 1.02e6Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 40.8%
Taylor expanded in t around inf 24.6%
Taylor expanded in y around 0 12.0%
associate--l+12.0%
*-commutative12.0%
+-commutative12.0%
Simplified12.0%
if 1.02e6 < z Initial program 82.8%
associate-+l+82.8%
sub-neg82.8%
sub-neg82.8%
+-commutative82.8%
+-commutative82.8%
+-commutative82.8%
Simplified82.8%
Taylor expanded in x around 0 49.8%
Taylor expanded in t around inf 28.1%
Taylor expanded in z around inf 28.4%
Final simplification20.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 (* 0.5 (sqrt (/ 1.0 t)))) (t_2 (+ 1.0 (- (* x 0.5) (sqrt x)))))
(if (<= y 4.5e-21)
(+ (- (sqrt (+ z 1.0)) (sqrt z)) (- (- 2.0 (sqrt y)) (sqrt x)))
(if (<= y 1.3)
(+
t_1
(+
t_2
(- (+ 1.0 (* y (+ 0.5 (* y (- (* y 0.0625) 0.125))))) (sqrt y))))
(+ t_1 (+ t_2 (* 0.5 (sqrt (/ 1.0 y)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 0.5 * sqrt((1.0 / t));
double t_2 = 1.0 + ((x * 0.5) - sqrt(x));
double tmp;
if (y <= 4.5e-21) {
tmp = (sqrt((z + 1.0)) - sqrt(z)) + ((2.0 - sqrt(y)) - sqrt(x));
} else if (y <= 1.3) {
tmp = t_1 + (t_2 + ((1.0 + (y * (0.5 + (y * ((y * 0.0625) - 0.125))))) - sqrt(y)));
} else {
tmp = t_1 + (t_2 + (0.5 * sqrt((1.0 / y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 0.5d0 * sqrt((1.0d0 / t))
t_2 = 1.0d0 + ((x * 0.5d0) - sqrt(x))
if (y <= 4.5d-21) then
tmp = (sqrt((z + 1.0d0)) - sqrt(z)) + ((2.0d0 - sqrt(y)) - sqrt(x))
else if (y <= 1.3d0) then
tmp = t_1 + (t_2 + ((1.0d0 + (y * (0.5d0 + (y * ((y * 0.0625d0) - 0.125d0))))) - sqrt(y)))
else
tmp = t_1 + (t_2 + (0.5d0 * sqrt((1.0d0 / y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 0.5 * Math.sqrt((1.0 / t));
double t_2 = 1.0 + ((x * 0.5) - Math.sqrt(x));
double tmp;
if (y <= 4.5e-21) {
tmp = (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + ((2.0 - Math.sqrt(y)) - Math.sqrt(x));
} else if (y <= 1.3) {
tmp = t_1 + (t_2 + ((1.0 + (y * (0.5 + (y * ((y * 0.0625) - 0.125))))) - Math.sqrt(y)));
} else {
tmp = t_1 + (t_2 + (0.5 * Math.sqrt((1.0 / y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 0.5 * math.sqrt((1.0 / t)) t_2 = 1.0 + ((x * 0.5) - math.sqrt(x)) tmp = 0 if y <= 4.5e-21: tmp = (math.sqrt((z + 1.0)) - math.sqrt(z)) + ((2.0 - math.sqrt(y)) - math.sqrt(x)) elif y <= 1.3: tmp = t_1 + (t_2 + ((1.0 + (y * (0.5 + (y * ((y * 0.0625) - 0.125))))) - math.sqrt(y))) else: tmp = t_1 + (t_2 + (0.5 * math.sqrt((1.0 / y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(0.5 * sqrt(Float64(1.0 / t))) t_2 = Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))) tmp = 0.0 if (y <= 4.5e-21) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + Float64(Float64(2.0 - sqrt(y)) - sqrt(x))); elseif (y <= 1.3) tmp = Float64(t_1 + Float64(t_2 + Float64(Float64(1.0 + Float64(y * Float64(0.5 + Float64(y * Float64(Float64(y * 0.0625) - 0.125))))) - sqrt(y)))); else tmp = Float64(t_1 + Float64(t_2 + Float64(0.5 * sqrt(Float64(1.0 / y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 0.5 * sqrt((1.0 / t));
t_2 = 1.0 + ((x * 0.5) - sqrt(x));
tmp = 0.0;
if (y <= 4.5e-21)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + ((2.0 - sqrt(y)) - sqrt(x));
elseif (y <= 1.3)
tmp = t_1 + (t_2 + ((1.0 + (y * (0.5 + (y * ((y * 0.0625) - 0.125))))) - sqrt(y)));
else
tmp = t_1 + (t_2 + (0.5 * sqrt((1.0 / y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4.5e-21], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3], N[(t$95$1 + N[(t$95$2 + N[(N[(1.0 + N[(y * N[(0.5 + N[(y * N[(N[(y * 0.0625), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(t$95$2 + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 0.5 \cdot \sqrt{\frac{1}{t}}\\
t_2 := 1 + \left(x \cdot 0.5 - \sqrt{x}\right)\\
\mathbf{if}\;y \leq 4.5 \cdot 10^{-21}:\\
\;\;\;\;\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\left(2 - \sqrt{y}\right) - \sqrt{x}\right)\\
\mathbf{elif}\;y \leq 1.3:\\
\;\;\;\;t\_1 + \left(t\_2 + \left(\left(1 + y \cdot \left(0.5 + y \cdot \left(y \cdot 0.0625 - 0.125\right)\right)\right) - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(t\_2 + 0.5 \cdot \sqrt{\frac{1}{y}}\right)\\
\end{array}
\end{array}
if y < 4.49999999999999968e-21Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in x around 0 46.4%
Taylor expanded in t around inf 26.7%
Taylor expanded in y around 0 26.7%
+-commutative26.7%
associate--r+26.7%
Simplified26.7%
if 4.49999999999999968e-21 < y < 1.30000000000000004Initial program 100.0%
associate-+l+100.0%
sub-neg100.0%
sub-neg100.0%
+-commutative100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in t around inf 11.7%
Taylor expanded in x around 0 11.7%
associate--l+11.7%
Simplified11.7%
Taylor expanded in z around inf 11.7%
Taylor expanded in y around 0 11.7%
if 1.30000000000000004 < y Initial program 82.8%
associate-+l+82.8%
sub-neg82.8%
sub-neg82.8%
+-commutative82.8%
+-commutative82.8%
+-commutative82.8%
Simplified82.8%
Taylor expanded in t around inf 40.7%
Taylor expanded in x around 0 25.9%
associate--l+25.9%
Simplified25.9%
Taylor expanded in z around inf 16.0%
Taylor expanded in y around inf 15.6%
Final simplification21.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 (+ 1.0 (- (* x 0.5) (sqrt x)))) (t_2 (* 0.5 (sqrt (/ 1.0 t)))))
(if (<= y 1.3)
(+
t_2
(+ t_1 (- (+ 1.0 (* y (+ 0.5 (* y (- (* y 0.0625) 0.125))))) (sqrt y))))
(+ t_2 (+ t_1 (* 0.5 (sqrt (/ 1.0 y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 + ((x * 0.5) - sqrt(x));
double t_2 = 0.5 * sqrt((1.0 / t));
double tmp;
if (y <= 1.3) {
tmp = t_2 + (t_1 + ((1.0 + (y * (0.5 + (y * ((y * 0.0625) - 0.125))))) - sqrt(y)));
} else {
tmp = t_2 + (t_1 + (0.5 * sqrt((1.0 / y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 + ((x * 0.5d0) - sqrt(x))
t_2 = 0.5d0 * sqrt((1.0d0 / t))
if (y <= 1.3d0) then
tmp = t_2 + (t_1 + ((1.0d0 + (y * (0.5d0 + (y * ((y * 0.0625d0) - 0.125d0))))) - sqrt(y)))
else
tmp = t_2 + (t_1 + (0.5d0 * sqrt((1.0d0 / y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 + ((x * 0.5) - Math.sqrt(x));
double t_2 = 0.5 * Math.sqrt((1.0 / t));
double tmp;
if (y <= 1.3) {
tmp = t_2 + (t_1 + ((1.0 + (y * (0.5 + (y * ((y * 0.0625) - 0.125))))) - Math.sqrt(y)));
} else {
tmp = t_2 + (t_1 + (0.5 * Math.sqrt((1.0 / y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 + ((x * 0.5) - math.sqrt(x)) t_2 = 0.5 * math.sqrt((1.0 / t)) tmp = 0 if y <= 1.3: tmp = t_2 + (t_1 + ((1.0 + (y * (0.5 + (y * ((y * 0.0625) - 0.125))))) - math.sqrt(y))) else: tmp = t_2 + (t_1 + (0.5 * math.sqrt((1.0 / y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))) t_2 = Float64(0.5 * sqrt(Float64(1.0 / t))) tmp = 0.0 if (y <= 1.3) tmp = Float64(t_2 + Float64(t_1 + Float64(Float64(1.0 + Float64(y * Float64(0.5 + Float64(y * Float64(Float64(y * 0.0625) - 0.125))))) - sqrt(y)))); else tmp = Float64(t_2 + Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 + ((x * 0.5) - sqrt(x));
t_2 = 0.5 * sqrt((1.0 / t));
tmp = 0.0;
if (y <= 1.3)
tmp = t_2 + (t_1 + ((1.0 + (y * (0.5 + (y * ((y * 0.0625) - 0.125))))) - sqrt(y)));
else
tmp = t_2 + (t_1 + (0.5 * sqrt((1.0 / y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.3], N[(t$95$2 + N[(t$95$1 + N[(N[(1.0 + N[(y * N[(0.5 + N[(y * N[(N[(y * 0.0625), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 1 + \left(x \cdot 0.5 - \sqrt{x}\right)\\
t_2 := 0.5 \cdot \sqrt{\frac{1}{t}}\\
\mathbf{if}\;y \leq 1.3:\\
\;\;\;\;t\_2 + \left(t\_1 + \left(\left(1 + y \cdot \left(0.5 + y \cdot \left(y \cdot 0.0625 - 0.125\right)\right)\right) - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{y}}\right)\\
\end{array}
\end{array}
if y < 1.30000000000000004Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in t around inf 51.4%
Taylor expanded in x around 0 26.7%
associate--l+26.7%
Simplified26.7%
Taylor expanded in z around inf 20.5%
Taylor expanded in y around 0 20.5%
if 1.30000000000000004 < y Initial program 82.8%
associate-+l+82.8%
sub-neg82.8%
sub-neg82.8%
+-commutative82.8%
+-commutative82.8%
+-commutative82.8%
Simplified82.8%
Taylor expanded in t around inf 40.7%
Taylor expanded in x around 0 25.9%
associate--l+25.9%
Simplified25.9%
Taylor expanded in z around inf 16.0%
Taylor expanded in y around inf 15.6%
Final simplification18.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 0.5 (sqrt (/ 1.0 t)))))
(if (<= y 1.3)
(+
t_1
(-
(+ 2.0 (+ (* x 0.5) (* y (+ 0.5 (* y (- (* y 0.0625) 0.125))))))
(+ (sqrt x) (sqrt y))))
(+ t_1 (+ (+ 1.0 (- (* x 0.5) (sqrt x))) (* 0.5 (sqrt (/ 1.0 y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 0.5 * sqrt((1.0 / t));
double tmp;
if (y <= 1.3) {
tmp = t_1 + ((2.0 + ((x * 0.5) + (y * (0.5 + (y * ((y * 0.0625) - 0.125)))))) - (sqrt(x) + sqrt(y)));
} else {
tmp = t_1 + ((1.0 + ((x * 0.5) - sqrt(x))) + (0.5 * sqrt((1.0 / y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 * sqrt((1.0d0 / t))
if (y <= 1.3d0) then
tmp = t_1 + ((2.0d0 + ((x * 0.5d0) + (y * (0.5d0 + (y * ((y * 0.0625d0) - 0.125d0)))))) - (sqrt(x) + sqrt(y)))
else
tmp = t_1 + ((1.0d0 + ((x * 0.5d0) - sqrt(x))) + (0.5d0 * sqrt((1.0d0 / y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 0.5 * Math.sqrt((1.0 / t));
double tmp;
if (y <= 1.3) {
tmp = t_1 + ((2.0 + ((x * 0.5) + (y * (0.5 + (y * ((y * 0.0625) - 0.125)))))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = t_1 + ((1.0 + ((x * 0.5) - Math.sqrt(x))) + (0.5 * Math.sqrt((1.0 / y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 0.5 * math.sqrt((1.0 / t)) tmp = 0 if y <= 1.3: tmp = t_1 + ((2.0 + ((x * 0.5) + (y * (0.5 + (y * ((y * 0.0625) - 0.125)))))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = t_1 + ((1.0 + ((x * 0.5) - math.sqrt(x))) + (0.5 * math.sqrt((1.0 / y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(0.5 * sqrt(Float64(1.0 / t))) tmp = 0.0 if (y <= 1.3) tmp = Float64(t_1 + Float64(Float64(2.0 + Float64(Float64(x * 0.5) + Float64(y * Float64(0.5 + Float64(y * Float64(Float64(y * 0.0625) - 0.125)))))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(t_1 + Float64(Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))) + Float64(0.5 * sqrt(Float64(1.0 / y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 0.5 * sqrt((1.0 / t));
tmp = 0.0;
if (y <= 1.3)
tmp = t_1 + ((2.0 + ((x * 0.5) + (y * (0.5 + (y * ((y * 0.0625) - 0.125)))))) - (sqrt(x) + sqrt(y)));
else
tmp = t_1 + ((1.0 + ((x * 0.5) - sqrt(x))) + (0.5 * sqrt((1.0 / y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.3], N[(t$95$1 + N[(N[(2.0 + N[(N[(x * 0.5), $MachinePrecision] + N[(y * N[(0.5 + N[(y * N[(N[(y * 0.0625), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 0.5 \cdot \sqrt{\frac{1}{t}}\\
\mathbf{if}\;y \leq 1.3:\\
\;\;\;\;t\_1 + \left(\left(2 + \left(x \cdot 0.5 + y \cdot \left(0.5 + y \cdot \left(y \cdot 0.0625 - 0.125\right)\right)\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right) + 0.5 \cdot \sqrt{\frac{1}{y}}\right)\\
\end{array}
\end{array}
if y < 1.30000000000000004Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in t around inf 51.4%
Taylor expanded in x around 0 26.7%
associate--l+26.7%
Simplified26.7%
Taylor expanded in z around inf 20.5%
Taylor expanded in y around 0 20.5%
if 1.30000000000000004 < y Initial program 82.8%
associate-+l+82.8%
sub-neg82.8%
sub-neg82.8%
+-commutative82.8%
+-commutative82.8%
+-commutative82.8%
Simplified82.8%
Taylor expanded in t around inf 40.7%
Taylor expanded in x around 0 25.9%
associate--l+25.9%
Simplified25.9%
Taylor expanded in z around inf 16.0%
Taylor expanded in y around inf 15.6%
Final simplification18.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ 1.0 (- (* x 0.5) (sqrt x)))) (t_2 (* 0.5 (sqrt (/ 1.0 t)))))
(if (<= y 1.25)
(+ t_2 (+ t_1 (+ 1.0 (- (* y (+ 0.5 (* y -0.125))) (sqrt y)))))
(+ t_2 (+ t_1 (* 0.5 (sqrt (/ 1.0 y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 + ((x * 0.5) - sqrt(x));
double t_2 = 0.5 * sqrt((1.0 / t));
double tmp;
if (y <= 1.25) {
tmp = t_2 + (t_1 + (1.0 + ((y * (0.5 + (y * -0.125))) - sqrt(y))));
} else {
tmp = t_2 + (t_1 + (0.5 * sqrt((1.0 / y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 + ((x * 0.5d0) - sqrt(x))
t_2 = 0.5d0 * sqrt((1.0d0 / t))
if (y <= 1.25d0) then
tmp = t_2 + (t_1 + (1.0d0 + ((y * (0.5d0 + (y * (-0.125d0)))) - sqrt(y))))
else
tmp = t_2 + (t_1 + (0.5d0 * sqrt((1.0d0 / y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 + ((x * 0.5) - Math.sqrt(x));
double t_2 = 0.5 * Math.sqrt((1.0 / t));
double tmp;
if (y <= 1.25) {
tmp = t_2 + (t_1 + (1.0 + ((y * (0.5 + (y * -0.125))) - Math.sqrt(y))));
} else {
tmp = t_2 + (t_1 + (0.5 * Math.sqrt((1.0 / y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 + ((x * 0.5) - math.sqrt(x)) t_2 = 0.5 * math.sqrt((1.0 / t)) tmp = 0 if y <= 1.25: tmp = t_2 + (t_1 + (1.0 + ((y * (0.5 + (y * -0.125))) - math.sqrt(y)))) else: tmp = t_2 + (t_1 + (0.5 * math.sqrt((1.0 / y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))) t_2 = Float64(0.5 * sqrt(Float64(1.0 / t))) tmp = 0.0 if (y <= 1.25) tmp = Float64(t_2 + Float64(t_1 + Float64(1.0 + Float64(Float64(y * Float64(0.5 + Float64(y * -0.125))) - sqrt(y))))); else tmp = Float64(t_2 + Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 + ((x * 0.5) - sqrt(x));
t_2 = 0.5 * sqrt((1.0 / t));
tmp = 0.0;
if (y <= 1.25)
tmp = t_2 + (t_1 + (1.0 + ((y * (0.5 + (y * -0.125))) - sqrt(y))));
else
tmp = t_2 + (t_1 + (0.5 * sqrt((1.0 / y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.25], N[(t$95$2 + N[(t$95$1 + N[(1.0 + N[(N[(y * N[(0.5 + N[(y * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 1 + \left(x \cdot 0.5 - \sqrt{x}\right)\\
t_2 := 0.5 \cdot \sqrt{\frac{1}{t}}\\
\mathbf{if}\;y \leq 1.25:\\
\;\;\;\;t\_2 + \left(t\_1 + \left(1 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{y}}\right)\\
\end{array}
\end{array}
if y < 1.25Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in t around inf 51.4%
Taylor expanded in x around 0 26.7%
associate--l+26.7%
Simplified26.7%
Taylor expanded in z around inf 20.5%
Taylor expanded in y around 0 20.5%
associate--l+20.5%
Simplified20.5%
if 1.25 < y Initial program 82.8%
associate-+l+82.8%
sub-neg82.8%
sub-neg82.8%
+-commutative82.8%
+-commutative82.8%
+-commutative82.8%
Simplified82.8%
Taylor expanded in t around inf 40.7%
Taylor expanded in x around 0 25.9%
associate--l+25.9%
Simplified25.9%
Taylor expanded in z around inf 16.0%
Taylor expanded in y around inf 15.6%
Final simplification18.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 0.5 (sqrt (/ 1.0 t)))))
(if (<= y 1.2)
(+
t_1
(-
(+ 2.0 (+ (* x 0.5) (* y (+ 0.5 (* y -0.125)))))
(+ (sqrt x) (sqrt y))))
(+ t_1 (+ (+ 1.0 (- (* x 0.5) (sqrt x))) (* 0.5 (sqrt (/ 1.0 y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 0.5 * sqrt((1.0 / t));
double tmp;
if (y <= 1.2) {
tmp = t_1 + ((2.0 + ((x * 0.5) + (y * (0.5 + (y * -0.125))))) - (sqrt(x) + sqrt(y)));
} else {
tmp = t_1 + ((1.0 + ((x * 0.5) - sqrt(x))) + (0.5 * sqrt((1.0 / y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 * sqrt((1.0d0 / t))
if (y <= 1.2d0) then
tmp = t_1 + ((2.0d0 + ((x * 0.5d0) + (y * (0.5d0 + (y * (-0.125d0)))))) - (sqrt(x) + sqrt(y)))
else
tmp = t_1 + ((1.0d0 + ((x * 0.5d0) - sqrt(x))) + (0.5d0 * sqrt((1.0d0 / y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 0.5 * Math.sqrt((1.0 / t));
double tmp;
if (y <= 1.2) {
tmp = t_1 + ((2.0 + ((x * 0.5) + (y * (0.5 + (y * -0.125))))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = t_1 + ((1.0 + ((x * 0.5) - Math.sqrt(x))) + (0.5 * Math.sqrt((1.0 / y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 0.5 * math.sqrt((1.0 / t)) tmp = 0 if y <= 1.2: tmp = t_1 + ((2.0 + ((x * 0.5) + (y * (0.5 + (y * -0.125))))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = t_1 + ((1.0 + ((x * 0.5) - math.sqrt(x))) + (0.5 * math.sqrt((1.0 / y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(0.5 * sqrt(Float64(1.0 / t))) tmp = 0.0 if (y <= 1.2) tmp = Float64(t_1 + Float64(Float64(2.0 + Float64(Float64(x * 0.5) + Float64(y * Float64(0.5 + Float64(y * -0.125))))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(t_1 + Float64(Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))) + Float64(0.5 * sqrt(Float64(1.0 / y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 0.5 * sqrt((1.0 / t));
tmp = 0.0;
if (y <= 1.2)
tmp = t_1 + ((2.0 + ((x * 0.5) + (y * (0.5 + (y * -0.125))))) - (sqrt(x) + sqrt(y)));
else
tmp = t_1 + ((1.0 + ((x * 0.5) - sqrt(x))) + (0.5 * sqrt((1.0 / y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.2], N[(t$95$1 + N[(N[(2.0 + N[(N[(x * 0.5), $MachinePrecision] + N[(y * N[(0.5 + N[(y * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 0.5 \cdot \sqrt{\frac{1}{t}}\\
\mathbf{if}\;y \leq 1.2:\\
\;\;\;\;t\_1 + \left(\left(2 + \left(x \cdot 0.5 + y \cdot \left(0.5 + y \cdot -0.125\right)\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right) + 0.5 \cdot \sqrt{\frac{1}{y}}\right)\\
\end{array}
\end{array}
if y < 1.19999999999999996Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in t around inf 51.4%
Taylor expanded in x around 0 26.7%
associate--l+26.7%
Simplified26.7%
Taylor expanded in z around inf 20.5%
Taylor expanded in y around 0 20.5%
if 1.19999999999999996 < y Initial program 82.8%
associate-+l+82.8%
sub-neg82.8%
sub-neg82.8%
+-commutative82.8%
+-commutative82.8%
+-commutative82.8%
Simplified82.8%
Taylor expanded in t around inf 40.7%
Taylor expanded in x around 0 25.9%
associate--l+25.9%
Simplified25.9%
Taylor expanded in z around inf 16.0%
Taylor expanded in y around inf 15.6%
Final simplification18.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 0.5 (sqrt (/ 1.0 t)))))
(if (<= y 1.0)
(+ t_1 (+ 2.0 (- (* 0.5 (+ x y)) (+ (sqrt x) (sqrt y)))))
(+ t_1 (+ (+ 1.0 (- (* x 0.5) (sqrt x))) (* 0.5 (sqrt (/ 1.0 y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 0.5 * sqrt((1.0 / t));
double tmp;
if (y <= 1.0) {
tmp = t_1 + (2.0 + ((0.5 * (x + y)) - (sqrt(x) + sqrt(y))));
} else {
tmp = t_1 + ((1.0 + ((x * 0.5) - sqrt(x))) + (0.5 * sqrt((1.0 / y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 * sqrt((1.0d0 / t))
if (y <= 1.0d0) then
tmp = t_1 + (2.0d0 + ((0.5d0 * (x + y)) - (sqrt(x) + sqrt(y))))
else
tmp = t_1 + ((1.0d0 + ((x * 0.5d0) - sqrt(x))) + (0.5d0 * sqrt((1.0d0 / y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 0.5 * Math.sqrt((1.0 / t));
double tmp;
if (y <= 1.0) {
tmp = t_1 + (2.0 + ((0.5 * (x + y)) - (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = t_1 + ((1.0 + ((x * 0.5) - Math.sqrt(x))) + (0.5 * Math.sqrt((1.0 / y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 0.5 * math.sqrt((1.0 / t)) tmp = 0 if y <= 1.0: tmp = t_1 + (2.0 + ((0.5 * (x + y)) - (math.sqrt(x) + math.sqrt(y)))) else: tmp = t_1 + ((1.0 + ((x * 0.5) - math.sqrt(x))) + (0.5 * math.sqrt((1.0 / y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(0.5 * sqrt(Float64(1.0 / t))) tmp = 0.0 if (y <= 1.0) tmp = Float64(t_1 + Float64(2.0 + Float64(Float64(0.5 * Float64(x + y)) - Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(t_1 + Float64(Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))) + Float64(0.5 * sqrt(Float64(1.0 / y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 0.5 * sqrt((1.0 / t));
tmp = 0.0;
if (y <= 1.0)
tmp = t_1 + (2.0 + ((0.5 * (x + y)) - (sqrt(x) + sqrt(y))));
else
tmp = t_1 + ((1.0 + ((x * 0.5) - sqrt(x))) + (0.5 * sqrt((1.0 / y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.0], N[(t$95$1 + N[(2.0 + N[(N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 0.5 \cdot \sqrt{\frac{1}{t}}\\
\mathbf{if}\;y \leq 1:\\
\;\;\;\;t\_1 + \left(2 + \left(0.5 \cdot \left(x + y\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right) + 0.5 \cdot \sqrt{\frac{1}{y}}\right)\\
\end{array}
\end{array}
if y < 1Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in t around inf 51.4%
Taylor expanded in x around 0 26.7%
associate--l+26.7%
Simplified26.7%
Taylor expanded in z around inf 20.5%
Taylor expanded in y around 0 20.5%
associate--l+20.5%
distribute-lft-out20.5%
+-commutative20.5%
Simplified20.5%
if 1 < y Initial program 82.8%
associate-+l+82.8%
sub-neg82.8%
sub-neg82.8%
+-commutative82.8%
+-commutative82.8%
+-commutative82.8%
Simplified82.8%
Taylor expanded in t around inf 40.7%
Taylor expanded in x around 0 25.9%
associate--l+25.9%
Simplified25.9%
Taylor expanded in z around inf 16.0%
Taylor expanded in y around inf 15.6%
Final simplification18.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 0.5 (sqrt (/ 1.0 t)))))
(if (<= y 2.4)
(+ t_1 (+ 2.0 (- (* 0.5 (+ x y)) (+ (sqrt x) (sqrt y)))))
(+ (+ 1.0 (- (* x 0.5) (sqrt x))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 0.5 * sqrt((1.0 / t));
double tmp;
if (y <= 2.4) {
tmp = t_1 + (2.0 + ((0.5 * (x + y)) - (sqrt(x) + sqrt(y))));
} else {
tmp = (1.0 + ((x * 0.5) - sqrt(x))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 * sqrt((1.0d0 / t))
if (y <= 2.4d0) then
tmp = t_1 + (2.0d0 + ((0.5d0 * (x + y)) - (sqrt(x) + sqrt(y))))
else
tmp = (1.0d0 + ((x * 0.5d0) - sqrt(x))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 0.5 * Math.sqrt((1.0 / t));
double tmp;
if (y <= 2.4) {
tmp = t_1 + (2.0 + ((0.5 * (x + y)) - (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = (1.0 + ((x * 0.5) - Math.sqrt(x))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 0.5 * math.sqrt((1.0 / t)) tmp = 0 if y <= 2.4: tmp = t_1 + (2.0 + ((0.5 * (x + y)) - (math.sqrt(x) + math.sqrt(y)))) else: tmp = (1.0 + ((x * 0.5) - math.sqrt(x))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(0.5 * sqrt(Float64(1.0 / t))) tmp = 0.0 if (y <= 2.4) tmp = Float64(t_1 + Float64(2.0 + Float64(Float64(0.5 * Float64(x + y)) - Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 0.5 * sqrt((1.0 / t));
tmp = 0.0;
if (y <= 2.4)
tmp = t_1 + (2.0 + ((0.5 * (x + y)) - (sqrt(x) + sqrt(y))));
else
tmp = (1.0 + ((x * 0.5) - sqrt(x))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.4], N[(t$95$1 + N[(2.0 + N[(N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $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 := 0.5 \cdot \sqrt{\frac{1}{t}}\\
\mathbf{if}\;y \leq 2.4:\\
\;\;\;\;t\_1 + \left(2 + \left(0.5 \cdot \left(x + y\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right) + t\_1\\
\end{array}
\end{array}
if y < 2.39999999999999991Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in t around inf 51.4%
Taylor expanded in x around 0 26.7%
associate--l+26.7%
Simplified26.7%
Taylor expanded in z around inf 20.5%
Taylor expanded in y around 0 20.5%
associate--l+20.5%
distribute-lft-out20.5%
+-commutative20.5%
Simplified20.5%
if 2.39999999999999991 < y Initial program 82.8%
associate-+l+82.8%
sub-neg82.8%
sub-neg82.8%
+-commutative82.8%
+-commutative82.8%
+-commutative82.8%
Simplified82.8%
Taylor expanded in t around inf 40.7%
Taylor expanded in x around 0 25.9%
associate--l+25.9%
Simplified25.9%
Taylor expanded in z around inf 16.0%
Taylor expanded in y around inf 15.5%
associate--l+15.5%
Simplified15.5%
Final simplification17.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 (* 0.5 (sqrt (/ 1.0 t)))))
(if (<= y 1.0)
(+ t_1 (+ 2.0 (- (* 0.5 (+ x y)) (+ (sqrt x) (sqrt y)))))
(+ t_1 (- (+ 1.0 (* 0.5 (+ x (sqrt (/ 1.0 y))))) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 0.5 * sqrt((1.0 / t));
double tmp;
if (y <= 1.0) {
tmp = t_1 + (2.0 + ((0.5 * (x + y)) - (sqrt(x) + sqrt(y))));
} else {
tmp = t_1 + ((1.0 + (0.5 * (x + sqrt((1.0 / y))))) - 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 = 0.5d0 * sqrt((1.0d0 / t))
if (y <= 1.0d0) then
tmp = t_1 + (2.0d0 + ((0.5d0 * (x + y)) - (sqrt(x) + sqrt(y))))
else
tmp = t_1 + ((1.0d0 + (0.5d0 * (x + sqrt((1.0d0 / y))))) - 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 = 0.5 * Math.sqrt((1.0 / t));
double tmp;
if (y <= 1.0) {
tmp = t_1 + (2.0 + ((0.5 * (x + y)) - (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = t_1 + ((1.0 + (0.5 * (x + Math.sqrt((1.0 / y))))) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 0.5 * math.sqrt((1.0 / t)) tmp = 0 if y <= 1.0: tmp = t_1 + (2.0 + ((0.5 * (x + y)) - (math.sqrt(x) + math.sqrt(y)))) else: tmp = t_1 + ((1.0 + (0.5 * (x + math.sqrt((1.0 / y))))) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(0.5 * sqrt(Float64(1.0 / t))) tmp = 0.0 if (y <= 1.0) tmp = Float64(t_1 + Float64(2.0 + Float64(Float64(0.5 * Float64(x + y)) - Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(t_1 + Float64(Float64(1.0 + Float64(0.5 * Float64(x + sqrt(Float64(1.0 / y))))) - 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 = 0.5 * sqrt((1.0 / t));
tmp = 0.0;
if (y <= 1.0)
tmp = t_1 + (2.0 + ((0.5 * (x + y)) - (sqrt(x) + sqrt(y))));
else
tmp = t_1 + ((1.0 + (0.5 * (x + sqrt((1.0 / y))))) - 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[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.0], N[(t$95$1 + N[(2.0 + N[(N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(1.0 + N[(0.5 * N[(x + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 0.5 \cdot \sqrt{\frac{1}{t}}\\
\mathbf{if}\;y \leq 1:\\
\;\;\;\;t\_1 + \left(2 + \left(0.5 \cdot \left(x + y\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\left(1 + 0.5 \cdot \left(x + \sqrt{\frac{1}{y}}\right)\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 1Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in t around inf 51.4%
Taylor expanded in x around 0 26.7%
associate--l+26.7%
Simplified26.7%
Taylor expanded in z around inf 20.5%
Taylor expanded in y around 0 20.5%
associate--l+20.5%
distribute-lft-out20.5%
+-commutative20.5%
Simplified20.5%
if 1 < y Initial program 82.8%
associate-+l+82.8%
sub-neg82.8%
sub-neg82.8%
+-commutative82.8%
+-commutative82.8%
+-commutative82.8%
Simplified82.8%
Taylor expanded in t around inf 40.7%
Taylor expanded in x around 0 25.9%
associate--l+25.9%
Simplified25.9%
Taylor expanded in z around inf 16.0%
Taylor expanded in y around inf 15.6%
distribute-lft-out15.6%
Simplified15.6%
Final simplification18.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 0.5 (sqrt (/ 1.0 t)))))
(if (<= y 1.0)
(+ t_1 (- (+ (* x 0.5) 2.0) (+ (sqrt x) (sqrt y))))
(+ (+ 1.0 (- (* x 0.5) (sqrt x))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 0.5 * sqrt((1.0 / t));
double tmp;
if (y <= 1.0) {
tmp = t_1 + (((x * 0.5) + 2.0) - (sqrt(x) + sqrt(y)));
} else {
tmp = (1.0 + ((x * 0.5) - sqrt(x))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 * sqrt((1.0d0 / t))
if (y <= 1.0d0) then
tmp = t_1 + (((x * 0.5d0) + 2.0d0) - (sqrt(x) + sqrt(y)))
else
tmp = (1.0d0 + ((x * 0.5d0) - sqrt(x))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 0.5 * Math.sqrt((1.0 / t));
double tmp;
if (y <= 1.0) {
tmp = t_1 + (((x * 0.5) + 2.0) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (1.0 + ((x * 0.5) - Math.sqrt(x))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 0.5 * math.sqrt((1.0 / t)) tmp = 0 if y <= 1.0: tmp = t_1 + (((x * 0.5) + 2.0) - (math.sqrt(x) + math.sqrt(y))) else: tmp = (1.0 + ((x * 0.5) - math.sqrt(x))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(0.5 * sqrt(Float64(1.0 / t))) tmp = 0.0 if (y <= 1.0) tmp = Float64(t_1 + Float64(Float64(Float64(x * 0.5) + 2.0) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 0.5 * sqrt((1.0 / t));
tmp = 0.0;
if (y <= 1.0)
tmp = t_1 + (((x * 0.5) + 2.0) - (sqrt(x) + sqrt(y)));
else
tmp = (1.0 + ((x * 0.5) - sqrt(x))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.0], N[(t$95$1 + N[(N[(N[(x * 0.5), $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $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 := 0.5 \cdot \sqrt{\frac{1}{t}}\\
\mathbf{if}\;y \leq 1:\\
\;\;\;\;t\_1 + \left(\left(x \cdot 0.5 + 2\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right) + t\_1\\
\end{array}
\end{array}
if y < 1Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in t around inf 51.4%
Taylor expanded in x around 0 26.7%
associate--l+26.7%
Simplified26.7%
Taylor expanded in z around inf 20.5%
Taylor expanded in y around 0 20.5%
if 1 < y Initial program 82.8%
associate-+l+82.8%
sub-neg82.8%
sub-neg82.8%
+-commutative82.8%
+-commutative82.8%
+-commutative82.8%
Simplified82.8%
Taylor expanded in t around inf 40.7%
Taylor expanded in x around 0 25.9%
associate--l+25.9%
Simplified25.9%
Taylor expanded in z around inf 16.0%
Taylor expanded in y around inf 15.5%
associate--l+15.5%
Simplified15.5%
Final simplification17.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (- (sqrt (+ z 1.0)) (sqrt z)) (- 1.0 (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (sqrt((z + 1.0)) - sqrt(z)) + (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((z + 1.0d0)) - sqrt(z)) + (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((z + 1.0)) - Math.sqrt(z)) + (1.0 - Math.sqrt(x));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (math.sqrt((z + 1.0)) - math.sqrt(z)) + (1.0 - math.sqrt(x))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + Float64(1.0 - sqrt(x))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + (1.0 - sqrt(x));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(1 - \sqrt{x}\right)
\end{array}
Initial program 89.9%
associate-+l+89.9%
sub-neg89.9%
sub-neg89.9%
+-commutative89.9%
+-commutative89.9%
+-commutative89.9%
Simplified89.9%
Taylor expanded in x around 0 45.5%
Taylor expanded in t around inf 26.4%
Taylor expanded in y around inf 17.5%
Final simplification17.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (+ 1.0 (- (* x 0.5) (sqrt x))) (* 0.5 (sqrt (/ 1.0 t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 + ((x * 0.5) - sqrt(x))) + (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 = (1.0d0 + ((x * 0.5d0) - sqrt(x))) + (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 (1.0 + ((x * 0.5) - Math.sqrt(x))) + (0.5 * Math.sqrt((1.0 / t)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 + ((x * 0.5) - math.sqrt(x))) + (0.5 * math.sqrt((1.0 / t)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))) + 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 = (1.0 + ((x * 0.5) - sqrt(x))) + (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[(N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right) + 0.5 \cdot \sqrt{\frac{1}{t}}
\end{array}
Initial program 89.9%
associate-+l+89.9%
sub-neg89.9%
sub-neg89.9%
+-commutative89.9%
+-commutative89.9%
+-commutative89.9%
Simplified89.9%
Taylor expanded in t around inf 46.0%
Taylor expanded in x around 0 26.3%
associate--l+26.3%
Simplified26.3%
Taylor expanded in z around inf 18.2%
Taylor expanded in y around inf 12.2%
associate--l+12.2%
Simplified12.2%
Final simplification12.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 0.0048) (- 1.0 (+ (sqrt z) (sqrt x))) (- (* 0.5 (sqrt (/ 1.0 z))) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.0048) {
tmp = 1.0 - (sqrt(z) + sqrt(x));
} else {
tmp = (0.5 * sqrt((1.0 / z))) - 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.0048d0) then
tmp = 1.0d0 - (sqrt(z) + sqrt(x))
else
tmp = (0.5d0 * sqrt((1.0d0 / z))) - 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.0048) {
tmp = 1.0 - (Math.sqrt(z) + Math.sqrt(x));
} else {
tmp = (0.5 * Math.sqrt((1.0 / z))) - 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.0048: tmp = 1.0 - (math.sqrt(z) + math.sqrt(x)) else: tmp = (0.5 * math.sqrt((1.0 / z))) - 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.0048) tmp = Float64(1.0 - Float64(sqrt(z) + sqrt(x))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) - 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.0048)
tmp = 1.0 - (sqrt(z) + sqrt(x));
else
tmp = (0.5 * sqrt((1.0 / z))) - 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.0048], N[(1.0 - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $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.0048:\\
\;\;\;\;1 - \left(\sqrt{z} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} - \sqrt{x}\\
\end{array}
\end{array}
if z < 0.00479999999999999958Initial program 97.5%
associate-+l+97.5%
sub-neg97.5%
sub-neg97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 41.0%
Taylor expanded in t around inf 24.3%
Taylor expanded in x around inf 8.3%
mul-1-neg8.3%
Simplified8.3%
Taylor expanded in z around 0 8.3%
if 0.00479999999999999958 < z Initial program 83.2%
associate-+l+83.2%
sub-neg83.2%
sub-neg83.2%
+-commutative83.2%
+-commutative83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in x around 0 49.4%
Taylor expanded in t around inf 28.2%
Taylor expanded in x around inf 1.9%
mul-1-neg1.9%
Simplified1.9%
Taylor expanded in z around inf 3.1%
Final simplification5.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (+ 1.0 (* z 0.5)) (+ (sqrt z) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 + (z * 0.5)) - (sqrt(z) + sqrt(x));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 + (z * 0.5d0)) - (sqrt(z) + sqrt(x))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 + (z * 0.5)) - (Math.sqrt(z) + Math.sqrt(x));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 + (z * 0.5)) - (math.sqrt(z) + math.sqrt(x))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 + Float64(z * 0.5)) - Float64(sqrt(z) + sqrt(x))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 + (z * 0.5)) - (sqrt(z) + 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[(1.0 + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(1 + z \cdot 0.5\right) - \left(\sqrt{z} + \sqrt{x}\right)
\end{array}
Initial program 89.9%
associate-+l+89.9%
sub-neg89.9%
sub-neg89.9%
+-commutative89.9%
+-commutative89.9%
+-commutative89.9%
Simplified89.9%
Taylor expanded in x around 0 45.5%
Taylor expanded in t around inf 26.4%
Taylor expanded in x around inf 4.9%
mul-1-neg4.9%
Simplified4.9%
Taylor expanded in z around 0 6.3%
Final simplification6.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- 1.0 (+ (sqrt z) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 - (sqrt(z) + sqrt(x));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (sqrt(z) + sqrt(x))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 - (Math.sqrt(z) + Math.sqrt(x));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 - (math.sqrt(z) + math.sqrt(x))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 - Float64(sqrt(z) + sqrt(x))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 - (sqrt(z) + sqrt(x));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 - \left(\sqrt{z} + \sqrt{x}\right)
\end{array}
Initial program 89.9%
associate-+l+89.9%
sub-neg89.9%
sub-neg89.9%
+-commutative89.9%
+-commutative89.9%
+-commutative89.9%
Simplified89.9%
Taylor expanded in x around 0 45.5%
Taylor expanded in t around inf 26.4%
Taylor expanded in x around inf 4.9%
mul-1-neg4.9%
Simplified4.9%
Taylor expanded in z around 0 4.7%
Final simplification4.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return -sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return -Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return -math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(-sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = -sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := (-N[Sqrt[x], $MachinePrecision])
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
-\sqrt{x}
\end{array}
Initial program 89.9%
associate-+l+89.9%
sub-neg89.9%
sub-neg89.9%
+-commutative89.9%
+-commutative89.9%
+-commutative89.9%
Simplified89.9%
Taylor expanded in x around 0 45.5%
Taylor expanded in t around inf 26.4%
Taylor expanded in x around inf 4.9%
mul-1-neg4.9%
Simplified4.9%
Taylor expanded in x around inf 1.6%
neg-mul-11.6%
Simplified1.6%
Final simplification1.6%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024053
(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))))