
(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 29 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
(if (<= (- (sqrt (+ x 1.0)) (sqrt x)) 0.0)
(+
(/ (+ (* (sqrt x) 0.5) (* -0.125 (sqrt (/ 1.0 x)))) x)
(* 0.5 (+ (sqrt (/ 1.0 y)) (sqrt (/ 1.0 z)))))
(+
(+
1.0
(-
(+
(+
(/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y))))
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))))
(* x (+ 0.5 (* x (+ -0.125 (* x 0.0625))))))
(sqrt x)))
(/ (- (+ 1.0 t) t) (+ (pow (+ 1.0 t) 0.5) (sqrt t))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((sqrt((x + 1.0)) - sqrt(x)) <= 0.0) {
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + sqrt((1.0 / z))));
} else {
tmp = (1.0 + ((((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 / (sqrt(z) + sqrt((1.0 + z))))) + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x))) + (((1.0 + t) - t) / (pow((1.0 + t), 0.5) + sqrt(t)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((sqrt((x + 1.0d0)) - sqrt(x)) <= 0.0d0) then
tmp = (((sqrt(x) * 0.5d0) + ((-0.125d0) * sqrt((1.0d0 / x)))) / x) + (0.5d0 * (sqrt((1.0d0 / y)) + sqrt((1.0d0 / z))))
else
tmp = (1.0d0 + ((((1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))) + (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z))))) + (x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0)))))) - sqrt(x))) + (((1.0d0 + t) - t) / (((1.0d0 + t) ** 0.5d0) + sqrt(t)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) <= 0.0) {
tmp = (((Math.sqrt(x) * 0.5) + (-0.125 * Math.sqrt((1.0 / x)))) / x) + (0.5 * (Math.sqrt((1.0 / y)) + Math.sqrt((1.0 / z))));
} else {
tmp = (1.0 + ((((1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))) + (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z))))) + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - Math.sqrt(x))) + (((1.0 + t) - t) / (Math.pow((1.0 + t), 0.5) + Math.sqrt(t)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (math.sqrt((x + 1.0)) - math.sqrt(x)) <= 0.0: tmp = (((math.sqrt(x) * 0.5) + (-0.125 * math.sqrt((1.0 / x)))) / x) + (0.5 * (math.sqrt((1.0 / y)) + math.sqrt((1.0 / z)))) else: tmp = (1.0 + ((((1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) + (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))))) + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - math.sqrt(x))) + (((1.0 + t) - t) / (math.pow((1.0 + t), 0.5) + math.sqrt(t))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) <= 0.0) tmp = Float64(Float64(Float64(Float64(sqrt(x) * 0.5) + Float64(-0.125 * sqrt(Float64(1.0 / x)))) / x) + Float64(0.5 * Float64(sqrt(Float64(1.0 / y)) + sqrt(Float64(1.0 / z))))); else tmp = Float64(Float64(1.0 + Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z))))) + Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625)))))) - sqrt(x))) + Float64(Float64(Float64(1.0 + t) - t) / Float64((Float64(1.0 + t) ^ 0.5) + sqrt(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 ((sqrt((x + 1.0)) - sqrt(x)) <= 0.0)
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + sqrt((1.0 / z))));
else
tmp = (1.0 + ((((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 / (sqrt(z) + sqrt((1.0 + z))))) + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x))) + (((1.0 + t) - t) / (((1.0 + t) ^ 0.5) + sqrt(t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(N[(N[(N[Sqrt[x], $MachinePrecision] * 0.5), $MachinePrecision] + N[(-0.125 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.5 * N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(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[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + t), $MachinePrecision] - t), $MachinePrecision] / N[(N[Power[N[(1.0 + t), $MachinePrecision], 0.5], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;\sqrt{x + 1} - \sqrt{x} \leq 0:\\
\;\;\;\;\frac{\sqrt{x} \cdot 0.5 + -0.125 \cdot \sqrt{\frac{1}{x}}}{x} + 0.5 \cdot \left(\sqrt{\frac{1}{y}} + \sqrt{\frac{1}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(\left(\left(\frac{1}{\sqrt{y} + \sqrt{1 + y}} + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\right) + x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\right) - \sqrt{x}\right)\right) + \frac{\left(1 + t\right) - t}{{\left(1 + t\right)}^{0.5} + \sqrt{t}}\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.0Initial program 87.0%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified67.9%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6444.2%
Simplified44.2%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6423.4%
Simplified23.4%
Taylor expanded in z around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6412.4%
Simplified12.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6414.0%
Simplified14.0%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.2%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f6497.8%
Applied egg-rr97.8%
+-commutativeN/A
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f6498.1%
Applied egg-rr98.1%
Taylor expanded in x around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified96.7%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6497.0%
Applied egg-rr97.0%
Final simplification60.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z)))
(t_2 (sqrt (+ x 1.0)))
(t_3 (sqrt (+ 1.0 y)))
(t_4 (+ (+ (- t_2 (sqrt x)) (- t_3 (sqrt y))) (- t_1 (sqrt z)))))
(if (<= t_4 0.0)
(+
(/ (+ (* (sqrt x) 0.5) (* -0.125 (sqrt (/ 1.0 x)))) x)
(* 0.5 (+ (sqrt (/ 1.0 y)) (sqrt (/ 1.0 z)))))
(if (<= t_4 2.99999999999998)
(+
1.0
(-
(+
(+
(+ (/ 1.0 (+ (sqrt y) t_3)) (/ 1.0 (+ (sqrt z) t_1)))
(* x (+ 0.5 (* x (+ -0.125 (* x 0.0625))))))
(* 0.5 (sqrt (/ 1.0 t))))
(sqrt x)))
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(+
(+ (+ t_3 t_2) (* z (+ 0.5 (* z (+ -0.125 (* z 0.0625))))))
(- 1.0 (+ (sqrt y) (+ (sqrt x) (sqrt z))))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((x + 1.0));
double t_3 = sqrt((1.0 + y));
double t_4 = ((t_2 - sqrt(x)) + (t_3 - sqrt(y))) + (t_1 - sqrt(z));
double tmp;
if (t_4 <= 0.0) {
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + sqrt((1.0 / z))));
} else if (t_4 <= 2.99999999999998) {
tmp = 1.0 + (((((1.0 / (sqrt(y) + t_3)) + (1.0 / (sqrt(z) + t_1))) + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + (0.5 * sqrt((1.0 / t)))) - sqrt(x));
} else {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (((t_3 + t_2) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - (sqrt(y) + (sqrt(x) + sqrt(z)))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((x + 1.0d0))
t_3 = sqrt((1.0d0 + y))
t_4 = ((t_2 - sqrt(x)) + (t_3 - sqrt(y))) + (t_1 - sqrt(z))
if (t_4 <= 0.0d0) then
tmp = (((sqrt(x) * 0.5d0) + ((-0.125d0) * sqrt((1.0d0 / x)))) / x) + (0.5d0 * (sqrt((1.0d0 / y)) + sqrt((1.0d0 / z))))
else if (t_4 <= 2.99999999999998d0) then
tmp = 1.0d0 + (((((1.0d0 / (sqrt(y) + t_3)) + (1.0d0 / (sqrt(z) + t_1))) + (x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0)))))) + (0.5d0 * sqrt((1.0d0 / t)))) - sqrt(x))
else
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + (((t_3 + t_2) + (z * (0.5d0 + (z * ((-0.125d0) + (z * 0.0625d0)))))) + (1.0d0 - (sqrt(y) + (sqrt(x) + sqrt(z)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((x + 1.0));
double t_3 = Math.sqrt((1.0 + y));
double t_4 = ((t_2 - Math.sqrt(x)) + (t_3 - Math.sqrt(y))) + (t_1 - Math.sqrt(z));
double tmp;
if (t_4 <= 0.0) {
tmp = (((Math.sqrt(x) * 0.5) + (-0.125 * Math.sqrt((1.0 / x)))) / x) + (0.5 * (Math.sqrt((1.0 / y)) + Math.sqrt((1.0 / z))));
} else if (t_4 <= 2.99999999999998) {
tmp = 1.0 + (((((1.0 / (Math.sqrt(y) + t_3)) + (1.0 / (Math.sqrt(z) + t_1))) + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + (0.5 * Math.sqrt((1.0 / t)))) - Math.sqrt(x));
} else {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (((t_3 + t_2) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - (Math.sqrt(y) + (Math.sqrt(x) + Math.sqrt(z)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((x + 1.0)) t_3 = math.sqrt((1.0 + y)) t_4 = ((t_2 - math.sqrt(x)) + (t_3 - math.sqrt(y))) + (t_1 - math.sqrt(z)) tmp = 0 if t_4 <= 0.0: tmp = (((math.sqrt(x) * 0.5) + (-0.125 * math.sqrt((1.0 / x)))) / x) + (0.5 * (math.sqrt((1.0 / y)) + math.sqrt((1.0 / z)))) elif t_4 <= 2.99999999999998: tmp = 1.0 + (((((1.0 / (math.sqrt(y) + t_3)) + (1.0 / (math.sqrt(z) + t_1))) + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + (0.5 * math.sqrt((1.0 / t)))) - math.sqrt(x)) else: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + (((t_3 + t_2) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - (math.sqrt(y) + (math.sqrt(x) + math.sqrt(z))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(x + 1.0)) t_3 = sqrt(Float64(1.0 + y)) t_4 = Float64(Float64(Float64(t_2 - sqrt(x)) + Float64(t_3 - sqrt(y))) + Float64(t_1 - sqrt(z))) tmp = 0.0 if (t_4 <= 0.0) tmp = Float64(Float64(Float64(Float64(sqrt(x) * 0.5) + Float64(-0.125 * sqrt(Float64(1.0 / x)))) / x) + Float64(0.5 * Float64(sqrt(Float64(1.0 / y)) + sqrt(Float64(1.0 / z))))); elseif (t_4 <= 2.99999999999998) tmp = Float64(1.0 + Float64(Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(y) + t_3)) + Float64(1.0 / Float64(sqrt(z) + t_1))) + Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625)))))) + Float64(0.5 * sqrt(Float64(1.0 / t)))) - sqrt(x))); else tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(Float64(t_3 + t_2) + Float64(z * Float64(0.5 + Float64(z * Float64(-0.125 + Float64(z * 0.0625)))))) + Float64(1.0 - Float64(sqrt(y) + Float64(sqrt(x) + sqrt(z)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((x + 1.0));
t_3 = sqrt((1.0 + y));
t_4 = ((t_2 - sqrt(x)) + (t_3 - sqrt(y))) + (t_1 - sqrt(z));
tmp = 0.0;
if (t_4 <= 0.0)
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + sqrt((1.0 / z))));
elseif (t_4 <= 2.99999999999998)
tmp = 1.0 + (((((1.0 / (sqrt(y) + t_3)) + (1.0 / (sqrt(z) + t_1))) + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + (0.5 * sqrt((1.0 / t)))) - sqrt(x));
else
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (((t_3 + t_2) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - (sqrt(y) + (sqrt(x) + sqrt(z)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[(N[(N[(N[(N[Sqrt[x], $MachinePrecision] * 0.5), $MachinePrecision] + N[(-0.125 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.5 * N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 2.99999999999998], N[(1.0 + N[(N[(N[(N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t$95$3 + t$95$2), $MachinePrecision] + N[(z * N[(0.5 + N[(z * N[(-0.125 + N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $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 + z}\\
t_2 := \sqrt{x + 1}\\
t_3 := \sqrt{1 + y}\\
t_4 := \left(\left(t\_2 - \sqrt{x}\right) + \left(t\_3 - \sqrt{y}\right)\right) + \left(t\_1 - \sqrt{z}\right)\\
\mathbf{if}\;t\_4 \leq 0:\\
\;\;\;\;\frac{\sqrt{x} \cdot 0.5 + -0.125 \cdot \sqrt{\frac{1}{x}}}{x} + 0.5 \cdot \left(\sqrt{\frac{1}{y}} + \sqrt{\frac{1}{z}}\right)\\
\mathbf{elif}\;t\_4 \leq 2.99999999999998:\\
\;\;\;\;1 + \left(\left(\left(\left(\frac{1}{\sqrt{y} + t\_3} + \frac{1}{\sqrt{z} + t\_1}\right) + x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\left(\left(t\_3 + t\_2\right) + z \cdot \left(0.5 + z \cdot \left(-0.125 + z \cdot 0.0625\right)\right)\right) + \left(1 - \left(\sqrt{y} + \left(\sqrt{x} + \sqrt{z}\right)\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 0.0Initial program 48.3%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified7.7%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f643.3%
Simplified3.3%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6420.0%
Simplified20.0%
Taylor expanded in z around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6438.3%
Simplified38.3%
Taylor expanded in x around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6447.1%
Simplified47.1%
if 0.0 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 2.99999999999998002Initial program 96.4%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f6496.8%
Applied egg-rr96.8%
+-commutativeN/A
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f6497.2%
Applied egg-rr97.2%
Taylor expanded in x around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified54.6%
Taylor expanded in t around inf
Simplified31.5%
if 2.99999999999998002 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) Initial program 98.3%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
Simplified98.3%
Final simplification40.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z)))
(t_2 (sqrt (+ x 1.0)))
(t_3 (sqrt (+ 1.0 y)))
(t_4 (+ (+ (- t_2 (sqrt x)) (- t_3 (sqrt y))) (- t_1 (sqrt z)))))
(if (<= t_4 0.0)
(+
(/ (+ (* (sqrt x) 0.5) (* -0.125 (sqrt (/ 1.0 x)))) x)
(* 0.5 (+ (sqrt (/ 1.0 y)) (sqrt (/ 1.0 z)))))
(if (<= t_4 2.99999999999998)
(+
1.0
(-
(+
(+
(+ (/ 1.0 (+ (sqrt y) t_3)) (/ 1.0 (+ (sqrt z) t_1)))
(* x (+ 0.5 (* x (+ -0.125 (* x 0.0625))))))
(* 0.5 (sqrt (/ 1.0 t))))
(sqrt x)))
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(+ 1.0 (- (+ t_1 t_2) (+ (sqrt y) (+ (sqrt x) (sqrt z))))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((x + 1.0));
double t_3 = sqrt((1.0 + y));
double t_4 = ((t_2 - sqrt(x)) + (t_3 - sqrt(y))) + (t_1 - sqrt(z));
double tmp;
if (t_4 <= 0.0) {
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + sqrt((1.0 / z))));
} else if (t_4 <= 2.99999999999998) {
tmp = 1.0 + (((((1.0 / (sqrt(y) + t_3)) + (1.0 / (sqrt(z) + t_1))) + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + (0.5 * sqrt((1.0 / t)))) - sqrt(x));
} else {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (1.0 + ((t_1 + t_2) - (sqrt(y) + (sqrt(x) + sqrt(z)))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((x + 1.0d0))
t_3 = sqrt((1.0d0 + y))
t_4 = ((t_2 - sqrt(x)) + (t_3 - sqrt(y))) + (t_1 - sqrt(z))
if (t_4 <= 0.0d0) then
tmp = (((sqrt(x) * 0.5d0) + ((-0.125d0) * sqrt((1.0d0 / x)))) / x) + (0.5d0 * (sqrt((1.0d0 / y)) + sqrt((1.0d0 / z))))
else if (t_4 <= 2.99999999999998d0) then
tmp = 1.0d0 + (((((1.0d0 / (sqrt(y) + t_3)) + (1.0d0 / (sqrt(z) + t_1))) + (x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0)))))) + (0.5d0 * sqrt((1.0d0 / t)))) - sqrt(x))
else
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 + ((t_1 + t_2) - (sqrt(y) + (sqrt(x) + sqrt(z)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((x + 1.0));
double t_3 = Math.sqrt((1.0 + y));
double t_4 = ((t_2 - Math.sqrt(x)) + (t_3 - Math.sqrt(y))) + (t_1 - Math.sqrt(z));
double tmp;
if (t_4 <= 0.0) {
tmp = (((Math.sqrt(x) * 0.5) + (-0.125 * Math.sqrt((1.0 / x)))) / x) + (0.5 * (Math.sqrt((1.0 / y)) + Math.sqrt((1.0 / z))));
} else if (t_4 <= 2.99999999999998) {
tmp = 1.0 + (((((1.0 / (Math.sqrt(y) + t_3)) + (1.0 / (Math.sqrt(z) + t_1))) + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + (0.5 * Math.sqrt((1.0 / t)))) - Math.sqrt(x));
} else {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 + ((t_1 + t_2) - (Math.sqrt(y) + (Math.sqrt(x) + Math.sqrt(z)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((x + 1.0)) t_3 = math.sqrt((1.0 + y)) t_4 = ((t_2 - math.sqrt(x)) + (t_3 - math.sqrt(y))) + (t_1 - math.sqrt(z)) tmp = 0 if t_4 <= 0.0: tmp = (((math.sqrt(x) * 0.5) + (-0.125 * math.sqrt((1.0 / x)))) / x) + (0.5 * (math.sqrt((1.0 / y)) + math.sqrt((1.0 / z)))) elif t_4 <= 2.99999999999998: tmp = 1.0 + (((((1.0 / (math.sqrt(y) + t_3)) + (1.0 / (math.sqrt(z) + t_1))) + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + (0.5 * math.sqrt((1.0 / t)))) - math.sqrt(x)) else: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 + ((t_1 + t_2) - (math.sqrt(y) + (math.sqrt(x) + math.sqrt(z))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(x + 1.0)) t_3 = sqrt(Float64(1.0 + y)) t_4 = Float64(Float64(Float64(t_2 - sqrt(x)) + Float64(t_3 - sqrt(y))) + Float64(t_1 - sqrt(z))) tmp = 0.0 if (t_4 <= 0.0) tmp = Float64(Float64(Float64(Float64(sqrt(x) * 0.5) + Float64(-0.125 * sqrt(Float64(1.0 / x)))) / x) + Float64(0.5 * Float64(sqrt(Float64(1.0 / y)) + sqrt(Float64(1.0 / z))))); elseif (t_4 <= 2.99999999999998) tmp = Float64(1.0 + Float64(Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(y) + t_3)) + Float64(1.0 / Float64(sqrt(z) + t_1))) + Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625)))))) + Float64(0.5 * sqrt(Float64(1.0 / t)))) - sqrt(x))); else tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 + Float64(Float64(t_1 + t_2) - Float64(sqrt(y) + Float64(sqrt(x) + sqrt(z)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((x + 1.0));
t_3 = sqrt((1.0 + y));
t_4 = ((t_2 - sqrt(x)) + (t_3 - sqrt(y))) + (t_1 - sqrt(z));
tmp = 0.0;
if (t_4 <= 0.0)
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + sqrt((1.0 / z))));
elseif (t_4 <= 2.99999999999998)
tmp = 1.0 + (((((1.0 / (sqrt(y) + t_3)) + (1.0 / (sqrt(z) + t_1))) + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + (0.5 * sqrt((1.0 / t)))) - sqrt(x));
else
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (1.0 + ((t_1 + t_2) - (sqrt(y) + (sqrt(x) + sqrt(z)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[(N[(N[(N[(N[Sqrt[x], $MachinePrecision] * 0.5), $MachinePrecision] + N[(-0.125 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.5 * N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 2.99999999999998], N[(1.0 + N[(N[(N[(N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(t$95$1 + t$95$2), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $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 + z}\\
t_2 := \sqrt{x + 1}\\
t_3 := \sqrt{1 + y}\\
t_4 := \left(\left(t\_2 - \sqrt{x}\right) + \left(t\_3 - \sqrt{y}\right)\right) + \left(t\_1 - \sqrt{z}\right)\\
\mathbf{if}\;t\_4 \leq 0:\\
\;\;\;\;\frac{\sqrt{x} \cdot 0.5 + -0.125 \cdot \sqrt{\frac{1}{x}}}{x} + 0.5 \cdot \left(\sqrt{\frac{1}{y}} + \sqrt{\frac{1}{z}}\right)\\
\mathbf{elif}\;t\_4 \leq 2.99999999999998:\\
\;\;\;\;1 + \left(\left(\left(\left(\frac{1}{\sqrt{y} + t\_3} + \frac{1}{\sqrt{z} + t\_1}\right) + x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(1 + \left(\left(t\_1 + t\_2\right) - \left(\sqrt{y} + \left(\sqrt{x} + \sqrt{z}\right)\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 0.0Initial program 48.3%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified7.7%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f643.3%
Simplified3.3%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6420.0%
Simplified20.0%
Taylor expanded in z around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6438.3%
Simplified38.3%
Taylor expanded in x around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6447.1%
Simplified47.1%
if 0.0 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 2.99999999999998002Initial program 96.4%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f6496.8%
Applied egg-rr96.8%
+-commutativeN/A
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f6497.2%
Applied egg-rr97.2%
Taylor expanded in x around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified54.6%
Taylor expanded in t around inf
Simplified31.5%
if 2.99999999999998002 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) Initial program 98.3%
Taylor expanded in y around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6498.3%
Simplified98.3%
Final simplification40.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= (- (sqrt (+ x 1.0)) (sqrt x)) 0.0)
(+
(/ (+ (* (sqrt x) 0.5) (* -0.125 (sqrt (/ 1.0 x)))) x)
(* 0.5 (+ (sqrt (/ 1.0 y)) (sqrt (/ 1.0 z)))))
(+
(+
1.0
(-
(+
(+
(/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y))))
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))))
(* x (+ 0.5 (* x (+ -0.125 (* x 0.0625))))))
(sqrt x)))
(- (sqrt (+ 1.0 t)) (sqrt t)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((sqrt((x + 1.0)) - sqrt(x)) <= 0.0) {
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + sqrt((1.0 / z))));
} else {
tmp = (1.0 + ((((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 / (sqrt(z) + sqrt((1.0 + z))))) + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x))) + (sqrt((1.0 + t)) - sqrt(t));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((sqrt((x + 1.0d0)) - sqrt(x)) <= 0.0d0) then
tmp = (((sqrt(x) * 0.5d0) + ((-0.125d0) * sqrt((1.0d0 / x)))) / x) + (0.5d0 * (sqrt((1.0d0 / y)) + sqrt((1.0d0 / z))))
else
tmp = (1.0d0 + ((((1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))) + (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z))))) + (x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0)))))) - sqrt(x))) + (sqrt((1.0d0 + t)) - sqrt(t))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) <= 0.0) {
tmp = (((Math.sqrt(x) * 0.5) + (-0.125 * Math.sqrt((1.0 / x)))) / x) + (0.5 * (Math.sqrt((1.0 / y)) + Math.sqrt((1.0 / z))));
} else {
tmp = (1.0 + ((((1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))) + (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z))))) + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - Math.sqrt(x))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (math.sqrt((x + 1.0)) - math.sqrt(x)) <= 0.0: tmp = (((math.sqrt(x) * 0.5) + (-0.125 * math.sqrt((1.0 / x)))) / x) + (0.5 * (math.sqrt((1.0 / y)) + math.sqrt((1.0 / z)))) else: tmp = (1.0 + ((((1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) + (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))))) + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - math.sqrt(x))) + (math.sqrt((1.0 + t)) - math.sqrt(t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) <= 0.0) tmp = Float64(Float64(Float64(Float64(sqrt(x) * 0.5) + Float64(-0.125 * sqrt(Float64(1.0 / x)))) / x) + Float64(0.5 * Float64(sqrt(Float64(1.0 / y)) + sqrt(Float64(1.0 / z))))); else tmp = Float64(Float64(1.0 + Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z))))) + Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625)))))) - sqrt(x))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(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 ((sqrt((x + 1.0)) - sqrt(x)) <= 0.0)
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + sqrt((1.0 / z))));
else
tmp = (1.0 + ((((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 / (sqrt(z) + sqrt((1.0 + z))))) + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x))) + (sqrt((1.0 + t)) - sqrt(t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(N[(N[(N[Sqrt[x], $MachinePrecision] * 0.5), $MachinePrecision] + N[(-0.125 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.5 * N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(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[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;\sqrt{x + 1} - \sqrt{x} \leq 0:\\
\;\;\;\;\frac{\sqrt{x} \cdot 0.5 + -0.125 \cdot \sqrt{\frac{1}{x}}}{x} + 0.5 \cdot \left(\sqrt{\frac{1}{y}} + \sqrt{\frac{1}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(\left(\left(\frac{1}{\sqrt{y} + \sqrt{1 + y}} + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\right) + x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\right) - \sqrt{x}\right)\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.0Initial program 87.0%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified67.9%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6444.2%
Simplified44.2%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6423.4%
Simplified23.4%
Taylor expanded in z around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6412.4%
Simplified12.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6414.0%
Simplified14.0%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.2%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f6497.8%
Applied egg-rr97.8%
+-commutativeN/A
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f6498.1%
Applied egg-rr98.1%
Taylor expanded in x around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified96.7%
Final simplification59.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 t)) (sqrt t))) (t_2 (sqrt (+ 1.0 y))))
(if (<= t_1 0.0)
(+
1.0
(+
(* x (+ 0.5 (* x (+ -0.125 (* x 0.0625)))))
(+
(/ 1.0 (+ (sqrt y) t_2))
(- (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) (sqrt x)))))
(+
t_1
(+
(+ (+ t_2 (sqrt (+ x 1.0))) (* z (+ 0.5 (* z (+ -0.125 (* z 0.0625))))))
(- 1.0 (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t)) - sqrt(t);
double t_2 = sqrt((1.0 + y));
double tmp;
if (t_1 <= 0.0) {
tmp = 1.0 + ((x * (0.5 + (x * (-0.125 + (x * 0.0625))))) + ((1.0 / (sqrt(y) + t_2)) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) - sqrt(x))));
} else {
tmp = t_1 + (((t_2 + sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
t_2 = sqrt((1.0d0 + y))
if (t_1 <= 0.0d0) then
tmp = 1.0d0 + ((x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0))))) + ((1.0d0 / (sqrt(y) + t_2)) + ((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) - sqrt(x))))
else
tmp = t_1 + (((t_2 + sqrt((x + 1.0d0))) + (z * (0.5d0 + (z * ((-0.125d0) + (z * 0.0625d0)))))) + (1.0d0 - sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (t_1 <= 0.0) {
tmp = 1.0 + ((x * (0.5 + (x * (-0.125 + (x * 0.0625))))) + ((1.0 / (Math.sqrt(y) + t_2)) + ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) - Math.sqrt(x))));
} else {
tmp = t_1 + (((t_2 + Math.sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) - math.sqrt(t) t_2 = math.sqrt((1.0 + y)) tmp = 0 if t_1 <= 0.0: tmp = 1.0 + ((x * (0.5 + (x * (-0.125 + (x * 0.0625))))) + ((1.0 / (math.sqrt(y) + t_2)) + ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) - math.sqrt(x)))) else: tmp = t_1 + (((t_2 + math.sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(1.0 + Float64(Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625))))) + Float64(Float64(1.0 / Float64(sqrt(y) + t_2)) + Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) - sqrt(x))))); else tmp = Float64(t_1 + Float64(Float64(Float64(t_2 + sqrt(Float64(x + 1.0))) + Float64(z * Float64(0.5 + Float64(z * Float64(-0.125 + Float64(z * 0.0625)))))) + Float64(1.0 - sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) - sqrt(t);
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (t_1 <= 0.0)
tmp = 1.0 + ((x * (0.5 + (x * (-0.125 + (x * 0.0625))))) + ((1.0 / (sqrt(y) + t_2)) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) - sqrt(x))));
else
tmp = t_1 + (((t_2 + sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(1.0 + N[(N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(N[(t$95$2 + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(z * N[(0.5 + N[(z * N[(-0.125 + N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;1 + \left(x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right) + \left(\frac{1}{\sqrt{y} + t\_2} + \left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} - \sqrt{x}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\left(\left(t\_2 + \sqrt{x + 1}\right) + z \cdot \left(0.5 + z \cdot \left(-0.125 + z \cdot 0.0625\right)\right)\right) + \left(1 - \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t)) < 0.0Initial program 88.1%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f6488.4%
Applied egg-rr88.4%
+-commutativeN/A
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f6488.6%
Applied egg-rr88.6%
Taylor expanded in x around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified56.4%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
Simplified56.4%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t)) Initial program 96.8%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
Simplified27.4%
Taylor expanded in z around inf
sqrt-lowering-sqrt.f6418.6%
Simplified18.6%
Final simplification36.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 t)) (sqrt t))) (t_2 (sqrt (+ 1.0 y))))
(if (<= t_1 0.0)
(+
(- (+ 1.0 (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625)))))) (sqrt x))
(+ (/ 1.0 (+ (sqrt y) t_2)) (- (sqrt (+ 1.0 z)) (sqrt z))))
(+
t_1
(+
(+ (+ t_2 (sqrt (+ x 1.0))) (* z (+ 0.5 (* z (+ -0.125 (* z 0.0625))))))
(- 1.0 (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t)) - sqrt(t);
double t_2 = sqrt((1.0 + y));
double tmp;
if (t_1 <= 0.0) {
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x)) + ((1.0 / (sqrt(y) + t_2)) + (sqrt((1.0 + z)) - sqrt(z)));
} else {
tmp = t_1 + (((t_2 + sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
t_2 = sqrt((1.0d0 + y))
if (t_1 <= 0.0d0) then
tmp = ((1.0d0 + (x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0)))))) - sqrt(x)) + ((1.0d0 / (sqrt(y) + t_2)) + (sqrt((1.0d0 + z)) - sqrt(z)))
else
tmp = t_1 + (((t_2 + sqrt((x + 1.0d0))) + (z * (0.5d0 + (z * ((-0.125d0) + (z * 0.0625d0)))))) + (1.0d0 - sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (t_1 <= 0.0) {
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - Math.sqrt(x)) + ((1.0 / (Math.sqrt(y) + t_2)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z)));
} else {
tmp = t_1 + (((t_2 + Math.sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) - math.sqrt(t) t_2 = math.sqrt((1.0 + y)) tmp = 0 if t_1 <= 0.0: tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - math.sqrt(x)) + ((1.0 / (math.sqrt(y) + t_2)) + (math.sqrt((1.0 + z)) - math.sqrt(z))) else: tmp = t_1 + (((t_2 + math.sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625)))))) - sqrt(x)) + Float64(Float64(1.0 / Float64(sqrt(y) + t_2)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z)))); else tmp = Float64(t_1 + Float64(Float64(Float64(t_2 + sqrt(Float64(x + 1.0))) + Float64(z * Float64(0.5 + Float64(z * Float64(-0.125 + Float64(z * 0.0625)))))) + Float64(1.0 - sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) - sqrt(t);
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (t_1 <= 0.0)
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x)) + ((1.0 / (sqrt(y) + t_2)) + (sqrt((1.0 + z)) - sqrt(z)));
else
tmp = t_1 + (((t_2 + sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(N[(t$95$2 + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(z * N[(0.5 + N[(z * N[(-0.125 + N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\left(\left(1 + x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\right) - \sqrt{x}\right) + \left(\frac{1}{\sqrt{y} + t\_2} + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\left(\left(t\_2 + \sqrt{x + 1}\right) + z \cdot \left(0.5 + z \cdot \left(-0.125 + z \cdot 0.0625\right)\right)\right) + \left(1 - \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t)) < 0.0Initial program 88.1%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified69.4%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6488.1%
Simplified88.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6455.7%
Simplified55.7%
flip--N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
associate--l+N/A
+-inversesN/A
metadata-evalN/A
+-commutativeN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f6456.0%
Applied egg-rr56.0%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t)) Initial program 96.8%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
Simplified27.4%
Taylor expanded in z around inf
sqrt-lowering-sqrt.f6418.6%
Simplified18.6%
Final simplification36.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))) (t_2 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= t_2 0.0)
(+
(- (+ 1.0 (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625)))))) (sqrt x))
(+ (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) (- t_1 (sqrt y))))
(+
t_2
(+
(+ (+ t_1 (sqrt (+ x 1.0))) (* z (+ 0.5 (* z (+ -0.125 (* z 0.0625))))))
(- 1.0 (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (t_2 <= 0.0) {
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x)) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (t_1 - sqrt(y)));
} else {
tmp = t_2 + (((t_1 + sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + t)) - sqrt(t)
if (t_2 <= 0.0d0) then
tmp = ((1.0d0 + (x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0)))))) - sqrt(x)) + ((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + (t_1 - sqrt(y)))
else
tmp = t_2 + (((t_1 + sqrt((x + 1.0d0))) + (z * (0.5d0 + (z * ((-0.125d0) + (z * 0.0625d0)))))) + (1.0d0 - sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (t_2 <= 0.0) {
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - Math.sqrt(x)) + ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + (t_1 - Math.sqrt(y)));
} else {
tmp = t_2 + (((t_1 + Math.sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if t_2 <= 0.0: tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - math.sqrt(x)) + ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + (t_1 - math.sqrt(y))) else: tmp = t_2 + (((t_1 + math.sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (t_2 <= 0.0) tmp = Float64(Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625)))))) - sqrt(x)) + Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(t_1 - sqrt(y)))); else tmp = Float64(t_2 + Float64(Float64(Float64(t_1 + sqrt(Float64(x + 1.0))) + Float64(z * Float64(0.5 + Float64(z * Float64(-0.125 + Float64(z * 0.0625)))))) + Float64(1.0 - sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (t_2 <= 0.0)
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x)) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (t_1 - sqrt(y)));
else
tmp = t_2 + (((t_1 + sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[(N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(N[(N[(t$95$1 + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(z * N[(0.5 + N[(z * N[(-0.125 + N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;\left(\left(1 + x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\right) - \sqrt{x}\right) + \left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(t\_1 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(\left(\left(t\_1 + \sqrt{x + 1}\right) + z \cdot \left(0.5 + z \cdot \left(-0.125 + z \cdot 0.0625\right)\right)\right) + \left(1 - \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t)) < 0.0Initial program 88.1%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified69.4%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6488.1%
Simplified88.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6455.7%
Simplified55.7%
flip--N/A
+-commutativeN/A
rem-square-sqrtN/A
rem-square-sqrtN/A
associate--l+N/A
+-inversesN/A
metadata-evalN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f6456.0%
Applied egg-rr56.0%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t)) Initial program 96.8%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
Simplified27.4%
Taylor expanded in z around inf
sqrt-lowering-sqrt.f6418.6%
Simplified18.6%
Final simplification36.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 (<= (- (sqrt (+ x 1.0)) (sqrt x)) 0.0)
(+
(/ (+ (* (sqrt x) 0.5) (* -0.125 (sqrt (/ 1.0 x)))) x)
(* 0.5 (+ (sqrt (/ 1.0 y)) (sqrt (/ 1.0 z)))))
(+
(- (+ 1.0 (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625)))))) (sqrt x))
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 y)) (sqrt y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((sqrt((x + 1.0)) - sqrt(x)) <= 0.0) {
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + sqrt((1.0 / z))));
} else {
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x)) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + y)) - 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 ((sqrt((x + 1.0d0)) - sqrt(x)) <= 0.0d0) then
tmp = (((sqrt(x) * 0.5d0) + ((-0.125d0) * sqrt((1.0d0 / x)))) / x) + (0.5d0 * (sqrt((1.0d0 / y)) + sqrt((1.0d0 / z))))
else
tmp = ((1.0d0 + (x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0)))))) - sqrt(x)) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + y)) - 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 ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) <= 0.0) {
tmp = (((Math.sqrt(x) * 0.5) + (-0.125 * Math.sqrt((1.0 / x)))) / x) + (0.5 * (Math.sqrt((1.0 / y)) + Math.sqrt((1.0 / z))));
} else {
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - Math.sqrt(x)) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (math.sqrt((x + 1.0)) - math.sqrt(x)) <= 0.0: tmp = (((math.sqrt(x) * 0.5) + (-0.125 * math.sqrt((1.0 / x)))) / x) + (0.5 * (math.sqrt((1.0 / y)) + math.sqrt((1.0 / z)))) else: tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - math.sqrt(x)) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + y)) - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) <= 0.0) tmp = Float64(Float64(Float64(Float64(sqrt(x) * 0.5) + Float64(-0.125 * sqrt(Float64(1.0 / x)))) / x) + Float64(0.5 * Float64(sqrt(Float64(1.0 / y)) + sqrt(Float64(1.0 / z))))); else tmp = Float64(Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625)))))) - sqrt(x)) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + y)) - 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 ((sqrt((x + 1.0)) - sqrt(x)) <= 0.0)
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + sqrt((1.0 / z))));
else
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x)) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + y)) - 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[N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(N[(N[(N[Sqrt[x], $MachinePrecision] * 0.5), $MachinePrecision] + N[(-0.125 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.5 * N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;\sqrt{x + 1} - \sqrt{x} \leq 0:\\
\;\;\;\;\frac{\sqrt{x} \cdot 0.5 + -0.125 \cdot \sqrt{\frac{1}{x}}}{x} + 0.5 \cdot \left(\sqrt{\frac{1}{y}} + \sqrt{\frac{1}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\right) - \sqrt{x}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.0Initial program 87.0%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified67.9%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6444.2%
Simplified44.2%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6423.4%
Simplified23.4%
Taylor expanded in z around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6412.4%
Simplified12.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6414.0%
Simplified14.0%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.2%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified68.5%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6457.9%
Simplified57.9%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6456.8%
Simplified56.8%
Final simplification37.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= (- (sqrt (+ x 1.0)) (sqrt x)) 0.0)
(+
(/ (+ (* (sqrt x) 0.5) (* -0.125 (sqrt (/ 1.0 x)))) x)
(* 0.5 (+ (sqrt (/ 1.0 y)) (sqrt (/ 1.0 z)))))
(+
(+ (- (sqrt (+ 1.0 z)) (sqrt 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 ((sqrt((x + 1.0)) - sqrt(x)) <= 0.0) {
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + sqrt((1.0 / z))));
} else {
tmp = ((sqrt((1.0 + z)) - sqrt(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 ((sqrt((x + 1.0d0)) - sqrt(x)) <= 0.0d0) then
tmp = (((sqrt(x) * 0.5d0) + ((-0.125d0) * sqrt((1.0d0 / x)))) / x) + (0.5d0 * (sqrt((1.0d0 / y)) + sqrt((1.0d0 / z))))
else
tmp = ((sqrt((1.0d0 + z)) - sqrt(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 ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) <= 0.0) {
tmp = (((Math.sqrt(x) * 0.5) + (-0.125 * Math.sqrt((1.0 / x)))) / x) + (0.5 * (Math.sqrt((1.0 / y)) + Math.sqrt((1.0 / z))));
} else {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(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 (math.sqrt((x + 1.0)) - math.sqrt(x)) <= 0.0: tmp = (((math.sqrt(x) * 0.5) + (-0.125 * math.sqrt((1.0 / x)))) / x) + (0.5 * (math.sqrt((1.0 / y)) + math.sqrt((1.0 / z)))) else: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(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 (Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) <= 0.0) tmp = Float64(Float64(Float64(Float64(sqrt(x) * 0.5) + Float64(-0.125 * sqrt(Float64(1.0 / x)))) / x) + Float64(0.5 * Float64(sqrt(Float64(1.0 / y)) + sqrt(Float64(1.0 / z))))); else tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 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 ((sqrt((x + 1.0)) - sqrt(x)) <= 0.0)
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + sqrt((1.0 / z))));
else
tmp = ((sqrt((1.0 + z)) - sqrt(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[N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(N[(N[(N[Sqrt[x], $MachinePrecision] * 0.5), $MachinePrecision] + N[(-0.125 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.5 * N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;\sqrt{x + 1} - \sqrt{x} \leq 0:\\
\;\;\;\;\frac{\sqrt{x} \cdot 0.5 + -0.125 \cdot \sqrt{\frac{1}{x}}}{x} + 0.5 \cdot \left(\sqrt{\frac{1}{y}} + \sqrt{\frac{1}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(1 - \sqrt{x}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.0Initial program 87.0%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified67.9%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6444.2%
Simplified44.2%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6423.4%
Simplified23.4%
Taylor expanded in z around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6412.4%
Simplified12.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6414.0%
Simplified14.0%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.2%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified68.5%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6457.9%
Simplified57.9%
Taylor expanded in x around 0
--lowering--.f64N/A
sqrt-lowering-sqrt.f6456.4%
Simplified56.4%
Final simplification37.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 (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625))))))
(t_2 (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y))))))
(if (<= x 3.8e-257)
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(+ 1.0 (- (+ t_1 (+ t_2 (/ 1.0 (+ 1.0 (sqrt z))))) (sqrt x))))
(if (<= x 8.2)
(+
1.0
(-
(+
(+ (+ t_2 (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))) t_1)
(* 0.5 (sqrt (/ 1.0 t))))
(sqrt x)))
(+
(/ (+ (* (sqrt x) 0.5) (* -0.125 (sqrt (/ 1.0 x)))) x)
(* 0.5 (+ (sqrt (/ 1.0 y)) (sqrt (/ 1.0 z)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x * (0.5 + (x * (-0.125 + (x * 0.0625))));
double t_2 = 1.0 / (sqrt(y) + sqrt((1.0 + y)));
double tmp;
if (x <= 3.8e-257) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (1.0 + ((t_1 + (t_2 + (1.0 / (1.0 + sqrt(z))))) - sqrt(x)));
} else if (x <= 8.2) {
tmp = 1.0 + ((((t_2 + (1.0 / (sqrt(z) + sqrt((1.0 + z))))) + t_1) + (0.5 * sqrt((1.0 / t)))) - sqrt(x));
} else {
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + 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) :: t_2
real(8) :: tmp
t_1 = x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0))))
t_2 = 1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))
if (x <= 3.8d-257) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 + ((t_1 + (t_2 + (1.0d0 / (1.0d0 + sqrt(z))))) - sqrt(x)))
else if (x <= 8.2d0) then
tmp = 1.0d0 + ((((t_2 + (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z))))) + t_1) + (0.5d0 * sqrt((1.0d0 / t)))) - sqrt(x))
else
tmp = (((sqrt(x) * 0.5d0) + ((-0.125d0) * sqrt((1.0d0 / x)))) / x) + (0.5d0 * (sqrt((1.0d0 / y)) + 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 = x * (0.5 + (x * (-0.125 + (x * 0.0625))));
double t_2 = 1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)));
double tmp;
if (x <= 3.8e-257) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 + ((t_1 + (t_2 + (1.0 / (1.0 + Math.sqrt(z))))) - Math.sqrt(x)));
} else if (x <= 8.2) {
tmp = 1.0 + ((((t_2 + (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z))))) + t_1) + (0.5 * Math.sqrt((1.0 / t)))) - Math.sqrt(x));
} else {
tmp = (((Math.sqrt(x) * 0.5) + (-0.125 * Math.sqrt((1.0 / x)))) / x) + (0.5 * (Math.sqrt((1.0 / y)) + Math.sqrt((1.0 / z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x * (0.5 + (x * (-0.125 + (x * 0.0625)))) t_2 = 1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))) tmp = 0 if x <= 3.8e-257: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 + ((t_1 + (t_2 + (1.0 / (1.0 + math.sqrt(z))))) - math.sqrt(x))) elif x <= 8.2: tmp = 1.0 + ((((t_2 + (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))))) + t_1) + (0.5 * math.sqrt((1.0 / t)))) - math.sqrt(x)) else: tmp = (((math.sqrt(x) * 0.5) + (-0.125 * math.sqrt((1.0 / x)))) / x) + (0.5 * (math.sqrt((1.0 / y)) + math.sqrt((1.0 / z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625))))) t_2 = Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) tmp = 0.0 if (x <= 3.8e-257) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 + Float64(Float64(t_1 + Float64(t_2 + Float64(1.0 / Float64(1.0 + sqrt(z))))) - sqrt(x)))); elseif (x <= 8.2) tmp = Float64(1.0 + Float64(Float64(Float64(Float64(t_2 + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z))))) + t_1) + Float64(0.5 * sqrt(Float64(1.0 / t)))) - sqrt(x))); else tmp = Float64(Float64(Float64(Float64(sqrt(x) * 0.5) + Float64(-0.125 * sqrt(Float64(1.0 / x)))) / x) + Float64(0.5 * Float64(sqrt(Float64(1.0 / y)) + 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 = x * (0.5 + (x * (-0.125 + (x * 0.0625))));
t_2 = 1.0 / (sqrt(y) + sqrt((1.0 + y)));
tmp = 0.0;
if (x <= 3.8e-257)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (1.0 + ((t_1 + (t_2 + (1.0 / (1.0 + sqrt(z))))) - sqrt(x)));
elseif (x <= 8.2)
tmp = 1.0 + ((((t_2 + (1.0 / (sqrt(z) + sqrt((1.0 + z))))) + t_1) + (0.5 * sqrt((1.0 / t)))) - sqrt(x));
else
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + 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[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 3.8e-257], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(t$95$1 + N[(t$95$2 + N[(1.0 / N[(1.0 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.2], N[(1.0 + N[(N[(N[(N[(t$95$2 + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[Sqrt[x], $MachinePrecision] * 0.5), $MachinePrecision] + N[(-0.125 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.5 * N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\\
t_2 := \frac{1}{\sqrt{y} + \sqrt{1 + y}}\\
\mathbf{if}\;x \leq 3.8 \cdot 10^{-257}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(1 + \left(\left(t\_1 + \left(t\_2 + \frac{1}{1 + \sqrt{z}}\right)\right) - \sqrt{x}\right)\right)\\
\mathbf{elif}\;x \leq 8.2:\\
\;\;\;\;1 + \left(\left(\left(\left(t\_2 + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\right) + t\_1\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{x} \cdot 0.5 + -0.125 \cdot \sqrt{\frac{1}{x}}}{x} + 0.5 \cdot \left(\sqrt{\frac{1}{y}} + \sqrt{\frac{1}{z}}\right)\\
\end{array}
\end{array}
if x < 3.8000000000000004e-257Initial program 98.0%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f6498.0%
Applied egg-rr98.0%
+-commutativeN/A
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f6498.9%
Applied egg-rr98.9%
Taylor expanded in x around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified98.9%
Taylor expanded in z around 0
Simplified96.4%
if 3.8000000000000004e-257 < x < 8.1999999999999993Initial program 97.4%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f6498.0%
Applied egg-rr98.0%
+-commutativeN/A
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f6498.2%
Applied egg-rr98.2%
Taylor expanded in x around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified98.4%
Taylor expanded in t around inf
Simplified55.5%
if 8.1999999999999993 < x Initial program 86.8%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified68.1%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6444.6%
Simplified44.6%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6424.4%
Simplified24.4%
Taylor expanded in z around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6412.4%
Simplified12.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6413.9%
Simplified13.9%
Final simplification41.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 (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625))))))
(t_2 (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y))))))
(if (<= x 3e-257)
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(+ 1.0 (- (+ t_1 (+ t_2 (/ 1.0 (+ 1.0 (sqrt z))))) (sqrt x))))
(if (<= x 490.0)
(+
1.0
(+ t_1 (+ t_2 (- (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) (sqrt x)))))
(+
(/ (+ (* (sqrt x) 0.5) (* -0.125 (sqrt (/ 1.0 x)))) x)
(* 0.5 (+ (sqrt (/ 1.0 y)) (sqrt (/ 1.0 z)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x * (0.5 + (x * (-0.125 + (x * 0.0625))));
double t_2 = 1.0 / (sqrt(y) + sqrt((1.0 + y)));
double tmp;
if (x <= 3e-257) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (1.0 + ((t_1 + (t_2 + (1.0 / (1.0 + sqrt(z))))) - sqrt(x)));
} else if (x <= 490.0) {
tmp = 1.0 + (t_1 + (t_2 + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) - sqrt(x))));
} else {
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + 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) :: t_2
real(8) :: tmp
t_1 = x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0))))
t_2 = 1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))
if (x <= 3d-257) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 + ((t_1 + (t_2 + (1.0d0 / (1.0d0 + sqrt(z))))) - sqrt(x)))
else if (x <= 490.0d0) then
tmp = 1.0d0 + (t_1 + (t_2 + ((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) - sqrt(x))))
else
tmp = (((sqrt(x) * 0.5d0) + ((-0.125d0) * sqrt((1.0d0 / x)))) / x) + (0.5d0 * (sqrt((1.0d0 / y)) + 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 = x * (0.5 + (x * (-0.125 + (x * 0.0625))));
double t_2 = 1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)));
double tmp;
if (x <= 3e-257) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 + ((t_1 + (t_2 + (1.0 / (1.0 + Math.sqrt(z))))) - Math.sqrt(x)));
} else if (x <= 490.0) {
tmp = 1.0 + (t_1 + (t_2 + ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) - Math.sqrt(x))));
} else {
tmp = (((Math.sqrt(x) * 0.5) + (-0.125 * Math.sqrt((1.0 / x)))) / x) + (0.5 * (Math.sqrt((1.0 / y)) + Math.sqrt((1.0 / z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x * (0.5 + (x * (-0.125 + (x * 0.0625)))) t_2 = 1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))) tmp = 0 if x <= 3e-257: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 + ((t_1 + (t_2 + (1.0 / (1.0 + math.sqrt(z))))) - math.sqrt(x))) elif x <= 490.0: tmp = 1.0 + (t_1 + (t_2 + ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) - math.sqrt(x)))) else: tmp = (((math.sqrt(x) * 0.5) + (-0.125 * math.sqrt((1.0 / x)))) / x) + (0.5 * (math.sqrt((1.0 / y)) + math.sqrt((1.0 / z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625))))) t_2 = Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) tmp = 0.0 if (x <= 3e-257) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 + Float64(Float64(t_1 + Float64(t_2 + Float64(1.0 / Float64(1.0 + sqrt(z))))) - sqrt(x)))); elseif (x <= 490.0) tmp = Float64(1.0 + Float64(t_1 + Float64(t_2 + Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) - sqrt(x))))); else tmp = Float64(Float64(Float64(Float64(sqrt(x) * 0.5) + Float64(-0.125 * sqrt(Float64(1.0 / x)))) / x) + Float64(0.5 * Float64(sqrt(Float64(1.0 / y)) + 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 = x * (0.5 + (x * (-0.125 + (x * 0.0625))));
t_2 = 1.0 / (sqrt(y) + sqrt((1.0 + y)));
tmp = 0.0;
if (x <= 3e-257)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (1.0 + ((t_1 + (t_2 + (1.0 / (1.0 + sqrt(z))))) - sqrt(x)));
elseif (x <= 490.0)
tmp = 1.0 + (t_1 + (t_2 + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) - sqrt(x))));
else
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + 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[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 3e-257], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(t$95$1 + N[(t$95$2 + N[(1.0 / N[(1.0 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 490.0], N[(1.0 + N[(t$95$1 + N[(t$95$2 + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[Sqrt[x], $MachinePrecision] * 0.5), $MachinePrecision] + N[(-0.125 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.5 * N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\\
t_2 := \frac{1}{\sqrt{y} + \sqrt{1 + y}}\\
\mathbf{if}\;x \leq 3 \cdot 10^{-257}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(1 + \left(\left(t\_1 + \left(t\_2 + \frac{1}{1 + \sqrt{z}}\right)\right) - \sqrt{x}\right)\right)\\
\mathbf{elif}\;x \leq 490:\\
\;\;\;\;1 + \left(t\_1 + \left(t\_2 + \left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} - \sqrt{x}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{x} \cdot 0.5 + -0.125 \cdot \sqrt{\frac{1}{x}}}{x} + 0.5 \cdot \left(\sqrt{\frac{1}{y}} + \sqrt{\frac{1}{z}}\right)\\
\end{array}
\end{array}
if x < 2.9999999999999999e-257Initial program 98.0%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f6498.0%
Applied egg-rr98.0%
+-commutativeN/A
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f6498.9%
Applied egg-rr98.9%
Taylor expanded in x around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified98.9%
Taylor expanded in z around 0
Simplified96.4%
if 2.9999999999999999e-257 < x < 490Initial program 97.4%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f6498.0%
Applied egg-rr98.0%
+-commutativeN/A
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f6498.2%
Applied egg-rr98.2%
Taylor expanded in x around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified98.4%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
Simplified60.5%
if 490 < x Initial program 86.8%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified68.1%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6444.6%
Simplified44.6%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6424.4%
Simplified24.4%
Taylor expanded in z around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6412.4%
Simplified12.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6413.9%
Simplified13.9%
Final simplification43.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))))
(if (<= t 2650000000.0)
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(+
(+ (+ t_1 (sqrt (+ x 1.0))) (* z (+ 0.5 (* z (+ -0.125 (* z 0.0625))))))
(- 1.0 (sqrt z))))
(+
(+ 1.0 (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625))))))
(-
(+ t_1 (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))))
(+ (sqrt x) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (t <= 2650000000.0) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (((t_1 + sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - sqrt(z)));
} else {
tmp = (1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + ((t_1 + (1.0 / (sqrt(z) + sqrt((1.0 + z))))) - (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) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (t <= 2650000000.0d0) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + (((t_1 + sqrt((x + 1.0d0))) + (z * (0.5d0 + (z * ((-0.125d0) + (z * 0.0625d0)))))) + (1.0d0 - sqrt(z)))
else
tmp = (1.0d0 + (x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0)))))) + ((t_1 + (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z))))) - (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 t_1 = Math.sqrt((1.0 + y));
double tmp;
if (t <= 2650000000.0) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (((t_1 + Math.sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - Math.sqrt(z)));
} else {
tmp = (1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + ((t_1 + (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z))))) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if t <= 2650000000.0: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + (((t_1 + math.sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - math.sqrt(z))) else: tmp = (1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + ((t_1 + (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))))) - (math.sqrt(x) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t <= 2650000000.0) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(Float64(t_1 + sqrt(Float64(x + 1.0))) + Float64(z * Float64(0.5 + Float64(z * Float64(-0.125 + Float64(z * 0.0625)))))) + Float64(1.0 - sqrt(z)))); else tmp = Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625)))))) + Float64(Float64(t_1 + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z))))) - 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)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (t <= 2650000000.0)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (((t_1 + sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - sqrt(z)));
else
tmp = (1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + ((t_1 + (1.0 / (sqrt(z) + sqrt((1.0 + z))))) - (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_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 2650000000.0], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t$95$1 + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(z * N[(0.5 + N[(z * N[(-0.125 + N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;t \leq 2650000000:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\left(\left(t\_1 + \sqrt{x + 1}\right) + z \cdot \left(0.5 + z \cdot \left(-0.125 + z \cdot 0.0625\right)\right)\right) + \left(1 - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\right) + \left(\left(t\_1 + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if t < 2.65e9Initial program 97.3%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
Simplified27.8%
Taylor expanded in z around inf
sqrt-lowering-sqrt.f6418.9%
Simplified18.9%
if 2.65e9 < t Initial program 87.7%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f6488.0%
Applied egg-rr88.0%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6443.1%
Simplified43.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6442.8%
Simplified42.8%
Final simplification30.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))))
(if (<= t 2.6e+16)
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(+
(+ (+ t_1 (sqrt (+ x 1.0))) (* z (+ 0.5 (* z (+ -0.125 (* z 0.0625))))))
(- 1.0 (sqrt y))))
(+
(+ 1.0 (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625))))))
(-
(+ t_1 (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))))
(+ (sqrt x) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (t <= 2.6e+16) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (((t_1 + sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - sqrt(y)));
} else {
tmp = (1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + ((t_1 + (1.0 / (sqrt(z) + sqrt((1.0 + z))))) - (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) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (t <= 2.6d+16) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + (((t_1 + sqrt((x + 1.0d0))) + (z * (0.5d0 + (z * ((-0.125d0) + (z * 0.0625d0)))))) + (1.0d0 - sqrt(y)))
else
tmp = (1.0d0 + (x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0)))))) + ((t_1 + (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z))))) - (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 t_1 = Math.sqrt((1.0 + y));
double tmp;
if (t <= 2.6e+16) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (((t_1 + Math.sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - Math.sqrt(y)));
} else {
tmp = (1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + ((t_1 + (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z))))) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if t <= 2.6e+16: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + (((t_1 + math.sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - math.sqrt(y))) else: tmp = (1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + ((t_1 + (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))))) - (math.sqrt(x) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t <= 2.6e+16) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(Float64(t_1 + sqrt(Float64(x + 1.0))) + Float64(z * Float64(0.5 + Float64(z * Float64(-0.125 + Float64(z * 0.0625)))))) + Float64(1.0 - sqrt(y)))); else tmp = Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625)))))) + Float64(Float64(t_1 + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z))))) - 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)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (t <= 2.6e+16)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (((t_1 + sqrt((x + 1.0))) + (z * (0.5 + (z * (-0.125 + (z * 0.0625)))))) + (1.0 - sqrt(y)));
else
tmp = (1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + ((t_1 + (1.0 / (sqrt(z) + sqrt((1.0 + z))))) - (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_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 2.6e+16], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t$95$1 + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(z * N[(0.5 + N[(z * N[(-0.125 + N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;t \leq 2.6 \cdot 10^{+16}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\left(\left(t\_1 + \sqrt{x + 1}\right) + z \cdot \left(0.5 + z \cdot \left(-0.125 + z \cdot 0.0625\right)\right)\right) + \left(1 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\right) + \left(\left(t\_1 + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if t < 2.6e16Initial program 96.8%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
Simplified27.4%
Taylor expanded in y around inf
sqrt-lowering-sqrt.f6422.3%
Simplified22.3%
if 2.6e16 < t Initial program 88.1%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f6488.4%
Applied egg-rr88.4%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6443.6%
Simplified43.6%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6443.3%
Simplified43.3%
Final simplification32.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 (<= x 25.0)
(+
(+ 1.0 (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625))))))
(-
(+ (sqrt (+ 1.0 y)) (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))))
(+ (sqrt x) (sqrt y))))
(+
(/ (+ (* (sqrt x) 0.5) (* -0.125 (sqrt (/ 1.0 x)))) x)
(* 0.5 (+ (sqrt (/ 1.0 y)) (sqrt (/ 1.0 z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 25.0) {
tmp = (1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + ((sqrt((1.0 + y)) + (1.0 / (sqrt(z) + sqrt((1.0 + z))))) - (sqrt(x) + sqrt(y)));
} else {
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + 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 (x <= 25.0d0) then
tmp = (1.0d0 + (x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0)))))) + ((sqrt((1.0d0 + y)) + (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z))))) - (sqrt(x) + sqrt(y)))
else
tmp = (((sqrt(x) * 0.5d0) + ((-0.125d0) * sqrt((1.0d0 / x)))) / x) + (0.5d0 * (sqrt((1.0d0 / y)) + 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 (x <= 25.0) {
tmp = (1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + ((Math.sqrt((1.0 + y)) + (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z))))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (((Math.sqrt(x) * 0.5) + (-0.125 * Math.sqrt((1.0 / x)))) / x) + (0.5 * (Math.sqrt((1.0 / y)) + 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 x <= 25.0: tmp = (1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + ((math.sqrt((1.0 + y)) + (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = (((math.sqrt(x) * 0.5) + (-0.125 * math.sqrt((1.0 / x)))) / x) + (0.5 * (math.sqrt((1.0 / y)) + 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 (x <= 25.0) tmp = Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625)))))) + Float64(Float64(sqrt(Float64(1.0 + y)) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z))))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(Float64(Float64(sqrt(x) * 0.5) + Float64(-0.125 * sqrt(Float64(1.0 / x)))) / x) + Float64(0.5 * Float64(sqrt(Float64(1.0 / y)) + 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 (x <= 25.0)
tmp = (1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) + ((sqrt((1.0 + y)) + (1.0 / (sqrt(z) + sqrt((1.0 + z))))) - (sqrt(x) + sqrt(y)));
else
tmp = (((sqrt(x) * 0.5) + (-0.125 * sqrt((1.0 / x)))) / x) + (0.5 * (sqrt((1.0 / y)) + 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[x, 25.0], N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[Sqrt[x], $MachinePrecision] * 0.5), $MachinePrecision] + N[(-0.125 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.5 * N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 25:\\
\;\;\;\;\left(1 + x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\right) + \left(\left(\sqrt{1 + y} + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{x} \cdot 0.5 + -0.125 \cdot \sqrt{\frac{1}{x}}}{x} + 0.5 \cdot \left(\sqrt{\frac{1}{y}} + \sqrt{\frac{1}{z}}\right)\\
\end{array}
\end{array}
if x < 25Initial program 97.6%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f6498.0%
Applied egg-rr98.0%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6446.9%
Simplified46.9%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6446.8%
Simplified46.8%
if 25 < x Initial program 86.8%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified68.1%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6444.6%
Simplified44.6%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6424.4%
Simplified24.4%
Taylor expanded in z around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6412.4%
Simplified12.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6413.9%
Simplified13.9%
Final simplification31.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= (- (sqrt (+ x 1.0)) (sqrt x)) 0.0)
(* 0.5 (+ (sqrt (/ 1.0 x)) (+ (sqrt (/ 1.0 y)) (sqrt (/ 1.0 z)))))
(+
(- (+ 1.0 (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625)))))) (sqrt x))
(- (sqrt (+ 1.0 y)) (sqrt y)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((sqrt((x + 1.0)) - sqrt(x)) <= 0.0) {
tmp = 0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / y)) + sqrt((1.0 / z))));
} else {
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x)) + (sqrt((1.0 + y)) - 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 ((sqrt((x + 1.0d0)) - sqrt(x)) <= 0.0d0) then
tmp = 0.5d0 * (sqrt((1.0d0 / x)) + (sqrt((1.0d0 / y)) + sqrt((1.0d0 / z))))
else
tmp = ((1.0d0 + (x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0)))))) - sqrt(x)) + (sqrt((1.0d0 + y)) - 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 ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) <= 0.0) {
tmp = 0.5 * (Math.sqrt((1.0 / x)) + (Math.sqrt((1.0 / y)) + Math.sqrt((1.0 / z))));
} else {
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (math.sqrt((x + 1.0)) - math.sqrt(x)) <= 0.0: tmp = 0.5 * (math.sqrt((1.0 / x)) + (math.sqrt((1.0 / y)) + math.sqrt((1.0 / z)))) else: tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - math.sqrt(x)) + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) <= 0.0) tmp = Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + Float64(sqrt(Float64(1.0 / y)) + sqrt(Float64(1.0 / z))))); else tmp = Float64(Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625)))))) - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - 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 ((sqrt((x + 1.0)) - sqrt(x)) <= 0.0)
tmp = 0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / y)) + sqrt((1.0 / z))));
else
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x)) + (sqrt((1.0 + y)) - 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[N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.0], N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;\sqrt{x + 1} - \sqrt{x} \leq 0:\\
\;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{x}} + \left(\sqrt{\frac{1}{y}} + \sqrt{\frac{1}{z}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\right) - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.0Initial program 87.0%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified67.9%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6444.2%
Simplified44.2%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6423.4%
Simplified23.4%
Taylor expanded in z around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6412.4%
Simplified12.4%
Taylor expanded in x around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6414.0%
Simplified14.0%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.2%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified68.5%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6457.9%
Simplified57.9%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6456.8%
Simplified56.8%
Taylor expanded in z around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6437.1%
Simplified37.1%
Final simplification26.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 1650000.0)
(-
(+
2.0
(+
(+ (sqrt (+ 1.0 z)) (* x (+ 0.5 (* x -0.125))))
(* y (+ 0.5 (* y (+ -0.125 (* y 0.0625)))))))
(+ (sqrt z) (+ (sqrt x) (sqrt y))))
(+
(- (+ 1.0 (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625)))))) (sqrt x))
(+ (- (sqrt (+ 1.0 y)) (sqrt 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 <= 1650000.0) {
tmp = (2.0 + ((sqrt((1.0 + z)) + (x * (0.5 + (x * -0.125)))) + (y * (0.5 + (y * (-0.125 + (y * 0.0625))))))) - (sqrt(z) + (sqrt(x) + sqrt(y)));
} else {
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(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 <= 1650000.0d0) then
tmp = (2.0d0 + ((sqrt((1.0d0 + z)) + (x * (0.5d0 + (x * (-0.125d0))))) + (y * (0.5d0 + (y * ((-0.125d0) + (y * 0.0625d0))))))) - (sqrt(z) + (sqrt(x) + sqrt(y)))
else
tmp = ((1.0d0 + (x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0)))))) - sqrt(x)) + ((sqrt((1.0d0 + y)) - sqrt(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 <= 1650000.0) {
tmp = (2.0 + ((Math.sqrt((1.0 + z)) + (x * (0.5 + (x * -0.125)))) + (y * (0.5 + (y * (-0.125 + (y * 0.0625))))))) - (Math.sqrt(z) + (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - Math.sqrt(x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(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 <= 1650000.0: tmp = (2.0 + ((math.sqrt((1.0 + z)) + (x * (0.5 + (x * -0.125)))) + (y * (0.5 + (y * (-0.125 + (y * 0.0625))))))) - (math.sqrt(z) + (math.sqrt(x) + math.sqrt(y))) else: tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - math.sqrt(x)) + ((math.sqrt((1.0 + y)) - math.sqrt(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 <= 1650000.0) tmp = Float64(Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + z)) + Float64(x * Float64(0.5 + Float64(x * -0.125)))) + Float64(y * Float64(0.5 + Float64(y * Float64(-0.125 + Float64(y * 0.0625))))))) - Float64(sqrt(z) + Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625)))))) - sqrt(x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(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 <= 1650000.0)
tmp = (2.0 + ((sqrt((1.0 + z)) + (x * (0.5 + (x * -0.125)))) + (y * (0.5 + (y * (-0.125 + (y * 0.0625))))))) - (sqrt(z) + (sqrt(x) + sqrt(y)));
else
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(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, 1650000.0], N[(N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(x * N[(0.5 + N[(x * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(0.5 + N[(y * N[(-0.125 + N[(y * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $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 1650000:\\
\;\;\;\;\left(2 + \left(\left(\sqrt{1 + z} + x \cdot \left(0.5 + x \cdot -0.125\right)\right) + y \cdot \left(0.5 + y \cdot \left(-0.125 + y \cdot 0.0625\right)\right)\right)\right) - \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\right) - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\\
\end{array}
\end{array}
if z < 1.65e6Initial program 96.7%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified95.5%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6453.6%
Simplified53.6%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6429.9%
Simplified29.9%
Taylor expanded in y around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified16.1%
Taylor expanded in x around 0
--lowering--.f64N/A
Simplified15.0%
if 1.65e6 < z Initial program 87.7%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified34.2%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6449.6%
Simplified49.6%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6437.0%
Simplified37.0%
Taylor expanded in z around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6437.1%
Simplified37.1%
Final simplification24.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625)))))))
(if (<= z 1620000.0)
(+
2.0
(-
(+ (+ (sqrt (+ 1.0 z)) t_1) (* y (+ 0.5 (* -0.125 y))))
(+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(+
(- (+ 1.0 t_1) (sqrt x))
(+ (- (sqrt (+ 1.0 y)) (sqrt 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 t_1 = x * (0.5 + (x * (-0.125 + (x * 0.0625))));
double tmp;
if (z <= 1620000.0) {
tmp = 2.0 + (((sqrt((1.0 + z)) + t_1) + (y * (0.5 + (-0.125 * y)))) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else {
tmp = ((1.0 + t_1) - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(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) :: t_1
real(8) :: tmp
t_1 = x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0))))
if (z <= 1620000.0d0) then
tmp = 2.0d0 + (((sqrt((1.0d0 + z)) + t_1) + (y * (0.5d0 + ((-0.125d0) * y)))) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else
tmp = ((1.0d0 + t_1) - sqrt(x)) + ((sqrt((1.0d0 + y)) - sqrt(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 t_1 = x * (0.5 + (x * (-0.125 + (x * 0.0625))));
double tmp;
if (z <= 1620000.0) {
tmp = 2.0 + (((Math.sqrt((1.0 + z)) + t_1) + (y * (0.5 + (-0.125 * y)))) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = ((1.0 + t_1) - Math.sqrt(x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(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): t_1 = x * (0.5 + (x * (-0.125 + (x * 0.0625)))) tmp = 0 if z <= 1620000.0: tmp = 2.0 + (((math.sqrt((1.0 + z)) + t_1) + (y * (0.5 + (-0.125 * y)))) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = ((1.0 + t_1) - math.sqrt(x)) + ((math.sqrt((1.0 + y)) - math.sqrt(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) t_1 = Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625))))) tmp = 0.0 if (z <= 1620000.0) tmp = Float64(2.0 + Float64(Float64(Float64(sqrt(Float64(1.0 + z)) + t_1) + Float64(y * Float64(0.5 + Float64(-0.125 * y)))) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(Float64(Float64(1.0 + t_1) - sqrt(x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(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)
t_1 = x * (0.5 + (x * (-0.125 + (x * 0.0625))));
tmp = 0.0;
if (z <= 1620000.0)
tmp = 2.0 + (((sqrt((1.0 + z)) + t_1) + (y * (0.5 + (-0.125 * y)))) - (sqrt(x) + (sqrt(y) + sqrt(z))));
else
tmp = ((1.0 + t_1) - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(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_] := Block[{t$95$1 = N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 1620000.0], N[(2.0 + N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] + N[(y * N[(0.5 + N[(-0.125 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + t$95$1), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\\
\mathbf{if}\;z \leq 1620000:\\
\;\;\;\;2 + \left(\left(\left(\sqrt{1 + z} + t\_1\right) + y \cdot \left(0.5 + -0.125 \cdot y\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + t\_1\right) - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\\
\end{array}
\end{array}
if z < 1.62e6Initial program 96.7%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified95.5%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6453.6%
Simplified53.6%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6429.9%
Simplified29.9%
Taylor expanded in y around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified15.0%
if 1.62e6 < z Initial program 87.7%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified34.2%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6449.6%
Simplified49.6%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6437.0%
Simplified37.0%
Taylor expanded in z around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6437.1%
Simplified37.1%
Final simplification24.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 1620000.0)
(+
2.0
(-
(+
(* y (+ 0.5 (* y (+ -0.125 (* y 0.0625)))))
(+ (sqrt (+ 1.0 z)) (* x 0.5)))
(+ (sqrt z) (+ (sqrt x) (sqrt y)))))
(+
(- (+ 1.0 (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625)))))) (sqrt x))
(+ (- (sqrt (+ 1.0 y)) (sqrt 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 <= 1620000.0) {
tmp = 2.0 + (((y * (0.5 + (y * (-0.125 + (y * 0.0625))))) + (sqrt((1.0 + z)) + (x * 0.5))) - (sqrt(z) + (sqrt(x) + sqrt(y))));
} else {
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(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 <= 1620000.0d0) then
tmp = 2.0d0 + (((y * (0.5d0 + (y * ((-0.125d0) + (y * 0.0625d0))))) + (sqrt((1.0d0 + z)) + (x * 0.5d0))) - (sqrt(z) + (sqrt(x) + sqrt(y))))
else
tmp = ((1.0d0 + (x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0)))))) - sqrt(x)) + ((sqrt((1.0d0 + y)) - sqrt(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 <= 1620000.0) {
tmp = 2.0 + (((y * (0.5 + (y * (-0.125 + (y * 0.0625))))) + (Math.sqrt((1.0 + z)) + (x * 0.5))) - (Math.sqrt(z) + (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - Math.sqrt(x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(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 <= 1620000.0: tmp = 2.0 + (((y * (0.5 + (y * (-0.125 + (y * 0.0625))))) + (math.sqrt((1.0 + z)) + (x * 0.5))) - (math.sqrt(z) + (math.sqrt(x) + math.sqrt(y)))) else: tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - math.sqrt(x)) + ((math.sqrt((1.0 + y)) - math.sqrt(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 <= 1620000.0) tmp = Float64(2.0 + Float64(Float64(Float64(y * Float64(0.5 + Float64(y * Float64(-0.125 + Float64(y * 0.0625))))) + Float64(sqrt(Float64(1.0 + z)) + Float64(x * 0.5))) - Float64(sqrt(z) + Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625)))))) - sqrt(x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(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 <= 1620000.0)
tmp = 2.0 + (((y * (0.5 + (y * (-0.125 + (y * 0.0625))))) + (sqrt((1.0 + z)) + (x * 0.5))) - (sqrt(z) + (sqrt(x) + sqrt(y))));
else
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(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, 1620000.0], N[(2.0 + N[(N[(N[(y * N[(0.5 + N[(y * N[(-0.125 + N[(y * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $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 1620000:\\
\;\;\;\;2 + \left(\left(y \cdot \left(0.5 + y \cdot \left(-0.125 + y \cdot 0.0625\right)\right) + \left(\sqrt{1 + z} + x \cdot 0.5\right)\right) - \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\right) - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\\
\end{array}
\end{array}
if z < 1.62e6Initial program 96.7%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified95.5%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6453.6%
Simplified53.6%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6429.9%
Simplified29.9%
Taylor expanded in y around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified16.1%
Taylor expanded in x around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified16.5%
if 1.62e6 < z Initial program 87.7%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified34.2%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6449.6%
Simplified49.6%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6437.0%
Simplified37.0%
Taylor expanded in z around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6437.1%
Simplified37.1%
Final simplification25.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 0.55)
(+
(- (+ 1.0 (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625)))))) (sqrt x))
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- 1.0 (sqrt y))))
(+ (- (sqrt (+ x 1.0)) (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 tmp;
if (y <= 0.55) {
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x)) + ((sqrt((1.0 + z)) - sqrt(z)) + (1.0 - sqrt(y)));
} else {
tmp = (sqrt((x + 1.0)) - 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) :: tmp
if (y <= 0.55d0) then
tmp = ((1.0d0 + (x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0)))))) - sqrt(x)) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (1.0d0 - sqrt(y)))
else
tmp = (sqrt((x + 1.0d0)) - 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 tmp;
if (y <= 0.55) {
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - Math.sqrt(x)) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (1.0 - Math.sqrt(y)));
} else {
tmp = (Math.sqrt((x + 1.0)) - 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): tmp = 0 if y <= 0.55: tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - math.sqrt(x)) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (1.0 - math.sqrt(y))) else: tmp = (math.sqrt((x + 1.0)) - 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) tmp = 0.0 if (y <= 0.55) tmp = Float64(Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625)))))) - sqrt(x)) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(1.0 - sqrt(y)))); else tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - 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)
tmp = 0.0;
if (y <= 0.55)
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x)) + ((sqrt((1.0 + z)) - sqrt(z)) + (1.0 - sqrt(y)));
else
tmp = (sqrt((x + 1.0)) - 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_] := If[LessEqual[y, 0.55], N[(N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $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.55:\\
\;\;\;\;\left(\left(1 + x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\right) - \sqrt{x}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(1 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + 0.5 \cdot \sqrt{\frac{1}{y}}\\
\end{array}
\end{array}
if y < 0.55000000000000004Initial program 97.2%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified72.7%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6457.8%
Simplified57.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6433.8%
Simplified33.8%
Taylor expanded in y around 0
--lowering--.f64N/A
sqrt-lowering-sqrt.f6432.9%
Simplified32.9%
if 0.55000000000000004 < y Initial program 88.5%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified64.1%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6446.3%
Simplified46.3%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6449.4%
Simplified49.4%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6424.6%
Simplified24.6%
Final simplification28.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 23000000000000.0)
(+
2.0
(-
(+ (sqrt (+ 1.0 z)) (* y (+ 0.5 (* y (+ -0.125 (* y 0.0625))))))
(+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(+
(- (+ 1.0 (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625)))))) (sqrt x))
(- (sqrt (+ 1.0 y)) (sqrt y)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 23000000000000.0) {
tmp = 2.0 + ((sqrt((1.0 + z)) + (y * (0.5 + (y * (-0.125 + (y * 0.0625)))))) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else {
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x)) + (sqrt((1.0 + y)) - 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 <= 23000000000000.0d0) then
tmp = 2.0d0 + ((sqrt((1.0d0 + z)) + (y * (0.5d0 + (y * ((-0.125d0) + (y * 0.0625d0)))))) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else
tmp = ((1.0d0 + (x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0)))))) - sqrt(x)) + (sqrt((1.0d0 + y)) - 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 <= 23000000000000.0) {
tmp = 2.0 + ((Math.sqrt((1.0 + z)) + (y * (0.5 + (y * (-0.125 + (y * 0.0625)))))) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 23000000000000.0: tmp = 2.0 + ((math.sqrt((1.0 + z)) + (y * (0.5 + (y * (-0.125 + (y * 0.0625)))))) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - math.sqrt(x)) + (math.sqrt((1.0 + y)) - 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 <= 23000000000000.0) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + z)) + Float64(y * Float64(0.5 + Float64(y * Float64(-0.125 + Float64(y * 0.0625)))))) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625)))))) - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - 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 <= 23000000000000.0)
tmp = 2.0 + ((sqrt((1.0 + z)) + (y * (0.5 + (y * (-0.125 + (y * 0.0625)))))) - (sqrt(x) + (sqrt(y) + sqrt(z))));
else
tmp = ((1.0 + (x * (0.5 + (x * (-0.125 + (x * 0.0625)))))) - sqrt(x)) + (sqrt((1.0 + y)) - 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, 23000000000000.0], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(y * N[(0.5 + N[(y * N[(-0.125 + N[(y * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 23000000000000:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + z} + y \cdot \left(0.5 + y \cdot \left(-0.125 + y \cdot 0.0625\right)\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\right) - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 2.3e13Initial program 96.4%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified93.7%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6454.0%
Simplified54.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6430.9%
Simplified30.9%
Taylor expanded in y around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified16.3%
Taylor expanded in x around 0
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-lowering-*.f6415.8%
Simplified15.8%
if 2.3e13 < z Initial program 87.7%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified34.4%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6448.9%
Simplified48.9%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6435.8%
Simplified35.8%
Taylor expanded in z around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6435.8%
Simplified35.8%
Final simplification24.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 (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625)))))))
(if (<= z 5800000000000.0)
(+
2.0
(-
(+ (sqrt (+ 1.0 z)) (+ t_1 (* y (+ 0.5 (* y (+ -0.125 (* y 0.0625)))))))
(+ (sqrt x) (sqrt z))))
(+ (- (+ 1.0 t_1) (sqrt x)) (- (sqrt (+ 1.0 y)) (sqrt y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x * (0.5 + (x * (-0.125 + (x * 0.0625))));
double tmp;
if (z <= 5800000000000.0) {
tmp = 2.0 + ((sqrt((1.0 + z)) + (t_1 + (y * (0.5 + (y * (-0.125 + (y * 0.0625))))))) - (sqrt(x) + sqrt(z)));
} else {
tmp = ((1.0 + t_1) - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0))))
if (z <= 5800000000000.0d0) then
tmp = 2.0d0 + ((sqrt((1.0d0 + z)) + (t_1 + (y * (0.5d0 + (y * ((-0.125d0) + (y * 0.0625d0))))))) - (sqrt(x) + sqrt(z)))
else
tmp = ((1.0d0 + t_1) - sqrt(x)) + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = x * (0.5 + (x * (-0.125 + (x * 0.0625))));
double tmp;
if (z <= 5800000000000.0) {
tmp = 2.0 + ((Math.sqrt((1.0 + z)) + (t_1 + (y * (0.5 + (y * (-0.125 + (y * 0.0625))))))) - (Math.sqrt(x) + Math.sqrt(z)));
} else {
tmp = ((1.0 + t_1) - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x * (0.5 + (x * (-0.125 + (x * 0.0625)))) tmp = 0 if z <= 5800000000000.0: tmp = 2.0 + ((math.sqrt((1.0 + z)) + (t_1 + (y * (0.5 + (y * (-0.125 + (y * 0.0625))))))) - (math.sqrt(x) + math.sqrt(z))) else: tmp = ((1.0 + t_1) - math.sqrt(x)) + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625))))) tmp = 0.0 if (z <= 5800000000000.0) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + z)) + Float64(t_1 + Float64(y * Float64(0.5 + Float64(y * Float64(-0.125 + Float64(y * 0.0625))))))) - Float64(sqrt(x) + sqrt(z)))); else tmp = Float64(Float64(Float64(1.0 + t_1) - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = x * (0.5 + (x * (-0.125 + (x * 0.0625))));
tmp = 0.0;
if (z <= 5800000000000.0)
tmp = 2.0 + ((sqrt((1.0 + z)) + (t_1 + (y * (0.5 + (y * (-0.125 + (y * 0.0625))))))) - (sqrt(x) + sqrt(z)));
else
tmp = ((1.0 + t_1) - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 5800000000000.0], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 + N[(y * N[(0.5 + N[(y * N[(-0.125 + N[(y * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + t$95$1), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\\
\mathbf{if}\;z \leq 5800000000000:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + z} + \left(t\_1 + y \cdot \left(0.5 + y \cdot \left(-0.125 + y \cdot 0.0625\right)\right)\right)\right) - \left(\sqrt{x} + \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + t\_1\right) - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 5.8e12Initial program 96.4%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified93.7%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6454.0%
Simplified54.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6430.9%
Simplified30.9%
Taylor expanded in y around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified16.3%
Taylor expanded in z around inf
sqrt-lowering-sqrt.f6415.5%
Simplified15.5%
if 5.8e12 < z Initial program 87.7%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified34.4%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6448.9%
Simplified48.9%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6435.8%
Simplified35.8%
Taylor expanded in z around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6435.8%
Simplified35.8%
Final simplification24.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625)))))))
(if (<= z 0.21)
(+
3.0
(-
(+ t_1 (* y (+ 0.5 (* y (+ -0.125 (* y 0.0625))))))
(+ (sqrt z) (+ (sqrt x) (sqrt y)))))
(+ (- (+ 1.0 t_1) (sqrt x)) (- (sqrt (+ 1.0 y)) (sqrt y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x * (0.5 + (x * (-0.125 + (x * 0.0625))));
double tmp;
if (z <= 0.21) {
tmp = 3.0 + ((t_1 + (y * (0.5 + (y * (-0.125 + (y * 0.0625)))))) - (sqrt(z) + (sqrt(x) + sqrt(y))));
} else {
tmp = ((1.0 + t_1) - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0))))
if (z <= 0.21d0) then
tmp = 3.0d0 + ((t_1 + (y * (0.5d0 + (y * ((-0.125d0) + (y * 0.0625d0)))))) - (sqrt(z) + (sqrt(x) + sqrt(y))))
else
tmp = ((1.0d0 + t_1) - sqrt(x)) + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = x * (0.5 + (x * (-0.125 + (x * 0.0625))));
double tmp;
if (z <= 0.21) {
tmp = 3.0 + ((t_1 + (y * (0.5 + (y * (-0.125 + (y * 0.0625)))))) - (Math.sqrt(z) + (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = ((1.0 + t_1) - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x * (0.5 + (x * (-0.125 + (x * 0.0625)))) tmp = 0 if z <= 0.21: tmp = 3.0 + ((t_1 + (y * (0.5 + (y * (-0.125 + (y * 0.0625)))))) - (math.sqrt(z) + (math.sqrt(x) + math.sqrt(y)))) else: tmp = ((1.0 + t_1) - math.sqrt(x)) + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625))))) tmp = 0.0 if (z <= 0.21) tmp = Float64(3.0 + Float64(Float64(t_1 + Float64(y * Float64(0.5 + Float64(y * Float64(-0.125 + Float64(y * 0.0625)))))) - Float64(sqrt(z) + Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(Float64(Float64(1.0 + t_1) - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = x * (0.5 + (x * (-0.125 + (x * 0.0625))));
tmp = 0.0;
if (z <= 0.21)
tmp = 3.0 + ((t_1 + (y * (0.5 + (y * (-0.125 + (y * 0.0625)))))) - (sqrt(z) + (sqrt(x) + sqrt(y))));
else
tmp = ((1.0 + t_1) - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 0.21], N[(3.0 + N[(N[(t$95$1 + N[(y * N[(0.5 + N[(y * N[(-0.125 + N[(y * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + t$95$1), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right)\\
\mathbf{if}\;z \leq 0.21:\\
\;\;\;\;3 + \left(\left(t\_1 + y \cdot \left(0.5 + y \cdot \left(-0.125 + y \cdot 0.0625\right)\right)\right) - \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + t\_1\right) - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 0.209999999999999992Initial program 96.7%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified95.5%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6454.3%
Simplified54.3%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6430.3%
Simplified30.3%
Taylor expanded in y around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified16.4%
Taylor expanded in z around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified16.4%
if 0.209999999999999992 < z Initial program 87.9%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified35.8%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6448.8%
Simplified48.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6436.3%
Simplified36.3%
Taylor expanded in z around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6435.2%
Simplified35.2%
Final simplification25.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 0.155) (+ 2.0 (* (* y (* y y)) (+ 0.0625 (/ -0.125 y)))) (+ (- (sqrt (+ x 1.0)) (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 tmp;
if (y <= 0.155) {
tmp = 2.0 + ((y * (y * y)) * (0.0625 + (-0.125 / y)));
} else {
tmp = (sqrt((x + 1.0)) - 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) :: tmp
if (y <= 0.155d0) then
tmp = 2.0d0 + ((y * (y * y)) * (0.0625d0 + ((-0.125d0) / y)))
else
tmp = (sqrt((x + 1.0d0)) - 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 tmp;
if (y <= 0.155) {
tmp = 2.0 + ((y * (y * y)) * (0.0625 + (-0.125 / y)));
} else {
tmp = (Math.sqrt((x + 1.0)) - 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): tmp = 0 if y <= 0.155: tmp = 2.0 + ((y * (y * y)) * (0.0625 + (-0.125 / y))) else: tmp = (math.sqrt((x + 1.0)) - 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) tmp = 0.0 if (y <= 0.155) tmp = Float64(2.0 + Float64(Float64(y * Float64(y * y)) * Float64(0.0625 + Float64(-0.125 / y)))); else tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - 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)
tmp = 0.0;
if (y <= 0.155)
tmp = 2.0 + ((y * (y * y)) * (0.0625 + (-0.125 / y)));
else
tmp = (sqrt((x + 1.0)) - 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_] := If[LessEqual[y, 0.155], N[(2.0 + N[(N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(0.0625 + N[(-0.125 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $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.155:\\
\;\;\;\;2 + \left(y \cdot \left(y \cdot y\right)\right) \cdot \left(0.0625 + \frac{-0.125}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + 0.5 \cdot \sqrt{\frac{1}{y}}\\
\end{array}
\end{array}
if y < 0.154999999999999999Initial program 97.2%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified72.7%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6457.8%
Simplified57.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6433.8%
Simplified33.8%
Taylor expanded in y around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified32.4%
Taylor expanded in y around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f6442.0%
Simplified42.0%
if 0.154999999999999999 < y Initial program 88.5%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified64.1%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6446.3%
Simplified46.3%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6449.4%
Simplified49.4%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6424.6%
Simplified24.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 2.9) (+ 2.0 (* (* y (* y y)) (+ 0.0625 (/ -0.125 y)))) (- (sqrt (+ x 1.0)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.9) {
tmp = 2.0 + ((y * (y * y)) * (0.0625 + (-0.125 / y)));
} else {
tmp = sqrt((x + 1.0)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.9d0) then
tmp = 2.0d0 + ((y * (y * y)) * (0.0625d0 + ((-0.125d0) / y)))
else
tmp = sqrt((x + 1.0d0)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.9) {
tmp = 2.0 + ((y * (y * y)) * (0.0625 + (-0.125 / y)));
} else {
tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.9: tmp = 2.0 + ((y * (y * y)) * (0.0625 + (-0.125 / y))) else: tmp = math.sqrt((x + 1.0)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.9) tmp = Float64(2.0 + Float64(Float64(y * Float64(y * y)) * Float64(0.0625 + Float64(-0.125 / y)))); else tmp = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2.9)
tmp = 2.0 + ((y * (y * y)) * (0.0625 + (-0.125 / y)));
else
tmp = sqrt((x + 1.0)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2.9], N[(2.0 + N[(N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(0.0625 + N[(-0.125 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.9:\\
\;\;\;\;2 + \left(y \cdot \left(y \cdot y\right)\right) \cdot \left(0.0625 + \frac{-0.125}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
\end{array}
\end{array}
if y < 2.89999999999999991Initial program 97.2%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified72.7%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6457.8%
Simplified57.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6433.8%
Simplified33.8%
Taylor expanded in y around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified32.4%
Taylor expanded in y around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f6442.0%
Simplified42.0%
if 2.89999999999999991 < y Initial program 88.5%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f6489.0%
Applied egg-rr89.0%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6421.4%
Simplified21.4%
Taylor expanded in x around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f6420.7%
Simplified20.7%
Final simplification30.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 2.0 (* (* x (* x x)) (+ 0.0625 (/ -0.125 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 2.0 + ((x * (x * x)) * (0.0625 + (-0.125 / 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 = 2.0d0 + ((x * (x * x)) * (0.0625d0 + ((-0.125d0) / x)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 2.0 + ((x * (x * x)) * (0.0625 + (-0.125 / x)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 2.0 + ((x * (x * x)) * (0.0625 + (-0.125 / x)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(2.0 + Float64(Float64(x * Float64(x * x)) * Float64(0.0625 + Float64(-0.125 / x)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 2.0 + ((x * (x * x)) * (0.0625 + (-0.125 / x)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(2.0 + N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(0.0625 + N[(-0.125 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
2 + \left(x \cdot \left(x \cdot x\right)\right) \cdot \left(0.0625 + \frac{-0.125}{x}\right)
\end{array}
Initial program 92.7%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified68.2%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6451.8%
Simplified51.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6433.0%
Simplified33.0%
Taylor expanded in y around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified17.4%
Taylor expanded in x around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f6428.4%
Simplified28.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 2.0 (* 0.0625 (* x (* x x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 2.0 + (0.0625 * (x * (x * 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 = 2.0d0 + (0.0625d0 * (x * (x * x)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 2.0 + (0.0625 * (x * (x * x)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 2.0 + (0.0625 * (x * (x * x)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(2.0 + Float64(0.0625 * Float64(x * Float64(x * x)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 2.0 + (0.0625 * (x * (x * x)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(2.0 + N[(0.0625 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
2 + 0.0625 \cdot \left(x \cdot \left(x \cdot x\right)\right)
\end{array}
Initial program 92.7%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified68.2%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6451.8%
Simplified51.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6433.0%
Simplified33.0%
Taylor expanded in y around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified17.4%
Taylor expanded in x around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6428.4%
Simplified28.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* z (* 0.0625 (* z z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return z * (0.0625 * (z * z));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = z * (0.0625d0 * (z * z))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return z * (0.0625 * (z * z));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return z * (0.0625 * (z * z))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(z * Float64(0.0625 * Float64(z * z))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = z * (0.0625 * (z * z));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(z * N[(0.0625 * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
z \cdot \left(0.0625 \cdot \left(z \cdot z\right)\right)
\end{array}
Initial program 92.7%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
Simplified21.8%
Taylor expanded in z around inf
unpow3N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f644.0%
Simplified4.0%
Final simplification4.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* 0.0625 (* y (* y y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 0.0625 * (y * (y * y));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 0.0625d0 * (y * (y * y))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 0.0625 * (y * (y * y));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 0.0625 * (y * (y * y))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(0.0625 * Float64(y * Float64(y * y))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 0.0625 * (y * (y * y));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(0.0625 * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
0.0625 \cdot \left(y \cdot \left(y \cdot y\right)\right)
\end{array}
Initial program 92.7%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified68.2%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6451.8%
Simplified51.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6433.0%
Simplified33.0%
Taylor expanded in y around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified17.4%
Taylor expanded in y around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.8%
Simplified3.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* 0.0625 (* x (* x x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 0.0625 * (x * (x * 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 = 0.0625d0 * (x * (x * x))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 0.0625 * (x * (x * x));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 0.0625 * (x * (x * x))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(0.0625 * Float64(x * Float64(x * x))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 0.0625 * (x * (x * x));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(0.0625 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
0.0625 \cdot \left(x \cdot \left(x \cdot x\right)\right)
\end{array}
Initial program 92.7%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified68.2%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6451.8%
Simplified51.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6433.0%
Simplified33.0%
Taylor expanded in x around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.7%
Simplified3.7%
(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 2024155
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ (/ 1 (+ (sqrt (+ x 1)) (sqrt x))) (/ 1 (+ (sqrt (+ y 1)) (sqrt y)))) (/ 1 (+ (sqrt (+ z 1)) (sqrt z)))) (- (sqrt (+ t 1)) (sqrt t))))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))