Diagrams.TwoD.Apollonian:descartes from diagrams-contrib-1.3.0.5

Percentage Accurate: 70.2% → 97.4%
Time: 4.2s
Alternatives: 14
Speedup: 0.4×

Specification

?
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
(FPCore (x y z)
  :precision binary64
  :pre TRUE
  (* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))
double code(double x, double y, double z) {
	return 2.0 * sqrt((((x * y) + (x * z)) + (y * z)));
}
real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = 2.0d0 * sqrt((((x * y) + (x * z)) + (y * z)))
end function
public static double code(double x, double y, double z) {
	return 2.0 * Math.sqrt((((x * y) + (x * z)) + (y * z)));
}
def code(x, y, z):
	return 2.0 * math.sqrt((((x * y) + (x * z)) + (y * z)))
function code(x, y, z)
	return Float64(2.0 * sqrt(Float64(Float64(Float64(x * y) + Float64(x * z)) + Float64(y * z))))
end
function tmp = code(x, y, z)
	tmp = 2.0 * sqrt((((x * y) + (x * z)) + (y * z)));
end
code[x_, y_, z_] := N[(2.0 * N[Sqrt[N[(N[(N[(x * y), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
f(x, y, z):
	x in [-inf, +inf],
	y in [-inf, +inf],
	z in [-inf, +inf]
code: THEORY
BEGIN
f(x, y, z: real): real =
	(2) * (sqrt((((x * y) + (x * z)) + (y * z))))
END code
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 70.2% accurate, 1.0× speedup?

\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
(FPCore (x y z)
  :precision binary64
  :pre TRUE
  (* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))
double code(double x, double y, double z) {
	return 2.0 * sqrt((((x * y) + (x * z)) + (y * z)));
}
real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = 2.0d0 * sqrt((((x * y) + (x * z)) + (y * z)))
end function
public static double code(double x, double y, double z) {
	return 2.0 * Math.sqrt((((x * y) + (x * z)) + (y * z)));
}
def code(x, y, z):
	return 2.0 * math.sqrt((((x * y) + (x * z)) + (y * z)))
function code(x, y, z)
	return Float64(2.0 * sqrt(Float64(Float64(Float64(x * y) + Float64(x * z)) + Float64(y * z))))
end
function tmp = code(x, y, z)
	tmp = 2.0 * sqrt((((x * y) + (x * z)) + (y * z)));
end
code[x_, y_, z_] := N[(2.0 * N[Sqrt[N[(N[(N[(x * y), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
f(x, y, z):
	x in [-inf, +inf],
	y in [-inf, +inf],
	z in [-inf, +inf]
code: THEORY
BEGIN
f(x, y, z: real): real =
	(2) * (sqrt((((x * y) + (x * z)) + (y * z))))
END code
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}

Alternative 1: 97.4% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ t_3 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ \mathbf{if}\;t\_2 \leq -9.55106670595963 \cdot 10^{+18}:\\ \;\;\;\;-2 \cdot \frac{t\_2}{\sqrt{\frac{t\_2}{t\_0}}}\\ \mathbf{elif}\;t\_2 \leq 3.162244367281735 \cdot 10^{-235}:\\ \;\;\;\;2 \cdot \sqrt{\mathsf{fma}\left(t\_3 + t\_0, t\_2, t\_3 \cdot t\_0\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\sqrt{\left|t\_0 + t\_2\right|}}{\sqrt{\left|\frac{1}{t\_3}\right|}}\\ \end{array} \]
(FPCore (x y z)
  :precision binary64
  :pre TRUE
  (let* ((t_0 (fmin (fmin x y) z))
       (t_1 (fmax (fmin x y) z))
       (t_2 (fmin (fmax x y) t_1))
       (t_3 (fmax (fmax x y) t_1)))
  (if (<= t_2 -9.55106670595963e+18)
    (* -2.0 (/ t_2 (sqrt (/ t_2 t_0))))
    (if (<= t_2 3.162244367281735e-235)
      (* 2.0 (sqrt (fma (+ t_3 t_0) t_2 (* t_3 t_0))))
      (*
       2.0
       (/ (sqrt (fabs (+ t_0 t_2))) (sqrt (fabs (/ 1.0 t_3)))))))))
double code(double x, double y, double z) {
	double t_0 = fmin(fmin(x, y), z);
	double t_1 = fmax(fmin(x, y), z);
	double t_2 = fmin(fmax(x, y), t_1);
	double t_3 = fmax(fmax(x, y), t_1);
	double tmp;
	if (t_2 <= -9.55106670595963e+18) {
		tmp = -2.0 * (t_2 / sqrt((t_2 / t_0)));
	} else if (t_2 <= 3.162244367281735e-235) {
		tmp = 2.0 * sqrt(fma((t_3 + t_0), t_2, (t_3 * t_0)));
	} else {
		tmp = 2.0 * (sqrt(fabs((t_0 + t_2))) / sqrt(fabs((1.0 / t_3))));
	}
	return tmp;
}
function code(x, y, z)
	t_0 = fmin(fmin(x, y), z)
	t_1 = fmax(fmin(x, y), z)
	t_2 = fmin(fmax(x, y), t_1)
	t_3 = fmax(fmax(x, y), t_1)
	tmp = 0.0
	if (t_2 <= -9.55106670595963e+18)
		tmp = Float64(-2.0 * Float64(t_2 / sqrt(Float64(t_2 / t_0))));
	elseif (t_2 <= 3.162244367281735e-235)
		tmp = Float64(2.0 * sqrt(fma(Float64(t_3 + t_0), t_2, Float64(t_3 * t_0))));
	else
		tmp = Float64(2.0 * Float64(sqrt(abs(Float64(t_0 + t_2))) / sqrt(abs(Float64(1.0 / t_3)))));
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[Min[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, If[LessEqual[t$95$2, -9.55106670595963e+18], N[(-2.0 * N[(t$95$2 / N[Sqrt[N[(t$95$2 / t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 3.162244367281735e-235], N[(2.0 * N[Sqrt[N[(N[(t$95$3 + t$95$0), $MachinePrecision] * t$95$2 + N[(t$95$3 * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sqrt[N[Abs[N[(t$95$0 + t$95$2), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[Abs[N[(1.0 / t$95$3), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
f(x, y, z):
	x in [-inf, +inf],
	y in [-inf, +inf],
	z in [-inf, +inf]
code: THEORY
BEGIN
f(x, y, z: real): real =
	LET tmp_2 = IF (x < y) THEN x ELSE y ENDIF IN
	LET tmp_3 = IF (x < y) THEN x ELSE y ENDIF IN
	LET tmp_1 = IF (tmp_2 < z) THEN tmp_3 ELSE z ENDIF IN
	LET t_0 = tmp_1 IN
		LET tmp_6 = IF (x < y) THEN x ELSE y ENDIF IN
		LET tmp_7 = IF (x < y) THEN x ELSE y ENDIF IN
		LET tmp_5 = IF (tmp_6 > z) THEN tmp_7 ELSE z ENDIF IN
		LET t_1 = tmp_5 IN
			LET tmp_10 = IF (x > y) THEN x ELSE y ENDIF IN
			LET tmp_11 = IF (x > y) THEN x ELSE y ENDIF IN
			LET tmp_9 = IF (tmp_10 < t_1) THEN tmp_11 ELSE t_1 ENDIF IN
			LET t_2 = tmp_9 IN
				LET tmp_14 = IF (x > y) THEN x ELSE y ENDIF IN
				LET tmp_15 = IF (x > y) THEN x ELSE y ENDIF IN
				LET tmp_13 = IF (tmp_14 > t_1) THEN tmp_15 ELSE t_1 ENDIF IN
				LET t_3 = tmp_13 IN
					LET tmp_17 = IF (t_2 <= (316224436728173517826490973030509114229484794791842938981949366113033743905093575595070068931708986606031530590568878421439620112075383086559308277572143517002028425189710606188571420147253332190817165135574622012695516986016156887496460553570965363747898426956714723321241293488917411653104042808627000800146047233409691273946971141723821674580190015263436783195002367241747046585248673115329038756374660839475041316073620469550192881615364386555569876592995114409979428009784180005454796405399109467891387927330205984337789666693321185111793640178028488331440915004577618674375116825103759765625e-831)) THEN ((2) * (sqrt((((t_3 + t_0) * t_2) + (t_3 * t_0))))) ELSE ((2) * ((sqrt((abs((t_0 + t_2))))) / (sqrt((abs(((1) / t_3))))))) ENDIF IN
					LET tmp_16 = IF (t_2 <= (-9551066705959630848)) THEN ((-2) * (t_2 / (sqrt((t_2 / t_0))))) ELSE tmp_17 ENDIF IN
	tmp_16
END code
\begin{array}{l}
t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\
t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\
t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
t_3 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
\mathbf{if}\;t\_2 \leq -9.55106670595963 \cdot 10^{+18}:\\
\;\;\;\;-2 \cdot \frac{t\_2}{\sqrt{\frac{t\_2}{t\_0}}}\\

\mathbf{elif}\;t\_2 \leq 3.162244367281735 \cdot 10^{-235}:\\
\;\;\;\;2 \cdot \sqrt{\mathsf{fma}\left(t\_3 + t\_0, t\_2, t\_3 \cdot t\_0\right)}\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\sqrt{\left|t\_0 + t\_2\right|}}{\sqrt{\left|\frac{1}{t\_3}\right|}}\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9551066705959630800

    1. Initial program 70.2%

      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
    2. Taylor expanded in y around -inf

      \[\leadsto -2 \cdot \left(y \cdot \sqrt{-1 \cdot \frac{-1 \cdot x + -1 \cdot z}{y}}\right) \]
    3. Step-by-step derivation
      1. Applied rewrites29.2%

        \[\leadsto -2 \cdot \left(y \cdot \sqrt{-1 \cdot \frac{\mathsf{fma}\left(-1, x, -1 \cdot z\right)}{y}}\right) \]
      2. Taylor expanded in z around 0

        \[\leadsto -2 \cdot \left(y \cdot \sqrt{\frac{x}{y}}\right) \]
      3. Step-by-step derivation
        1. Applied rewrites15.4%

          \[\leadsto -2 \cdot \left(y \cdot \sqrt{\frac{x}{y}}\right) \]
        2. Step-by-step derivation
          1. Applied rewrites15.4%

            \[\leadsto -2 \cdot \left(y \cdot \frac{1}{\sqrt{\frac{y}{x}}}\right) \]
          2. Taylor expanded in x around inf

            \[\leadsto -2 \cdot \frac{y}{\sqrt{\frac{y}{x}}} \]
          3. Step-by-step derivation
            1. Applied rewrites15.4%

              \[\leadsto -2 \cdot \frac{y}{\sqrt{\frac{y}{x}}} \]

            if -9551066705959630800 < y < 3.1622443672817352e-235

            1. Initial program 70.2%

              \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
            2. Step-by-step derivation
              1. Applied rewrites70.2%

                \[\leadsto 2 \cdot \sqrt{\mathsf{fma}\left(z + x, y, z \cdot x\right)} \]

              if 3.1622443672817352e-235 < y

              1. Initial program 70.2%

                \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
              2. Taylor expanded in z around inf

                \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{x + y}{z}}\right) \]
              3. Step-by-step derivation
                1. Applied rewrites30.6%

                  \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{x + y}{z}}\right) \]
                2. Taylor expanded in x around 0

                  \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{y}{z}}\right) \]
                3. Step-by-step derivation
                  1. Applied rewrites15.6%

                    \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{y}{z}}\right) \]
                  2. Step-by-step derivation
                    1. Applied rewrites16.5%

                      \[\leadsto 2 \cdot \frac{z \cdot \sqrt{\left|y\right|}}{\sqrt{\left|z\right|}} \]
                    2. Taylor expanded in z around inf

                      \[\leadsto 2 \cdot \frac{\sqrt{\left|x + y\right|}}{\sqrt{\left|\frac{1}{z}\right|}} \]
                    3. Step-by-step derivation
                      1. Applied rewrites67.9%

                        \[\leadsto 2 \cdot \frac{\sqrt{\left|x + y\right|}}{\sqrt{\left|\frac{1}{z}\right|}} \]
                    4. Recombined 3 regimes into one program.
                    5. Add Preprocessing

                    Alternative 2: 96.8% accurate, 0.2× speedup?

                    \[\begin{array}{l} t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ t_3 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ \mathbf{if}\;t\_2 \leq -9.55106670595963 \cdot 10^{+18}:\\ \;\;\;\;-2 \cdot \frac{t\_2}{\sqrt{\frac{t\_2}{t\_0}}}\\ \mathbf{elif}\;t\_2 \leq 233162798460332.5:\\ \;\;\;\;2 \cdot \sqrt{\mathsf{fma}\left(t\_3 + t\_0, t\_2, t\_3 \cdot t\_0\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t\_3 \cdot \sqrt{\frac{t\_0 + t\_2}{t\_3}}\right)\\ \end{array} \]
                    (FPCore (x y z)
                      :precision binary64
                      :pre TRUE
                      (let* ((t_0 (fmin (fmin x y) z))
                           (t_1 (fmax (fmin x y) z))
                           (t_2 (fmin (fmax x y) t_1))
                           (t_3 (fmax (fmax x y) t_1)))
                      (if (<= t_2 -9.55106670595963e+18)
                        (* -2.0 (/ t_2 (sqrt (/ t_2 t_0))))
                        (if (<= t_2 233162798460332.5)
                          (* 2.0 (sqrt (fma (+ t_3 t_0) t_2 (* t_3 t_0))))
                          (* 2.0 (* t_3 (sqrt (/ (+ t_0 t_2) t_3))))))))
                    double code(double x, double y, double z) {
                    	double t_0 = fmin(fmin(x, y), z);
                    	double t_1 = fmax(fmin(x, y), z);
                    	double t_2 = fmin(fmax(x, y), t_1);
                    	double t_3 = fmax(fmax(x, y), t_1);
                    	double tmp;
                    	if (t_2 <= -9.55106670595963e+18) {
                    		tmp = -2.0 * (t_2 / sqrt((t_2 / t_0)));
                    	} else if (t_2 <= 233162798460332.5) {
                    		tmp = 2.0 * sqrt(fma((t_3 + t_0), t_2, (t_3 * t_0)));
                    	} else {
                    		tmp = 2.0 * (t_3 * sqrt(((t_0 + t_2) / t_3)));
                    	}
                    	return tmp;
                    }
                    
                    function code(x, y, z)
                    	t_0 = fmin(fmin(x, y), z)
                    	t_1 = fmax(fmin(x, y), z)
                    	t_2 = fmin(fmax(x, y), t_1)
                    	t_3 = fmax(fmax(x, y), t_1)
                    	tmp = 0.0
                    	if (t_2 <= -9.55106670595963e+18)
                    		tmp = Float64(-2.0 * Float64(t_2 / sqrt(Float64(t_2 / t_0))));
                    	elseif (t_2 <= 233162798460332.5)
                    		tmp = Float64(2.0 * sqrt(fma(Float64(t_3 + t_0), t_2, Float64(t_3 * t_0))));
                    	else
                    		tmp = Float64(2.0 * Float64(t_3 * sqrt(Float64(Float64(t_0 + t_2) / t_3))));
                    	end
                    	return tmp
                    end
                    
                    code[x_, y_, z_] := Block[{t$95$0 = N[Min[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, If[LessEqual[t$95$2, -9.55106670595963e+18], N[(-2.0 * N[(t$95$2 / N[Sqrt[N[(t$95$2 / t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 233162798460332.5], N[(2.0 * N[Sqrt[N[(N[(t$95$3 + t$95$0), $MachinePrecision] * t$95$2 + N[(t$95$3 * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$3 * N[Sqrt[N[(N[(t$95$0 + t$95$2), $MachinePrecision] / t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
                    
                    f(x, y, z):
                    	x in [-inf, +inf],
                    	y in [-inf, +inf],
                    	z in [-inf, +inf]
                    code: THEORY
                    BEGIN
                    f(x, y, z: real): real =
                    	LET tmp_2 = IF (x < y) THEN x ELSE y ENDIF IN
                    	LET tmp_3 = IF (x < y) THEN x ELSE y ENDIF IN
                    	LET tmp_1 = IF (tmp_2 < z) THEN tmp_3 ELSE z ENDIF IN
                    	LET t_0 = tmp_1 IN
                    		LET tmp_6 = IF (x < y) THEN x ELSE y ENDIF IN
                    		LET tmp_7 = IF (x < y) THEN x ELSE y ENDIF IN
                    		LET tmp_5 = IF (tmp_6 > z) THEN tmp_7 ELSE z ENDIF IN
                    		LET t_1 = tmp_5 IN
                    			LET tmp_10 = IF (x > y) THEN x ELSE y ENDIF IN
                    			LET tmp_11 = IF (x > y) THEN x ELSE y ENDIF IN
                    			LET tmp_9 = IF (tmp_10 < t_1) THEN tmp_11 ELSE t_1 ENDIF IN
                    			LET t_2 = tmp_9 IN
                    				LET tmp_14 = IF (x > y) THEN x ELSE y ENDIF IN
                    				LET tmp_15 = IF (x > y) THEN x ELSE y ENDIF IN
                    				LET tmp_13 = IF (tmp_14 > t_1) THEN tmp_15 ELSE t_1 ENDIF IN
                    				LET t_3 = tmp_13 IN
                    					LET tmp_17 = IF (t_2 <= (2331627984603325e-1)) THEN ((2) * (sqrt((((t_3 + t_0) * t_2) + (t_3 * t_0))))) ELSE ((2) * (t_3 * (sqrt(((t_0 + t_2) / t_3))))) ENDIF IN
                    					LET tmp_16 = IF (t_2 <= (-9551066705959630848)) THEN ((-2) * (t_2 / (sqrt((t_2 / t_0))))) ELSE tmp_17 ENDIF IN
                    	tmp_16
                    END code
                    \begin{array}{l}
                    t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\
                    t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\
                    t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
                    t_3 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
                    \mathbf{if}\;t\_2 \leq -9.55106670595963 \cdot 10^{+18}:\\
                    \;\;\;\;-2 \cdot \frac{t\_2}{\sqrt{\frac{t\_2}{t\_0}}}\\
                    
                    \mathbf{elif}\;t\_2 \leq 233162798460332.5:\\
                    \;\;\;\;2 \cdot \sqrt{\mathsf{fma}\left(t\_3 + t\_0, t\_2, t\_3 \cdot t\_0\right)}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;2 \cdot \left(t\_3 \cdot \sqrt{\frac{t\_0 + t\_2}{t\_3}}\right)\\
                    
                    
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if y < -9551066705959630800

                      1. Initial program 70.2%

                        \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                      2. Taylor expanded in y around -inf

                        \[\leadsto -2 \cdot \left(y \cdot \sqrt{-1 \cdot \frac{-1 \cdot x + -1 \cdot z}{y}}\right) \]
                      3. Step-by-step derivation
                        1. Applied rewrites29.2%

                          \[\leadsto -2 \cdot \left(y \cdot \sqrt{-1 \cdot \frac{\mathsf{fma}\left(-1, x, -1 \cdot z\right)}{y}}\right) \]
                        2. Taylor expanded in z around 0

                          \[\leadsto -2 \cdot \left(y \cdot \sqrt{\frac{x}{y}}\right) \]
                        3. Step-by-step derivation
                          1. Applied rewrites15.4%

                            \[\leadsto -2 \cdot \left(y \cdot \sqrt{\frac{x}{y}}\right) \]
                          2. Step-by-step derivation
                            1. Applied rewrites15.4%

                              \[\leadsto -2 \cdot \left(y \cdot \frac{1}{\sqrt{\frac{y}{x}}}\right) \]
                            2. Taylor expanded in x around inf

                              \[\leadsto -2 \cdot \frac{y}{\sqrt{\frac{y}{x}}} \]
                            3. Step-by-step derivation
                              1. Applied rewrites15.4%

                                \[\leadsto -2 \cdot \frac{y}{\sqrt{\frac{y}{x}}} \]

                              if -9551066705959630800 < y < 233162798460332.5

                              1. Initial program 70.2%

                                \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                              2. Step-by-step derivation
                                1. Applied rewrites70.2%

                                  \[\leadsto 2 \cdot \sqrt{\mathsf{fma}\left(z + x, y, z \cdot x\right)} \]

                                if 233162798460332.5 < y

                                1. Initial program 70.2%

                                  \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                2. Taylor expanded in z around inf

                                  \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{x + y}{z}}\right) \]
                                3. Step-by-step derivation
                                  1. Applied rewrites30.6%

                                    \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{x + y}{z}}\right) \]
                                4. Recombined 3 regimes into one program.
                                5. Add Preprocessing

                                Alternative 3: 96.5% accurate, 0.2× speedup?

                                \[\begin{array}{l} t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ t_3 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ \mathbf{if}\;t\_2 \leq -4.239319354108506 \cdot 10^{+22}:\\ \;\;\;\;-2 \cdot \frac{t\_2}{\sqrt{\frac{t\_2}{t\_0}}}\\ \mathbf{elif}\;t\_2 \leq -2.0821119553426003 \cdot 10^{-307}:\\ \;\;\;\;2 \cdot \sqrt{t\_0 \cdot \left(t\_2 + t\_3\right)}\\ \mathbf{elif}\;t\_2 \leq 3.502817809010857 \cdot 10^{+40}:\\ \;\;\;\;2 \cdot \sqrt{t\_3 \cdot \left(t\_0 + t\_2\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{t\_3}{\sqrt{\left|\frac{t\_3}{t\_2}\right|}}\\ \end{array} \]
                                (FPCore (x y z)
                                  :precision binary64
                                  :pre TRUE
                                  (let* ((t_0 (fmin (fmin x y) z))
                                       (t_1 (fmax (fmin x y) z))
                                       (t_2 (fmin (fmax x y) t_1))
                                       (t_3 (fmax (fmax x y) t_1)))
                                  (if (<= t_2 -4.239319354108506e+22)
                                    (* -2.0 (/ t_2 (sqrt (/ t_2 t_0))))
                                    (if (<= t_2 -2.0821119553426003e-307)
                                      (* 2.0 (sqrt (* t_0 (+ t_2 t_3))))
                                      (if (<= t_2 3.502817809010857e+40)
                                        (* 2.0 (sqrt (* t_3 (+ t_0 t_2))))
                                        (* 2.0 (/ t_3 (sqrt (fabs (/ t_3 t_2))))))))))
                                double code(double x, double y, double z) {
                                	double t_0 = fmin(fmin(x, y), z);
                                	double t_1 = fmax(fmin(x, y), z);
                                	double t_2 = fmin(fmax(x, y), t_1);
                                	double t_3 = fmax(fmax(x, y), t_1);
                                	double tmp;
                                	if (t_2 <= -4.239319354108506e+22) {
                                		tmp = -2.0 * (t_2 / sqrt((t_2 / t_0)));
                                	} else if (t_2 <= -2.0821119553426003e-307) {
                                		tmp = 2.0 * sqrt((t_0 * (t_2 + t_3)));
                                	} else if (t_2 <= 3.502817809010857e+40) {
                                		tmp = 2.0 * sqrt((t_3 * (t_0 + t_2)));
                                	} else {
                                		tmp = 2.0 * (t_3 / sqrt(fabs((t_3 / t_2))));
                                	}
                                	return tmp;
                                }
                                
                                real(8) function code(x, y, z)
                                use fmin_fmax_functions
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    real(8), intent (in) :: z
                                    real(8) :: t_0
                                    real(8) :: t_1
                                    real(8) :: t_2
                                    real(8) :: t_3
                                    real(8) :: tmp
                                    t_0 = fmin(fmin(x, y), z)
                                    t_1 = fmax(fmin(x, y), z)
                                    t_2 = fmin(fmax(x, y), t_1)
                                    t_3 = fmax(fmax(x, y), t_1)
                                    if (t_2 <= (-4.239319354108506d+22)) then
                                        tmp = (-2.0d0) * (t_2 / sqrt((t_2 / t_0)))
                                    else if (t_2 <= (-2.0821119553426003d-307)) then
                                        tmp = 2.0d0 * sqrt((t_0 * (t_2 + t_3)))
                                    else if (t_2 <= 3.502817809010857d+40) then
                                        tmp = 2.0d0 * sqrt((t_3 * (t_0 + t_2)))
                                    else
                                        tmp = 2.0d0 * (t_3 / sqrt(abs((t_3 / t_2))))
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double x, double y, double z) {
                                	double t_0 = fmin(fmin(x, y), z);
                                	double t_1 = fmax(fmin(x, y), z);
                                	double t_2 = fmin(fmax(x, y), t_1);
                                	double t_3 = fmax(fmax(x, y), t_1);
                                	double tmp;
                                	if (t_2 <= -4.239319354108506e+22) {
                                		tmp = -2.0 * (t_2 / Math.sqrt((t_2 / t_0)));
                                	} else if (t_2 <= -2.0821119553426003e-307) {
                                		tmp = 2.0 * Math.sqrt((t_0 * (t_2 + t_3)));
                                	} else if (t_2 <= 3.502817809010857e+40) {
                                		tmp = 2.0 * Math.sqrt((t_3 * (t_0 + t_2)));
                                	} else {
                                		tmp = 2.0 * (t_3 / Math.sqrt(Math.abs((t_3 / t_2))));
                                	}
                                	return tmp;
                                }
                                
                                def code(x, y, z):
                                	t_0 = fmin(fmin(x, y), z)
                                	t_1 = fmax(fmin(x, y), z)
                                	t_2 = fmin(fmax(x, y), t_1)
                                	t_3 = fmax(fmax(x, y), t_1)
                                	tmp = 0
                                	if t_2 <= -4.239319354108506e+22:
                                		tmp = -2.0 * (t_2 / math.sqrt((t_2 / t_0)))
                                	elif t_2 <= -2.0821119553426003e-307:
                                		tmp = 2.0 * math.sqrt((t_0 * (t_2 + t_3)))
                                	elif t_2 <= 3.502817809010857e+40:
                                		tmp = 2.0 * math.sqrt((t_3 * (t_0 + t_2)))
                                	else:
                                		tmp = 2.0 * (t_3 / math.sqrt(math.fabs((t_3 / t_2))))
                                	return tmp
                                
                                function code(x, y, z)
                                	t_0 = fmin(fmin(x, y), z)
                                	t_1 = fmax(fmin(x, y), z)
                                	t_2 = fmin(fmax(x, y), t_1)
                                	t_3 = fmax(fmax(x, y), t_1)
                                	tmp = 0.0
                                	if (t_2 <= -4.239319354108506e+22)
                                		tmp = Float64(-2.0 * Float64(t_2 / sqrt(Float64(t_2 / t_0))));
                                	elseif (t_2 <= -2.0821119553426003e-307)
                                		tmp = Float64(2.0 * sqrt(Float64(t_0 * Float64(t_2 + t_3))));
                                	elseif (t_2 <= 3.502817809010857e+40)
                                		tmp = Float64(2.0 * sqrt(Float64(t_3 * Float64(t_0 + t_2))));
                                	else
                                		tmp = Float64(2.0 * Float64(t_3 / sqrt(abs(Float64(t_3 / t_2)))));
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(x, y, z)
                                	t_0 = min(min(x, y), z);
                                	t_1 = max(min(x, y), z);
                                	t_2 = min(max(x, y), t_1);
                                	t_3 = max(max(x, y), t_1);
                                	tmp = 0.0;
                                	if (t_2 <= -4.239319354108506e+22)
                                		tmp = -2.0 * (t_2 / sqrt((t_2 / t_0)));
                                	elseif (t_2 <= -2.0821119553426003e-307)
                                		tmp = 2.0 * sqrt((t_0 * (t_2 + t_3)));
                                	elseif (t_2 <= 3.502817809010857e+40)
                                		tmp = 2.0 * sqrt((t_3 * (t_0 + t_2)));
                                	else
                                		tmp = 2.0 * (t_3 / sqrt(abs((t_3 / t_2))));
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[x_, y_, z_] := Block[{t$95$0 = N[Min[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, If[LessEqual[t$95$2, -4.239319354108506e+22], N[(-2.0 * N[(t$95$2 / N[Sqrt[N[(t$95$2 / t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2.0821119553426003e-307], N[(2.0 * N[Sqrt[N[(t$95$0 * N[(t$95$2 + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 3.502817809010857e+40], N[(2.0 * N[Sqrt[N[(t$95$3 * N[(t$95$0 + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$3 / N[Sqrt[N[Abs[N[(t$95$3 / t$95$2), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
                                
                                f(x, y, z):
                                	x in [-inf, +inf],
                                	y in [-inf, +inf],
                                	z in [-inf, +inf]
                                code: THEORY
                                BEGIN
                                f(x, y, z: real): real =
                                	LET tmp_2 = IF (x < y) THEN x ELSE y ENDIF IN
                                	LET tmp_3 = IF (x < y) THEN x ELSE y ENDIF IN
                                	LET tmp_1 = IF (tmp_2 < z) THEN tmp_3 ELSE z ENDIF IN
                                	LET t_0 = tmp_1 IN
                                		LET tmp_6 = IF (x < y) THEN x ELSE y ENDIF IN
                                		LET tmp_7 = IF (x < y) THEN x ELSE y ENDIF IN
                                		LET tmp_5 = IF (tmp_6 > z) THEN tmp_7 ELSE z ENDIF IN
                                		LET t_1 = tmp_5 IN
                                			LET tmp_10 = IF (x > y) THEN x ELSE y ENDIF IN
                                			LET tmp_11 = IF (x > y) THEN x ELSE y ENDIF IN
                                			LET tmp_9 = IF (tmp_10 < t_1) THEN tmp_11 ELSE t_1 ENDIF IN
                                			LET t_2 = tmp_9 IN
                                				LET tmp_14 = IF (x > y) THEN x ELSE y ENDIF IN
                                				LET tmp_15 = IF (x > y) THEN x ELSE y ENDIF IN
                                				LET tmp_13 = IF (tmp_14 > t_1) THEN tmp_15 ELSE t_1 ENDIF IN
                                				LET t_3 = tmp_13 IN
                                					LET tmp_18 = IF (t_2 <= (35028178090108567626637793564331708776448)) THEN ((2) * (sqrt((t_3 * (t_0 + t_2))))) ELSE ((2) * (t_3 / (sqrt((abs((t_3 / t_2))))))) ENDIF IN
                                					LET tmp_17 = IF (t_2 <= (-20821119553426002996347196025835561405697388316458785341201450968945481337899787060796348824120331353716831384653559042802444302870388592096072855535603447317557718459616853259036799654135211449890320111830447389091546692768151236822209289170550596893643694413771911601967028135087778619056808672744571706375809831044721854351011064522583608860826505495103951456489907897832350584149531818016471179631461411340733316020548517331064350679128700240284622363133223411595889728810283440094047708382451353374854177713818705066625558097641844158456743352244625319670852416002805273539681595064610839178578219790827007709304063359587392669722010972310253657209587854495895223801308770056296081482026360902481756205365894494768524113081920035028815618716180324554443359375e-1070)) THEN ((2) * (sqrt((t_0 * (t_2 + t_3))))) ELSE tmp_18 ENDIF IN
                                					LET tmp_16 = IF (t_2 <= (-42393193541085056466944)) THEN ((-2) * (t_2 / (sqrt((t_2 / t_0))))) ELSE tmp_17 ENDIF IN
                                	tmp_16
                                END code
                                \begin{array}{l}
                                t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\
                                t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\
                                t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
                                t_3 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
                                \mathbf{if}\;t\_2 \leq -4.239319354108506 \cdot 10^{+22}:\\
                                \;\;\;\;-2 \cdot \frac{t\_2}{\sqrt{\frac{t\_2}{t\_0}}}\\
                                
                                \mathbf{elif}\;t\_2 \leq -2.0821119553426003 \cdot 10^{-307}:\\
                                \;\;\;\;2 \cdot \sqrt{t\_0 \cdot \left(t\_2 + t\_3\right)}\\
                                
                                \mathbf{elif}\;t\_2 \leq 3.502817809010857 \cdot 10^{+40}:\\
                                \;\;\;\;2 \cdot \sqrt{t\_3 \cdot \left(t\_0 + t\_2\right)}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;2 \cdot \frac{t\_3}{\sqrt{\left|\frac{t\_3}{t\_2}\right|}}\\
                                
                                
                                \end{array}
                                
                                Derivation
                                1. Split input into 4 regimes
                                2. if y < -4.2393193541085056e22

                                  1. Initial program 70.2%

                                    \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                  2. Taylor expanded in y around -inf

                                    \[\leadsto -2 \cdot \left(y \cdot \sqrt{-1 \cdot \frac{-1 \cdot x + -1 \cdot z}{y}}\right) \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites29.2%

                                      \[\leadsto -2 \cdot \left(y \cdot \sqrt{-1 \cdot \frac{\mathsf{fma}\left(-1, x, -1 \cdot z\right)}{y}}\right) \]
                                    2. Taylor expanded in z around 0

                                      \[\leadsto -2 \cdot \left(y \cdot \sqrt{\frac{x}{y}}\right) \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites15.4%

                                        \[\leadsto -2 \cdot \left(y \cdot \sqrt{\frac{x}{y}}\right) \]
                                      2. Step-by-step derivation
                                        1. Applied rewrites15.4%

                                          \[\leadsto -2 \cdot \left(y \cdot \frac{1}{\sqrt{\frac{y}{x}}}\right) \]
                                        2. Taylor expanded in x around inf

                                          \[\leadsto -2 \cdot \frac{y}{\sqrt{\frac{y}{x}}} \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites15.4%

                                            \[\leadsto -2 \cdot \frac{y}{\sqrt{\frac{y}{x}}} \]

                                          if -4.2393193541085056e22 < y < -2.0821119553426003e-307

                                          1. Initial program 70.2%

                                            \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                          2. Taylor expanded in x around 0

                                            \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites24.5%

                                              \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                            2. Taylor expanded in x around inf

                                              \[\leadsto 2 \cdot \sqrt{x \cdot \left(y + z\right)} \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites47.7%

                                                \[\leadsto 2 \cdot \sqrt{x \cdot \left(y + z\right)} \]

                                              if -2.0821119553426003e-307 < y < 3.5028178090108568e40

                                              1. Initial program 70.2%

                                                \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                              2. Taylor expanded in z around inf

                                                \[\leadsto 2 \cdot \sqrt{z \cdot \left(x + y\right)} \]
                                              3. Step-by-step derivation
                                                1. Applied rewrites47.5%

                                                  \[\leadsto 2 \cdot \sqrt{z \cdot \left(x + y\right)} \]

                                                if 3.5028178090108568e40 < y

                                                1. Initial program 70.2%

                                                  \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                2. Taylor expanded in z around inf

                                                  \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{x + y}{z}}\right) \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites30.6%

                                                    \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{x + y}{z}}\right) \]
                                                  2. Taylor expanded in x around 0

                                                    \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{y}{z}}\right) \]
                                                  3. Step-by-step derivation
                                                    1. Applied rewrites15.6%

                                                      \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{y}{z}}\right) \]
                                                    2. Step-by-step derivation
                                                      1. Applied rewrites16.5%

                                                        \[\leadsto 2 \cdot \frac{z \cdot \sqrt{\left|y\right|}}{\sqrt{\left|z\right|}} \]
                                                      2. Step-by-step derivation
                                                        1. Applied rewrites16.7%

                                                          \[\leadsto 2 \cdot \frac{z}{\sqrt{\left|\frac{z}{y}\right|}} \]
                                                      3. Recombined 4 regimes into one program.
                                                      4. Add Preprocessing

                                                      Alternative 4: 96.5% accurate, 0.2× speedup?

                                                      \[\begin{array}{l} t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ t_3 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ \mathbf{if}\;t\_2 \leq -4.239319354108506 \cdot 10^{+22}:\\ \;\;\;\;-2 \cdot \frac{t\_2}{\sqrt{\frac{t\_2}{t\_0}}}\\ \mathbf{elif}\;t\_2 \leq -2.0821119553426003 \cdot 10^{-307}:\\ \;\;\;\;2 \cdot \sqrt{t\_0 \cdot \left(t\_2 + t\_3\right)}\\ \mathbf{elif}\;t\_2 \leq 1.048916818449786 \cdot 10^{+22}:\\ \;\;\;\;2 \cdot \sqrt{t\_3 \cdot \left(t\_0 + t\_2\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t\_3 \cdot \sqrt{\frac{t\_2}{t\_3}}\right)\\ \end{array} \]
                                                      (FPCore (x y z)
                                                        :precision binary64
                                                        :pre TRUE
                                                        (let* ((t_0 (fmin (fmin x y) z))
                                                             (t_1 (fmax (fmin x y) z))
                                                             (t_2 (fmin (fmax x y) t_1))
                                                             (t_3 (fmax (fmax x y) t_1)))
                                                        (if (<= t_2 -4.239319354108506e+22)
                                                          (* -2.0 (/ t_2 (sqrt (/ t_2 t_0))))
                                                          (if (<= t_2 -2.0821119553426003e-307)
                                                            (* 2.0 (sqrt (* t_0 (+ t_2 t_3))))
                                                            (if (<= t_2 1.048916818449786e+22)
                                                              (* 2.0 (sqrt (* t_3 (+ t_0 t_2))))
                                                              (* 2.0 (* t_3 (sqrt (/ t_2 t_3)))))))))
                                                      double code(double x, double y, double z) {
                                                      	double t_0 = fmin(fmin(x, y), z);
                                                      	double t_1 = fmax(fmin(x, y), z);
                                                      	double t_2 = fmin(fmax(x, y), t_1);
                                                      	double t_3 = fmax(fmax(x, y), t_1);
                                                      	double tmp;
                                                      	if (t_2 <= -4.239319354108506e+22) {
                                                      		tmp = -2.0 * (t_2 / sqrt((t_2 / t_0)));
                                                      	} else if (t_2 <= -2.0821119553426003e-307) {
                                                      		tmp = 2.0 * sqrt((t_0 * (t_2 + t_3)));
                                                      	} else if (t_2 <= 1.048916818449786e+22) {
                                                      		tmp = 2.0 * sqrt((t_3 * (t_0 + t_2)));
                                                      	} else {
                                                      		tmp = 2.0 * (t_3 * sqrt((t_2 / t_3)));
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      real(8) function code(x, y, z)
                                                      use fmin_fmax_functions
                                                          real(8), intent (in) :: x
                                                          real(8), intent (in) :: y
                                                          real(8), intent (in) :: z
                                                          real(8) :: t_0
                                                          real(8) :: t_1
                                                          real(8) :: t_2
                                                          real(8) :: t_3
                                                          real(8) :: tmp
                                                          t_0 = fmin(fmin(x, y), z)
                                                          t_1 = fmax(fmin(x, y), z)
                                                          t_2 = fmin(fmax(x, y), t_1)
                                                          t_3 = fmax(fmax(x, y), t_1)
                                                          if (t_2 <= (-4.239319354108506d+22)) then
                                                              tmp = (-2.0d0) * (t_2 / sqrt((t_2 / t_0)))
                                                          else if (t_2 <= (-2.0821119553426003d-307)) then
                                                              tmp = 2.0d0 * sqrt((t_0 * (t_2 + t_3)))
                                                          else if (t_2 <= 1.048916818449786d+22) then
                                                              tmp = 2.0d0 * sqrt((t_3 * (t_0 + t_2)))
                                                          else
                                                              tmp = 2.0d0 * (t_3 * sqrt((t_2 / t_3)))
                                                          end if
                                                          code = tmp
                                                      end function
                                                      
                                                      public static double code(double x, double y, double z) {
                                                      	double t_0 = fmin(fmin(x, y), z);
                                                      	double t_1 = fmax(fmin(x, y), z);
                                                      	double t_2 = fmin(fmax(x, y), t_1);
                                                      	double t_3 = fmax(fmax(x, y), t_1);
                                                      	double tmp;
                                                      	if (t_2 <= -4.239319354108506e+22) {
                                                      		tmp = -2.0 * (t_2 / Math.sqrt((t_2 / t_0)));
                                                      	} else if (t_2 <= -2.0821119553426003e-307) {
                                                      		tmp = 2.0 * Math.sqrt((t_0 * (t_2 + t_3)));
                                                      	} else if (t_2 <= 1.048916818449786e+22) {
                                                      		tmp = 2.0 * Math.sqrt((t_3 * (t_0 + t_2)));
                                                      	} else {
                                                      		tmp = 2.0 * (t_3 * Math.sqrt((t_2 / t_3)));
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      def code(x, y, z):
                                                      	t_0 = fmin(fmin(x, y), z)
                                                      	t_1 = fmax(fmin(x, y), z)
                                                      	t_2 = fmin(fmax(x, y), t_1)
                                                      	t_3 = fmax(fmax(x, y), t_1)
                                                      	tmp = 0
                                                      	if t_2 <= -4.239319354108506e+22:
                                                      		tmp = -2.0 * (t_2 / math.sqrt((t_2 / t_0)))
                                                      	elif t_2 <= -2.0821119553426003e-307:
                                                      		tmp = 2.0 * math.sqrt((t_0 * (t_2 + t_3)))
                                                      	elif t_2 <= 1.048916818449786e+22:
                                                      		tmp = 2.0 * math.sqrt((t_3 * (t_0 + t_2)))
                                                      	else:
                                                      		tmp = 2.0 * (t_3 * math.sqrt((t_2 / t_3)))
                                                      	return tmp
                                                      
                                                      function code(x, y, z)
                                                      	t_0 = fmin(fmin(x, y), z)
                                                      	t_1 = fmax(fmin(x, y), z)
                                                      	t_2 = fmin(fmax(x, y), t_1)
                                                      	t_3 = fmax(fmax(x, y), t_1)
                                                      	tmp = 0.0
                                                      	if (t_2 <= -4.239319354108506e+22)
                                                      		tmp = Float64(-2.0 * Float64(t_2 / sqrt(Float64(t_2 / t_0))));
                                                      	elseif (t_2 <= -2.0821119553426003e-307)
                                                      		tmp = Float64(2.0 * sqrt(Float64(t_0 * Float64(t_2 + t_3))));
                                                      	elseif (t_2 <= 1.048916818449786e+22)
                                                      		tmp = Float64(2.0 * sqrt(Float64(t_3 * Float64(t_0 + t_2))));
                                                      	else
                                                      		tmp = Float64(2.0 * Float64(t_3 * sqrt(Float64(t_2 / t_3))));
                                                      	end
                                                      	return tmp
                                                      end
                                                      
                                                      function tmp_2 = code(x, y, z)
                                                      	t_0 = min(min(x, y), z);
                                                      	t_1 = max(min(x, y), z);
                                                      	t_2 = min(max(x, y), t_1);
                                                      	t_3 = max(max(x, y), t_1);
                                                      	tmp = 0.0;
                                                      	if (t_2 <= -4.239319354108506e+22)
                                                      		tmp = -2.0 * (t_2 / sqrt((t_2 / t_0)));
                                                      	elseif (t_2 <= -2.0821119553426003e-307)
                                                      		tmp = 2.0 * sqrt((t_0 * (t_2 + t_3)));
                                                      	elseif (t_2 <= 1.048916818449786e+22)
                                                      		tmp = 2.0 * sqrt((t_3 * (t_0 + t_2)));
                                                      	else
                                                      		tmp = 2.0 * (t_3 * sqrt((t_2 / t_3)));
                                                      	end
                                                      	tmp_2 = tmp;
                                                      end
                                                      
                                                      code[x_, y_, z_] := Block[{t$95$0 = N[Min[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, If[LessEqual[t$95$2, -4.239319354108506e+22], N[(-2.0 * N[(t$95$2 / N[Sqrt[N[(t$95$2 / t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2.0821119553426003e-307], N[(2.0 * N[Sqrt[N[(t$95$0 * N[(t$95$2 + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1.048916818449786e+22], N[(2.0 * N[Sqrt[N[(t$95$3 * N[(t$95$0 + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$3 * N[Sqrt[N[(t$95$2 / t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
                                                      
                                                      f(x, y, z):
                                                      	x in [-inf, +inf],
                                                      	y in [-inf, +inf],
                                                      	z in [-inf, +inf]
                                                      code: THEORY
                                                      BEGIN
                                                      f(x, y, z: real): real =
                                                      	LET tmp_2 = IF (x < y) THEN x ELSE y ENDIF IN
                                                      	LET tmp_3 = IF (x < y) THEN x ELSE y ENDIF IN
                                                      	LET tmp_1 = IF (tmp_2 < z) THEN tmp_3 ELSE z ENDIF IN
                                                      	LET t_0 = tmp_1 IN
                                                      		LET tmp_6 = IF (x < y) THEN x ELSE y ENDIF IN
                                                      		LET tmp_7 = IF (x < y) THEN x ELSE y ENDIF IN
                                                      		LET tmp_5 = IF (tmp_6 > z) THEN tmp_7 ELSE z ENDIF IN
                                                      		LET t_1 = tmp_5 IN
                                                      			LET tmp_10 = IF (x > y) THEN x ELSE y ENDIF IN
                                                      			LET tmp_11 = IF (x > y) THEN x ELSE y ENDIF IN
                                                      			LET tmp_9 = IF (tmp_10 < t_1) THEN tmp_11 ELSE t_1 ENDIF IN
                                                      			LET t_2 = tmp_9 IN
                                                      				LET tmp_14 = IF (x > y) THEN x ELSE y ENDIF IN
                                                      				LET tmp_15 = IF (x > y) THEN x ELSE y ENDIF IN
                                                      				LET tmp_13 = IF (tmp_14 > t_1) THEN tmp_15 ELSE t_1 ENDIF IN
                                                      				LET t_3 = tmp_13 IN
                                                      					LET tmp_18 = IF (t_2 <= (10489168184497861033984)) THEN ((2) * (sqrt((t_3 * (t_0 + t_2))))) ELSE ((2) * (t_3 * (sqrt((t_2 / t_3))))) ENDIF IN
                                                      					LET tmp_17 = IF (t_2 <= (-20821119553426002996347196025835561405697388316458785341201450968945481337899787060796348824120331353716831384653559042802444302870388592096072855535603447317557718459616853259036799654135211449890320111830447389091546692768151236822209289170550596893643694413771911601967028135087778619056808672744571706375809831044721854351011064522583608860826505495103951456489907897832350584149531818016471179631461411340733316020548517331064350679128700240284622363133223411595889728810283440094047708382451353374854177713818705066625558097641844158456743352244625319670852416002805273539681595064610839178578219790827007709304063359587392669722010972310253657209587854495895223801308770056296081482026360902481756205365894494768524113081920035028815618716180324554443359375e-1070)) THEN ((2) * (sqrt((t_0 * (t_2 + t_3))))) ELSE tmp_18 ENDIF IN
                                                      					LET tmp_16 = IF (t_2 <= (-42393193541085056466944)) THEN ((-2) * (t_2 / (sqrt((t_2 / t_0))))) ELSE tmp_17 ENDIF IN
                                                      	tmp_16
                                                      END code
                                                      \begin{array}{l}
                                                      t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\
                                                      t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\
                                                      t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
                                                      t_3 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
                                                      \mathbf{if}\;t\_2 \leq -4.239319354108506 \cdot 10^{+22}:\\
                                                      \;\;\;\;-2 \cdot \frac{t\_2}{\sqrt{\frac{t\_2}{t\_0}}}\\
                                                      
                                                      \mathbf{elif}\;t\_2 \leq -2.0821119553426003 \cdot 10^{-307}:\\
                                                      \;\;\;\;2 \cdot \sqrt{t\_0 \cdot \left(t\_2 + t\_3\right)}\\
                                                      
                                                      \mathbf{elif}\;t\_2 \leq 1.048916818449786 \cdot 10^{+22}:\\
                                                      \;\;\;\;2 \cdot \sqrt{t\_3 \cdot \left(t\_0 + t\_2\right)}\\
                                                      
                                                      \mathbf{else}:\\
                                                      \;\;\;\;2 \cdot \left(t\_3 \cdot \sqrt{\frac{t\_2}{t\_3}}\right)\\
                                                      
                                                      
                                                      \end{array}
                                                      
                                                      Derivation
                                                      1. Split input into 4 regimes
                                                      2. if y < -4.2393193541085056e22

                                                        1. Initial program 70.2%

                                                          \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                        2. Taylor expanded in y around -inf

                                                          \[\leadsto -2 \cdot \left(y \cdot \sqrt{-1 \cdot \frac{-1 \cdot x + -1 \cdot z}{y}}\right) \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites29.2%

                                                            \[\leadsto -2 \cdot \left(y \cdot \sqrt{-1 \cdot \frac{\mathsf{fma}\left(-1, x, -1 \cdot z\right)}{y}}\right) \]
                                                          2. Taylor expanded in z around 0

                                                            \[\leadsto -2 \cdot \left(y \cdot \sqrt{\frac{x}{y}}\right) \]
                                                          3. Step-by-step derivation
                                                            1. Applied rewrites15.4%

                                                              \[\leadsto -2 \cdot \left(y \cdot \sqrt{\frac{x}{y}}\right) \]
                                                            2. Step-by-step derivation
                                                              1. Applied rewrites15.4%

                                                                \[\leadsto -2 \cdot \left(y \cdot \frac{1}{\sqrt{\frac{y}{x}}}\right) \]
                                                              2. Taylor expanded in x around inf

                                                                \[\leadsto -2 \cdot \frac{y}{\sqrt{\frac{y}{x}}} \]
                                                              3. Step-by-step derivation
                                                                1. Applied rewrites15.4%

                                                                  \[\leadsto -2 \cdot \frac{y}{\sqrt{\frac{y}{x}}} \]

                                                                if -4.2393193541085056e22 < y < -2.0821119553426003e-307

                                                                1. Initial program 70.2%

                                                                  \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                2. Taylor expanded in x around 0

                                                                  \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                                                3. Step-by-step derivation
                                                                  1. Applied rewrites24.5%

                                                                    \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                                                  2. Taylor expanded in x around inf

                                                                    \[\leadsto 2 \cdot \sqrt{x \cdot \left(y + z\right)} \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites47.7%

                                                                      \[\leadsto 2 \cdot \sqrt{x \cdot \left(y + z\right)} \]

                                                                    if -2.0821119553426003e-307 < y < 1.0489168184497861e22

                                                                    1. Initial program 70.2%

                                                                      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                    2. Taylor expanded in z around inf

                                                                      \[\leadsto 2 \cdot \sqrt{z \cdot \left(x + y\right)} \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites47.5%

                                                                        \[\leadsto 2 \cdot \sqrt{z \cdot \left(x + y\right)} \]

                                                                      if 1.0489168184497861e22 < y

                                                                      1. Initial program 70.2%

                                                                        \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                      2. Taylor expanded in z around inf

                                                                        \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{x + y}{z}}\right) \]
                                                                      3. Step-by-step derivation
                                                                        1. Applied rewrites30.6%

                                                                          \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{x + y}{z}}\right) \]
                                                                        2. Taylor expanded in x around 0

                                                                          \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{y}{z}}\right) \]
                                                                        3. Step-by-step derivation
                                                                          1. Applied rewrites15.6%

                                                                            \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{y}{z}}\right) \]
                                                                        4. Recombined 4 regimes into one program.
                                                                        5. Add Preprocessing

                                                                        Alternative 5: 96.5% accurate, 0.2× speedup?

                                                                        \[\begin{array}{l} t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ t_3 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ \mathbf{if}\;t\_2 \leq -4.239319354108506 \cdot 10^{+22}:\\ \;\;\;\;-2 \cdot \left(t\_0 \cdot \sqrt{\frac{t\_2}{t\_0}}\right)\\ \mathbf{elif}\;t\_2 \leq -2.0821119553426003 \cdot 10^{-307}:\\ \;\;\;\;2 \cdot \sqrt{t\_0 \cdot \left(t\_2 + t\_3\right)}\\ \mathbf{elif}\;t\_2 \leq 1.048916818449786 \cdot 10^{+22}:\\ \;\;\;\;2 \cdot \sqrt{t\_3 \cdot \left(t\_0 + t\_2\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t\_3 \cdot \sqrt{\frac{t\_2}{t\_3}}\right)\\ \end{array} \]
                                                                        (FPCore (x y z)
                                                                          :precision binary64
                                                                          :pre TRUE
                                                                          (let* ((t_0 (fmin (fmin x y) z))
                                                                               (t_1 (fmax (fmin x y) z))
                                                                               (t_2 (fmin (fmax x y) t_1))
                                                                               (t_3 (fmax (fmax x y) t_1)))
                                                                          (if (<= t_2 -4.239319354108506e+22)
                                                                            (* -2.0 (* t_0 (sqrt (/ t_2 t_0))))
                                                                            (if (<= t_2 -2.0821119553426003e-307)
                                                                              (* 2.0 (sqrt (* t_0 (+ t_2 t_3))))
                                                                              (if (<= t_2 1.048916818449786e+22)
                                                                                (* 2.0 (sqrt (* t_3 (+ t_0 t_2))))
                                                                                (* 2.0 (* t_3 (sqrt (/ t_2 t_3)))))))))
                                                                        double code(double x, double y, double z) {
                                                                        	double t_0 = fmin(fmin(x, y), z);
                                                                        	double t_1 = fmax(fmin(x, y), z);
                                                                        	double t_2 = fmin(fmax(x, y), t_1);
                                                                        	double t_3 = fmax(fmax(x, y), t_1);
                                                                        	double tmp;
                                                                        	if (t_2 <= -4.239319354108506e+22) {
                                                                        		tmp = -2.0 * (t_0 * sqrt((t_2 / t_0)));
                                                                        	} else if (t_2 <= -2.0821119553426003e-307) {
                                                                        		tmp = 2.0 * sqrt((t_0 * (t_2 + t_3)));
                                                                        	} else if (t_2 <= 1.048916818449786e+22) {
                                                                        		tmp = 2.0 * sqrt((t_3 * (t_0 + t_2)));
                                                                        	} else {
                                                                        		tmp = 2.0 * (t_3 * sqrt((t_2 / t_3)));
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        real(8) function code(x, y, z)
                                                                        use fmin_fmax_functions
                                                                            real(8), intent (in) :: x
                                                                            real(8), intent (in) :: y
                                                                            real(8), intent (in) :: z
                                                                            real(8) :: t_0
                                                                            real(8) :: t_1
                                                                            real(8) :: t_2
                                                                            real(8) :: t_3
                                                                            real(8) :: tmp
                                                                            t_0 = fmin(fmin(x, y), z)
                                                                            t_1 = fmax(fmin(x, y), z)
                                                                            t_2 = fmin(fmax(x, y), t_1)
                                                                            t_3 = fmax(fmax(x, y), t_1)
                                                                            if (t_2 <= (-4.239319354108506d+22)) then
                                                                                tmp = (-2.0d0) * (t_0 * sqrt((t_2 / t_0)))
                                                                            else if (t_2 <= (-2.0821119553426003d-307)) then
                                                                                tmp = 2.0d0 * sqrt((t_0 * (t_2 + t_3)))
                                                                            else if (t_2 <= 1.048916818449786d+22) then
                                                                                tmp = 2.0d0 * sqrt((t_3 * (t_0 + t_2)))
                                                                            else
                                                                                tmp = 2.0d0 * (t_3 * sqrt((t_2 / t_3)))
                                                                            end if
                                                                            code = tmp
                                                                        end function
                                                                        
                                                                        public static double code(double x, double y, double z) {
                                                                        	double t_0 = fmin(fmin(x, y), z);
                                                                        	double t_1 = fmax(fmin(x, y), z);
                                                                        	double t_2 = fmin(fmax(x, y), t_1);
                                                                        	double t_3 = fmax(fmax(x, y), t_1);
                                                                        	double tmp;
                                                                        	if (t_2 <= -4.239319354108506e+22) {
                                                                        		tmp = -2.0 * (t_0 * Math.sqrt((t_2 / t_0)));
                                                                        	} else if (t_2 <= -2.0821119553426003e-307) {
                                                                        		tmp = 2.0 * Math.sqrt((t_0 * (t_2 + t_3)));
                                                                        	} else if (t_2 <= 1.048916818449786e+22) {
                                                                        		tmp = 2.0 * Math.sqrt((t_3 * (t_0 + t_2)));
                                                                        	} else {
                                                                        		tmp = 2.0 * (t_3 * Math.sqrt((t_2 / t_3)));
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        def code(x, y, z):
                                                                        	t_0 = fmin(fmin(x, y), z)
                                                                        	t_1 = fmax(fmin(x, y), z)
                                                                        	t_2 = fmin(fmax(x, y), t_1)
                                                                        	t_3 = fmax(fmax(x, y), t_1)
                                                                        	tmp = 0
                                                                        	if t_2 <= -4.239319354108506e+22:
                                                                        		tmp = -2.0 * (t_0 * math.sqrt((t_2 / t_0)))
                                                                        	elif t_2 <= -2.0821119553426003e-307:
                                                                        		tmp = 2.0 * math.sqrt((t_0 * (t_2 + t_3)))
                                                                        	elif t_2 <= 1.048916818449786e+22:
                                                                        		tmp = 2.0 * math.sqrt((t_3 * (t_0 + t_2)))
                                                                        	else:
                                                                        		tmp = 2.0 * (t_3 * math.sqrt((t_2 / t_3)))
                                                                        	return tmp
                                                                        
                                                                        function code(x, y, z)
                                                                        	t_0 = fmin(fmin(x, y), z)
                                                                        	t_1 = fmax(fmin(x, y), z)
                                                                        	t_2 = fmin(fmax(x, y), t_1)
                                                                        	t_3 = fmax(fmax(x, y), t_1)
                                                                        	tmp = 0.0
                                                                        	if (t_2 <= -4.239319354108506e+22)
                                                                        		tmp = Float64(-2.0 * Float64(t_0 * sqrt(Float64(t_2 / t_0))));
                                                                        	elseif (t_2 <= -2.0821119553426003e-307)
                                                                        		tmp = Float64(2.0 * sqrt(Float64(t_0 * Float64(t_2 + t_3))));
                                                                        	elseif (t_2 <= 1.048916818449786e+22)
                                                                        		tmp = Float64(2.0 * sqrt(Float64(t_3 * Float64(t_0 + t_2))));
                                                                        	else
                                                                        		tmp = Float64(2.0 * Float64(t_3 * sqrt(Float64(t_2 / t_3))));
                                                                        	end
                                                                        	return tmp
                                                                        end
                                                                        
                                                                        function tmp_2 = code(x, y, z)
                                                                        	t_0 = min(min(x, y), z);
                                                                        	t_1 = max(min(x, y), z);
                                                                        	t_2 = min(max(x, y), t_1);
                                                                        	t_3 = max(max(x, y), t_1);
                                                                        	tmp = 0.0;
                                                                        	if (t_2 <= -4.239319354108506e+22)
                                                                        		tmp = -2.0 * (t_0 * sqrt((t_2 / t_0)));
                                                                        	elseif (t_2 <= -2.0821119553426003e-307)
                                                                        		tmp = 2.0 * sqrt((t_0 * (t_2 + t_3)));
                                                                        	elseif (t_2 <= 1.048916818449786e+22)
                                                                        		tmp = 2.0 * sqrt((t_3 * (t_0 + t_2)));
                                                                        	else
                                                                        		tmp = 2.0 * (t_3 * sqrt((t_2 / t_3)));
                                                                        	end
                                                                        	tmp_2 = tmp;
                                                                        end
                                                                        
                                                                        code[x_, y_, z_] := Block[{t$95$0 = N[Min[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, If[LessEqual[t$95$2, -4.239319354108506e+22], N[(-2.0 * N[(t$95$0 * N[Sqrt[N[(t$95$2 / t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2.0821119553426003e-307], N[(2.0 * N[Sqrt[N[(t$95$0 * N[(t$95$2 + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1.048916818449786e+22], N[(2.0 * N[Sqrt[N[(t$95$3 * N[(t$95$0 + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$3 * N[Sqrt[N[(t$95$2 / t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
                                                                        
                                                                        f(x, y, z):
                                                                        	x in [-inf, +inf],
                                                                        	y in [-inf, +inf],
                                                                        	z in [-inf, +inf]
                                                                        code: THEORY
                                                                        BEGIN
                                                                        f(x, y, z: real): real =
                                                                        	LET tmp_2 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                        	LET tmp_3 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                        	LET tmp_1 = IF (tmp_2 < z) THEN tmp_3 ELSE z ENDIF IN
                                                                        	LET t_0 = tmp_1 IN
                                                                        		LET tmp_6 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                        		LET tmp_7 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                        		LET tmp_5 = IF (tmp_6 > z) THEN tmp_7 ELSE z ENDIF IN
                                                                        		LET t_1 = tmp_5 IN
                                                                        			LET tmp_10 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                        			LET tmp_11 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                        			LET tmp_9 = IF (tmp_10 < t_1) THEN tmp_11 ELSE t_1 ENDIF IN
                                                                        			LET t_2 = tmp_9 IN
                                                                        				LET tmp_14 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                        				LET tmp_15 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                        				LET tmp_13 = IF (tmp_14 > t_1) THEN tmp_15 ELSE t_1 ENDIF IN
                                                                        				LET t_3 = tmp_13 IN
                                                                        					LET tmp_18 = IF (t_2 <= (10489168184497861033984)) THEN ((2) * (sqrt((t_3 * (t_0 + t_2))))) ELSE ((2) * (t_3 * (sqrt((t_2 / t_3))))) ENDIF IN
                                                                        					LET tmp_17 = IF (t_2 <= (-20821119553426002996347196025835561405697388316458785341201450968945481337899787060796348824120331353716831384653559042802444302870388592096072855535603447317557718459616853259036799654135211449890320111830447389091546692768151236822209289170550596893643694413771911601967028135087778619056808672744571706375809831044721854351011064522583608860826505495103951456489907897832350584149531818016471179631461411340733316020548517331064350679128700240284622363133223411595889728810283440094047708382451353374854177713818705066625558097641844158456743352244625319670852416002805273539681595064610839178578219790827007709304063359587392669722010972310253657209587854495895223801308770056296081482026360902481756205365894494768524113081920035028815618716180324554443359375e-1070)) THEN ((2) * (sqrt((t_0 * (t_2 + t_3))))) ELSE tmp_18 ENDIF IN
                                                                        					LET tmp_16 = IF (t_2 <= (-42393193541085056466944)) THEN ((-2) * (t_0 * (sqrt((t_2 / t_0))))) ELSE tmp_17 ENDIF IN
                                                                        	tmp_16
                                                                        END code
                                                                        \begin{array}{l}
                                                                        t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\
                                                                        t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\
                                                                        t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
                                                                        t_3 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
                                                                        \mathbf{if}\;t\_2 \leq -4.239319354108506 \cdot 10^{+22}:\\
                                                                        \;\;\;\;-2 \cdot \left(t\_0 \cdot \sqrt{\frac{t\_2}{t\_0}}\right)\\
                                                                        
                                                                        \mathbf{elif}\;t\_2 \leq -2.0821119553426003 \cdot 10^{-307}:\\
                                                                        \;\;\;\;2 \cdot \sqrt{t\_0 \cdot \left(t\_2 + t\_3\right)}\\
                                                                        
                                                                        \mathbf{elif}\;t\_2 \leq 1.048916818449786 \cdot 10^{+22}:\\
                                                                        \;\;\;\;2 \cdot \sqrt{t\_3 \cdot \left(t\_0 + t\_2\right)}\\
                                                                        
                                                                        \mathbf{else}:\\
                                                                        \;\;\;\;2 \cdot \left(t\_3 \cdot \sqrt{\frac{t\_2}{t\_3}}\right)\\
                                                                        
                                                                        
                                                                        \end{array}
                                                                        
                                                                        Derivation
                                                                        1. Split input into 4 regimes
                                                                        2. if y < -4.2393193541085056e22

                                                                          1. Initial program 70.2%

                                                                            \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                          2. Taylor expanded in x around -inf

                                                                            \[\leadsto -2 \cdot \left(x \cdot \sqrt{-1 \cdot \frac{-1 \cdot y + -1 \cdot z}{x}}\right) \]
                                                                          3. Step-by-step derivation
                                                                            1. Applied rewrites29.9%

                                                                              \[\leadsto -2 \cdot \left(x \cdot \sqrt{-1 \cdot \frac{\mathsf{fma}\left(-1, y, -1 \cdot z\right)}{x}}\right) \]
                                                                            2. Taylor expanded in z around 0

                                                                              \[\leadsto -2 \cdot \left(x \cdot \sqrt{\frac{y}{x}}\right) \]
                                                                            3. Step-by-step derivation
                                                                              1. Applied rewrites15.4%

                                                                                \[\leadsto -2 \cdot \left(x \cdot \sqrt{\frac{y}{x}}\right) \]

                                                                              if -4.2393193541085056e22 < y < -2.0821119553426003e-307

                                                                              1. Initial program 70.2%

                                                                                \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                              2. Taylor expanded in x around 0

                                                                                \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                                                              3. Step-by-step derivation
                                                                                1. Applied rewrites24.5%

                                                                                  \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                                                                2. Taylor expanded in x around inf

                                                                                  \[\leadsto 2 \cdot \sqrt{x \cdot \left(y + z\right)} \]
                                                                                3. Step-by-step derivation
                                                                                  1. Applied rewrites47.7%

                                                                                    \[\leadsto 2 \cdot \sqrt{x \cdot \left(y + z\right)} \]

                                                                                  if -2.0821119553426003e-307 < y < 1.0489168184497861e22

                                                                                  1. Initial program 70.2%

                                                                                    \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                  2. Taylor expanded in z around inf

                                                                                    \[\leadsto 2 \cdot \sqrt{z \cdot \left(x + y\right)} \]
                                                                                  3. Step-by-step derivation
                                                                                    1. Applied rewrites47.5%

                                                                                      \[\leadsto 2 \cdot \sqrt{z \cdot \left(x + y\right)} \]

                                                                                    if 1.0489168184497861e22 < y

                                                                                    1. Initial program 70.2%

                                                                                      \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                    2. Taylor expanded in z around inf

                                                                                      \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{x + y}{z}}\right) \]
                                                                                    3. Step-by-step derivation
                                                                                      1. Applied rewrites30.6%

                                                                                        \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{x + y}{z}}\right) \]
                                                                                      2. Taylor expanded in x around 0

                                                                                        \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{y}{z}}\right) \]
                                                                                      3. Step-by-step derivation
                                                                                        1. Applied rewrites15.6%

                                                                                          \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{y}{z}}\right) \]
                                                                                      4. Recombined 4 regimes into one program.
                                                                                      5. Add Preprocessing

                                                                                      Alternative 6: 96.3% accurate, 0.2× speedup?

                                                                                      \[\begin{array}{l} t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ t_3 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ \mathbf{if}\;t\_2 \leq -4.239319354108506 \cdot 10^{+22}:\\ \;\;\;\;-2 \cdot \left(t\_0 \cdot \sqrt{\frac{t\_2}{t\_0}}\right)\\ \mathbf{elif}\;t\_2 \leq -2.0821119553426003 \cdot 10^{-307}:\\ \;\;\;\;2 \cdot \sqrt{t\_0 \cdot \left(t\_2 + t\_3\right)}\\ \mathbf{elif}\;t\_2 \leq 8.50636575992331 \cdot 10^{+21}:\\ \;\;\;\;2 \cdot \sqrt{t\_3 \cdot \left(t\_0 + t\_2\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t\_2 \cdot \sqrt{\frac{t\_3}{t\_2}}\right)\\ \end{array} \]
                                                                                      (FPCore (x y z)
                                                                                        :precision binary64
                                                                                        :pre TRUE
                                                                                        (let* ((t_0 (fmin (fmin x y) z))
                                                                                             (t_1 (fmax (fmin x y) z))
                                                                                             (t_2 (fmin (fmax x y) t_1))
                                                                                             (t_3 (fmax (fmax x y) t_1)))
                                                                                        (if (<= t_2 -4.239319354108506e+22)
                                                                                          (* -2.0 (* t_0 (sqrt (/ t_2 t_0))))
                                                                                          (if (<= t_2 -2.0821119553426003e-307)
                                                                                            (* 2.0 (sqrt (* t_0 (+ t_2 t_3))))
                                                                                            (if (<= t_2 8.50636575992331e+21)
                                                                                              (* 2.0 (sqrt (* t_3 (+ t_0 t_2))))
                                                                                              (* 2.0 (* t_2 (sqrt (/ t_3 t_2)))))))))
                                                                                      double code(double x, double y, double z) {
                                                                                      	double t_0 = fmin(fmin(x, y), z);
                                                                                      	double t_1 = fmax(fmin(x, y), z);
                                                                                      	double t_2 = fmin(fmax(x, y), t_1);
                                                                                      	double t_3 = fmax(fmax(x, y), t_1);
                                                                                      	double tmp;
                                                                                      	if (t_2 <= -4.239319354108506e+22) {
                                                                                      		tmp = -2.0 * (t_0 * sqrt((t_2 / t_0)));
                                                                                      	} else if (t_2 <= -2.0821119553426003e-307) {
                                                                                      		tmp = 2.0 * sqrt((t_0 * (t_2 + t_3)));
                                                                                      	} else if (t_2 <= 8.50636575992331e+21) {
                                                                                      		tmp = 2.0 * sqrt((t_3 * (t_0 + t_2)));
                                                                                      	} else {
                                                                                      		tmp = 2.0 * (t_2 * sqrt((t_3 / t_2)));
                                                                                      	}
                                                                                      	return tmp;
                                                                                      }
                                                                                      
                                                                                      real(8) function code(x, y, z)
                                                                                      use fmin_fmax_functions
                                                                                          real(8), intent (in) :: x
                                                                                          real(8), intent (in) :: y
                                                                                          real(8), intent (in) :: z
                                                                                          real(8) :: t_0
                                                                                          real(8) :: t_1
                                                                                          real(8) :: t_2
                                                                                          real(8) :: t_3
                                                                                          real(8) :: tmp
                                                                                          t_0 = fmin(fmin(x, y), z)
                                                                                          t_1 = fmax(fmin(x, y), z)
                                                                                          t_2 = fmin(fmax(x, y), t_1)
                                                                                          t_3 = fmax(fmax(x, y), t_1)
                                                                                          if (t_2 <= (-4.239319354108506d+22)) then
                                                                                              tmp = (-2.0d0) * (t_0 * sqrt((t_2 / t_0)))
                                                                                          else if (t_2 <= (-2.0821119553426003d-307)) then
                                                                                              tmp = 2.0d0 * sqrt((t_0 * (t_2 + t_3)))
                                                                                          else if (t_2 <= 8.50636575992331d+21) then
                                                                                              tmp = 2.0d0 * sqrt((t_3 * (t_0 + t_2)))
                                                                                          else
                                                                                              tmp = 2.0d0 * (t_2 * sqrt((t_3 / t_2)))
                                                                                          end if
                                                                                          code = tmp
                                                                                      end function
                                                                                      
                                                                                      public static double code(double x, double y, double z) {
                                                                                      	double t_0 = fmin(fmin(x, y), z);
                                                                                      	double t_1 = fmax(fmin(x, y), z);
                                                                                      	double t_2 = fmin(fmax(x, y), t_1);
                                                                                      	double t_3 = fmax(fmax(x, y), t_1);
                                                                                      	double tmp;
                                                                                      	if (t_2 <= -4.239319354108506e+22) {
                                                                                      		tmp = -2.0 * (t_0 * Math.sqrt((t_2 / t_0)));
                                                                                      	} else if (t_2 <= -2.0821119553426003e-307) {
                                                                                      		tmp = 2.0 * Math.sqrt((t_0 * (t_2 + t_3)));
                                                                                      	} else if (t_2 <= 8.50636575992331e+21) {
                                                                                      		tmp = 2.0 * Math.sqrt((t_3 * (t_0 + t_2)));
                                                                                      	} else {
                                                                                      		tmp = 2.0 * (t_2 * Math.sqrt((t_3 / t_2)));
                                                                                      	}
                                                                                      	return tmp;
                                                                                      }
                                                                                      
                                                                                      def code(x, y, z):
                                                                                      	t_0 = fmin(fmin(x, y), z)
                                                                                      	t_1 = fmax(fmin(x, y), z)
                                                                                      	t_2 = fmin(fmax(x, y), t_1)
                                                                                      	t_3 = fmax(fmax(x, y), t_1)
                                                                                      	tmp = 0
                                                                                      	if t_2 <= -4.239319354108506e+22:
                                                                                      		tmp = -2.0 * (t_0 * math.sqrt((t_2 / t_0)))
                                                                                      	elif t_2 <= -2.0821119553426003e-307:
                                                                                      		tmp = 2.0 * math.sqrt((t_0 * (t_2 + t_3)))
                                                                                      	elif t_2 <= 8.50636575992331e+21:
                                                                                      		tmp = 2.0 * math.sqrt((t_3 * (t_0 + t_2)))
                                                                                      	else:
                                                                                      		tmp = 2.0 * (t_2 * math.sqrt((t_3 / t_2)))
                                                                                      	return tmp
                                                                                      
                                                                                      function code(x, y, z)
                                                                                      	t_0 = fmin(fmin(x, y), z)
                                                                                      	t_1 = fmax(fmin(x, y), z)
                                                                                      	t_2 = fmin(fmax(x, y), t_1)
                                                                                      	t_3 = fmax(fmax(x, y), t_1)
                                                                                      	tmp = 0.0
                                                                                      	if (t_2 <= -4.239319354108506e+22)
                                                                                      		tmp = Float64(-2.0 * Float64(t_0 * sqrt(Float64(t_2 / t_0))));
                                                                                      	elseif (t_2 <= -2.0821119553426003e-307)
                                                                                      		tmp = Float64(2.0 * sqrt(Float64(t_0 * Float64(t_2 + t_3))));
                                                                                      	elseif (t_2 <= 8.50636575992331e+21)
                                                                                      		tmp = Float64(2.0 * sqrt(Float64(t_3 * Float64(t_0 + t_2))));
                                                                                      	else
                                                                                      		tmp = Float64(2.0 * Float64(t_2 * sqrt(Float64(t_3 / t_2))));
                                                                                      	end
                                                                                      	return tmp
                                                                                      end
                                                                                      
                                                                                      function tmp_2 = code(x, y, z)
                                                                                      	t_0 = min(min(x, y), z);
                                                                                      	t_1 = max(min(x, y), z);
                                                                                      	t_2 = min(max(x, y), t_1);
                                                                                      	t_3 = max(max(x, y), t_1);
                                                                                      	tmp = 0.0;
                                                                                      	if (t_2 <= -4.239319354108506e+22)
                                                                                      		tmp = -2.0 * (t_0 * sqrt((t_2 / t_0)));
                                                                                      	elseif (t_2 <= -2.0821119553426003e-307)
                                                                                      		tmp = 2.0 * sqrt((t_0 * (t_2 + t_3)));
                                                                                      	elseif (t_2 <= 8.50636575992331e+21)
                                                                                      		tmp = 2.0 * sqrt((t_3 * (t_0 + t_2)));
                                                                                      	else
                                                                                      		tmp = 2.0 * (t_2 * sqrt((t_3 / t_2)));
                                                                                      	end
                                                                                      	tmp_2 = tmp;
                                                                                      end
                                                                                      
                                                                                      code[x_, y_, z_] := Block[{t$95$0 = N[Min[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, If[LessEqual[t$95$2, -4.239319354108506e+22], N[(-2.0 * N[(t$95$0 * N[Sqrt[N[(t$95$2 / t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2.0821119553426003e-307], N[(2.0 * N[Sqrt[N[(t$95$0 * N[(t$95$2 + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 8.50636575992331e+21], N[(2.0 * N[Sqrt[N[(t$95$3 * N[(t$95$0 + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$2 * N[Sqrt[N[(t$95$3 / t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
                                                                                      
                                                                                      f(x, y, z):
                                                                                      	x in [-inf, +inf],
                                                                                      	y in [-inf, +inf],
                                                                                      	z in [-inf, +inf]
                                                                                      code: THEORY
                                                                                      BEGIN
                                                                                      f(x, y, z: real): real =
                                                                                      	LET tmp_2 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                      	LET tmp_3 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                      	LET tmp_1 = IF (tmp_2 < z) THEN tmp_3 ELSE z ENDIF IN
                                                                                      	LET t_0 = tmp_1 IN
                                                                                      		LET tmp_6 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                      		LET tmp_7 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                      		LET tmp_5 = IF (tmp_6 > z) THEN tmp_7 ELSE z ENDIF IN
                                                                                      		LET t_1 = tmp_5 IN
                                                                                      			LET tmp_10 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                      			LET tmp_11 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                      			LET tmp_9 = IF (tmp_10 < t_1) THEN tmp_11 ELSE t_1 ENDIF IN
                                                                                      			LET t_2 = tmp_9 IN
                                                                                      				LET tmp_14 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                      				LET tmp_15 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                      				LET tmp_13 = IF (tmp_14 > t_1) THEN tmp_15 ELSE t_1 ENDIF IN
                                                                                      				LET t_3 = tmp_13 IN
                                                                                      					LET tmp_18 = IF (t_2 <= (8506365759923310034944)) THEN ((2) * (sqrt((t_3 * (t_0 + t_2))))) ELSE ((2) * (t_2 * (sqrt((t_3 / t_2))))) ENDIF IN
                                                                                      					LET tmp_17 = IF (t_2 <= (-20821119553426002996347196025835561405697388316458785341201450968945481337899787060796348824120331353716831384653559042802444302870388592096072855535603447317557718459616853259036799654135211449890320111830447389091546692768151236822209289170550596893643694413771911601967028135087778619056808672744571706375809831044721854351011064522583608860826505495103951456489907897832350584149531818016471179631461411340733316020548517331064350679128700240284622363133223411595889728810283440094047708382451353374854177713818705066625558097641844158456743352244625319670852416002805273539681595064610839178578219790827007709304063359587392669722010972310253657209587854495895223801308770056296081482026360902481756205365894494768524113081920035028815618716180324554443359375e-1070)) THEN ((2) * (sqrt((t_0 * (t_2 + t_3))))) ELSE tmp_18 ENDIF IN
                                                                                      					LET tmp_16 = IF (t_2 <= (-42393193541085056466944)) THEN ((-2) * (t_0 * (sqrt((t_2 / t_0))))) ELSE tmp_17 ENDIF IN
                                                                                      	tmp_16
                                                                                      END code
                                                                                      \begin{array}{l}
                                                                                      t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\
                                                                                      t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\
                                                                                      t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
                                                                                      t_3 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
                                                                                      \mathbf{if}\;t\_2 \leq -4.239319354108506 \cdot 10^{+22}:\\
                                                                                      \;\;\;\;-2 \cdot \left(t\_0 \cdot \sqrt{\frac{t\_2}{t\_0}}\right)\\
                                                                                      
                                                                                      \mathbf{elif}\;t\_2 \leq -2.0821119553426003 \cdot 10^{-307}:\\
                                                                                      \;\;\;\;2 \cdot \sqrt{t\_0 \cdot \left(t\_2 + t\_3\right)}\\
                                                                                      
                                                                                      \mathbf{elif}\;t\_2 \leq 8.50636575992331 \cdot 10^{+21}:\\
                                                                                      \;\;\;\;2 \cdot \sqrt{t\_3 \cdot \left(t\_0 + t\_2\right)}\\
                                                                                      
                                                                                      \mathbf{else}:\\
                                                                                      \;\;\;\;2 \cdot \left(t\_2 \cdot \sqrt{\frac{t\_3}{t\_2}}\right)\\
                                                                                      
                                                                                      
                                                                                      \end{array}
                                                                                      
                                                                                      Derivation
                                                                                      1. Split input into 4 regimes
                                                                                      2. if y < -4.2393193541085056e22

                                                                                        1. Initial program 70.2%

                                                                                          \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                        2. Taylor expanded in x around -inf

                                                                                          \[\leadsto -2 \cdot \left(x \cdot \sqrt{-1 \cdot \frac{-1 \cdot y + -1 \cdot z}{x}}\right) \]
                                                                                        3. Step-by-step derivation
                                                                                          1. Applied rewrites29.9%

                                                                                            \[\leadsto -2 \cdot \left(x \cdot \sqrt{-1 \cdot \frac{\mathsf{fma}\left(-1, y, -1 \cdot z\right)}{x}}\right) \]
                                                                                          2. Taylor expanded in z around 0

                                                                                            \[\leadsto -2 \cdot \left(x \cdot \sqrt{\frac{y}{x}}\right) \]
                                                                                          3. Step-by-step derivation
                                                                                            1. Applied rewrites15.4%

                                                                                              \[\leadsto -2 \cdot \left(x \cdot \sqrt{\frac{y}{x}}\right) \]

                                                                                            if -4.2393193541085056e22 < y < -2.0821119553426003e-307

                                                                                            1. Initial program 70.2%

                                                                                              \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                            2. Taylor expanded in x around 0

                                                                                              \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                                                                            3. Step-by-step derivation
                                                                                              1. Applied rewrites24.5%

                                                                                                \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                                                                              2. Taylor expanded in x around inf

                                                                                                \[\leadsto 2 \cdot \sqrt{x \cdot \left(y + z\right)} \]
                                                                                              3. Step-by-step derivation
                                                                                                1. Applied rewrites47.7%

                                                                                                  \[\leadsto 2 \cdot \sqrt{x \cdot \left(y + z\right)} \]

                                                                                                if -2.0821119553426003e-307 < y < 8.50636575992331e21

                                                                                                1. Initial program 70.2%

                                                                                                  \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                                2. Taylor expanded in z around inf

                                                                                                  \[\leadsto 2 \cdot \sqrt{z \cdot \left(x + y\right)} \]
                                                                                                3. Step-by-step derivation
                                                                                                  1. Applied rewrites47.5%

                                                                                                    \[\leadsto 2 \cdot \sqrt{z \cdot \left(x + y\right)} \]

                                                                                                  if 8.50636575992331e21 < y

                                                                                                  1. Initial program 70.2%

                                                                                                    \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                                  2. Taylor expanded in y around inf

                                                                                                    \[\leadsto 2 \cdot \left(y \cdot \sqrt{\frac{x + z}{y}}\right) \]
                                                                                                  3. Step-by-step derivation
                                                                                                    1. Applied rewrites30.1%

                                                                                                      \[\leadsto 2 \cdot \left(y \cdot \sqrt{\frac{x + z}{y}}\right) \]
                                                                                                    2. Taylor expanded in x around 0

                                                                                                      \[\leadsto 2 \cdot \left(y \cdot \sqrt{\frac{z}{y}}\right) \]
                                                                                                    3. Step-by-step derivation
                                                                                                      1. Applied rewrites15.6%

                                                                                                        \[\leadsto 2 \cdot \left(y \cdot \sqrt{\frac{z}{y}}\right) \]
                                                                                                    4. Recombined 4 regimes into one program.
                                                                                                    5. Add Preprocessing

                                                                                                    Alternative 7: 94.7% accurate, 0.2× speedup?

                                                                                                    \[\begin{array}{l} t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ t_3 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ \mathbf{if}\;t\_2 \leq -209266119953830.34:\\ \;\;\;\;-2 \cdot \frac{t\_2}{\sqrt{\frac{t\_2}{t\_0}}}\\ \mathbf{elif}\;t\_2 \leq 4.70325674994519 \cdot 10^{-45}:\\ \;\;\;\;2 \cdot \sqrt{t\_2 \cdot \left(t\_0 + t\_3\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t\_3 \cdot \sqrt{\frac{t\_0 + t\_2}{t\_3}}\right)\\ \end{array} \]
                                                                                                    (FPCore (x y z)
                                                                                                      :precision binary64
                                                                                                      :pre TRUE
                                                                                                      (let* ((t_0 (fmin (fmin x y) z))
                                                                                                           (t_1 (fmax (fmin x y) z))
                                                                                                           (t_2 (fmin (fmax x y) t_1))
                                                                                                           (t_3 (fmax (fmax x y) t_1)))
                                                                                                      (if (<= t_2 -209266119953830.34)
                                                                                                        (* -2.0 (/ t_2 (sqrt (/ t_2 t_0))))
                                                                                                        (if (<= t_2 4.70325674994519e-45)
                                                                                                          (* 2.0 (sqrt (* t_2 (+ t_0 t_3))))
                                                                                                          (* 2.0 (* t_3 (sqrt (/ (+ t_0 t_2) t_3))))))))
                                                                                                    double code(double x, double y, double z) {
                                                                                                    	double t_0 = fmin(fmin(x, y), z);
                                                                                                    	double t_1 = fmax(fmin(x, y), z);
                                                                                                    	double t_2 = fmin(fmax(x, y), t_1);
                                                                                                    	double t_3 = fmax(fmax(x, y), t_1);
                                                                                                    	double tmp;
                                                                                                    	if (t_2 <= -209266119953830.34) {
                                                                                                    		tmp = -2.0 * (t_2 / sqrt((t_2 / t_0)));
                                                                                                    	} else if (t_2 <= 4.70325674994519e-45) {
                                                                                                    		tmp = 2.0 * sqrt((t_2 * (t_0 + t_3)));
                                                                                                    	} else {
                                                                                                    		tmp = 2.0 * (t_3 * sqrt(((t_0 + t_2) / t_3)));
                                                                                                    	}
                                                                                                    	return tmp;
                                                                                                    }
                                                                                                    
                                                                                                    real(8) function code(x, y, z)
                                                                                                    use fmin_fmax_functions
                                                                                                        real(8), intent (in) :: x
                                                                                                        real(8), intent (in) :: y
                                                                                                        real(8), intent (in) :: z
                                                                                                        real(8) :: t_0
                                                                                                        real(8) :: t_1
                                                                                                        real(8) :: t_2
                                                                                                        real(8) :: t_3
                                                                                                        real(8) :: tmp
                                                                                                        t_0 = fmin(fmin(x, y), z)
                                                                                                        t_1 = fmax(fmin(x, y), z)
                                                                                                        t_2 = fmin(fmax(x, y), t_1)
                                                                                                        t_3 = fmax(fmax(x, y), t_1)
                                                                                                        if (t_2 <= (-209266119953830.34d0)) then
                                                                                                            tmp = (-2.0d0) * (t_2 / sqrt((t_2 / t_0)))
                                                                                                        else if (t_2 <= 4.70325674994519d-45) then
                                                                                                            tmp = 2.0d0 * sqrt((t_2 * (t_0 + t_3)))
                                                                                                        else
                                                                                                            tmp = 2.0d0 * (t_3 * sqrt(((t_0 + t_2) / t_3)))
                                                                                                        end if
                                                                                                        code = tmp
                                                                                                    end function
                                                                                                    
                                                                                                    public static double code(double x, double y, double z) {
                                                                                                    	double t_0 = fmin(fmin(x, y), z);
                                                                                                    	double t_1 = fmax(fmin(x, y), z);
                                                                                                    	double t_2 = fmin(fmax(x, y), t_1);
                                                                                                    	double t_3 = fmax(fmax(x, y), t_1);
                                                                                                    	double tmp;
                                                                                                    	if (t_2 <= -209266119953830.34) {
                                                                                                    		tmp = -2.0 * (t_2 / Math.sqrt((t_2 / t_0)));
                                                                                                    	} else if (t_2 <= 4.70325674994519e-45) {
                                                                                                    		tmp = 2.0 * Math.sqrt((t_2 * (t_0 + t_3)));
                                                                                                    	} else {
                                                                                                    		tmp = 2.0 * (t_3 * Math.sqrt(((t_0 + t_2) / t_3)));
                                                                                                    	}
                                                                                                    	return tmp;
                                                                                                    }
                                                                                                    
                                                                                                    def code(x, y, z):
                                                                                                    	t_0 = fmin(fmin(x, y), z)
                                                                                                    	t_1 = fmax(fmin(x, y), z)
                                                                                                    	t_2 = fmin(fmax(x, y), t_1)
                                                                                                    	t_3 = fmax(fmax(x, y), t_1)
                                                                                                    	tmp = 0
                                                                                                    	if t_2 <= -209266119953830.34:
                                                                                                    		tmp = -2.0 * (t_2 / math.sqrt((t_2 / t_0)))
                                                                                                    	elif t_2 <= 4.70325674994519e-45:
                                                                                                    		tmp = 2.0 * math.sqrt((t_2 * (t_0 + t_3)))
                                                                                                    	else:
                                                                                                    		tmp = 2.0 * (t_3 * math.sqrt(((t_0 + t_2) / t_3)))
                                                                                                    	return tmp
                                                                                                    
                                                                                                    function code(x, y, z)
                                                                                                    	t_0 = fmin(fmin(x, y), z)
                                                                                                    	t_1 = fmax(fmin(x, y), z)
                                                                                                    	t_2 = fmin(fmax(x, y), t_1)
                                                                                                    	t_3 = fmax(fmax(x, y), t_1)
                                                                                                    	tmp = 0.0
                                                                                                    	if (t_2 <= -209266119953830.34)
                                                                                                    		tmp = Float64(-2.0 * Float64(t_2 / sqrt(Float64(t_2 / t_0))));
                                                                                                    	elseif (t_2 <= 4.70325674994519e-45)
                                                                                                    		tmp = Float64(2.0 * sqrt(Float64(t_2 * Float64(t_0 + t_3))));
                                                                                                    	else
                                                                                                    		tmp = Float64(2.0 * Float64(t_3 * sqrt(Float64(Float64(t_0 + t_2) / t_3))));
                                                                                                    	end
                                                                                                    	return tmp
                                                                                                    end
                                                                                                    
                                                                                                    function tmp_2 = code(x, y, z)
                                                                                                    	t_0 = min(min(x, y), z);
                                                                                                    	t_1 = max(min(x, y), z);
                                                                                                    	t_2 = min(max(x, y), t_1);
                                                                                                    	t_3 = max(max(x, y), t_1);
                                                                                                    	tmp = 0.0;
                                                                                                    	if (t_2 <= -209266119953830.34)
                                                                                                    		tmp = -2.0 * (t_2 / sqrt((t_2 / t_0)));
                                                                                                    	elseif (t_2 <= 4.70325674994519e-45)
                                                                                                    		tmp = 2.0 * sqrt((t_2 * (t_0 + t_3)));
                                                                                                    	else
                                                                                                    		tmp = 2.0 * (t_3 * sqrt(((t_0 + t_2) / t_3)));
                                                                                                    	end
                                                                                                    	tmp_2 = tmp;
                                                                                                    end
                                                                                                    
                                                                                                    code[x_, y_, z_] := Block[{t$95$0 = N[Min[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, If[LessEqual[t$95$2, -209266119953830.34], N[(-2.0 * N[(t$95$2 / N[Sqrt[N[(t$95$2 / t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4.70325674994519e-45], N[(2.0 * N[Sqrt[N[(t$95$2 * N[(t$95$0 + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$3 * N[Sqrt[N[(N[(t$95$0 + t$95$2), $MachinePrecision] / t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
                                                                                                    
                                                                                                    f(x, y, z):
                                                                                                    	x in [-inf, +inf],
                                                                                                    	y in [-inf, +inf],
                                                                                                    	z in [-inf, +inf]
                                                                                                    code: THEORY
                                                                                                    BEGIN
                                                                                                    f(x, y, z: real): real =
                                                                                                    	LET tmp_2 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                    	LET tmp_3 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                    	LET tmp_1 = IF (tmp_2 < z) THEN tmp_3 ELSE z ENDIF IN
                                                                                                    	LET t_0 = tmp_1 IN
                                                                                                    		LET tmp_6 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                    		LET tmp_7 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                    		LET tmp_5 = IF (tmp_6 > z) THEN tmp_7 ELSE z ENDIF IN
                                                                                                    		LET t_1 = tmp_5 IN
                                                                                                    			LET tmp_10 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                    			LET tmp_11 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                    			LET tmp_9 = IF (tmp_10 < t_1) THEN tmp_11 ELSE t_1 ENDIF IN
                                                                                                    			LET t_2 = tmp_9 IN
                                                                                                    				LET tmp_14 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                    				LET tmp_15 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                    				LET tmp_13 = IF (tmp_14 > t_1) THEN tmp_15 ELSE t_1 ENDIF IN
                                                                                                    				LET t_3 = tmp_13 IN
                                                                                                    					LET tmp_17 = IF (t_2 <= (47032567499451896966770065570197330390239495806000378200405502854169807643298450069663922324136090924137243660389968991086817595714819617569446563720703125e-199)) THEN ((2) * (sqrt((t_2 * (t_0 + t_3))))) ELSE ((2) * (t_3 * (sqrt(((t_0 + t_2) / t_3))))) ENDIF IN
                                                                                                    					LET tmp_16 = IF (t_2 <= (-20926611995383034375e-5)) THEN ((-2) * (t_2 / (sqrt((t_2 / t_0))))) ELSE tmp_17 ENDIF IN
                                                                                                    	tmp_16
                                                                                                    END code
                                                                                                    \begin{array}{l}
                                                                                                    t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\
                                                                                                    t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\
                                                                                                    t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
                                                                                                    t_3 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
                                                                                                    \mathbf{if}\;t\_2 \leq -209266119953830.34:\\
                                                                                                    \;\;\;\;-2 \cdot \frac{t\_2}{\sqrt{\frac{t\_2}{t\_0}}}\\
                                                                                                    
                                                                                                    \mathbf{elif}\;t\_2 \leq 4.70325674994519 \cdot 10^{-45}:\\
                                                                                                    \;\;\;\;2 \cdot \sqrt{t\_2 \cdot \left(t\_0 + t\_3\right)}\\
                                                                                                    
                                                                                                    \mathbf{else}:\\
                                                                                                    \;\;\;\;2 \cdot \left(t\_3 \cdot \sqrt{\frac{t\_0 + t\_2}{t\_3}}\right)\\
                                                                                                    
                                                                                                    
                                                                                                    \end{array}
                                                                                                    
                                                                                                    Derivation
                                                                                                    1. Split input into 3 regimes
                                                                                                    2. if y < -209266119953830.34

                                                                                                      1. Initial program 70.2%

                                                                                                        \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                                      2. Taylor expanded in y around -inf

                                                                                                        \[\leadsto -2 \cdot \left(y \cdot \sqrt{-1 \cdot \frac{-1 \cdot x + -1 \cdot z}{y}}\right) \]
                                                                                                      3. Step-by-step derivation
                                                                                                        1. Applied rewrites29.2%

                                                                                                          \[\leadsto -2 \cdot \left(y \cdot \sqrt{-1 \cdot \frac{\mathsf{fma}\left(-1, x, -1 \cdot z\right)}{y}}\right) \]
                                                                                                        2. Taylor expanded in z around 0

                                                                                                          \[\leadsto -2 \cdot \left(y \cdot \sqrt{\frac{x}{y}}\right) \]
                                                                                                        3. Step-by-step derivation
                                                                                                          1. Applied rewrites15.4%

                                                                                                            \[\leadsto -2 \cdot \left(y \cdot \sqrt{\frac{x}{y}}\right) \]
                                                                                                          2. Step-by-step derivation
                                                                                                            1. Applied rewrites15.4%

                                                                                                              \[\leadsto -2 \cdot \left(y \cdot \frac{1}{\sqrt{\frac{y}{x}}}\right) \]
                                                                                                            2. Taylor expanded in x around inf

                                                                                                              \[\leadsto -2 \cdot \frac{y}{\sqrt{\frac{y}{x}}} \]
                                                                                                            3. Step-by-step derivation
                                                                                                              1. Applied rewrites15.4%

                                                                                                                \[\leadsto -2 \cdot \frac{y}{\sqrt{\frac{y}{x}}} \]

                                                                                                              if -209266119953830.34 < y < 4.7032567499451897e-45

                                                                                                              1. Initial program 70.2%

                                                                                                                \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                                              2. Taylor expanded in y around inf

                                                                                                                \[\leadsto 2 \cdot \sqrt{y \cdot \left(x + z\right)} \]
                                                                                                              3. Step-by-step derivation
                                                                                                                1. Applied rewrites46.8%

                                                                                                                  \[\leadsto 2 \cdot \sqrt{y \cdot \left(x + z\right)} \]

                                                                                                                if 4.7032567499451897e-45 < y

                                                                                                                1. Initial program 70.2%

                                                                                                                  \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                                                2. Taylor expanded in z around inf

                                                                                                                  \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{x + y}{z}}\right) \]
                                                                                                                3. Step-by-step derivation
                                                                                                                  1. Applied rewrites30.6%

                                                                                                                    \[\leadsto 2 \cdot \left(z \cdot \sqrt{\frac{x + y}{z}}\right) \]
                                                                                                                4. Recombined 3 regimes into one program.
                                                                                                                5. Add Preprocessing

                                                                                                                Alternative 8: 83.3% accurate, 0.3× speedup?

                                                                                                                \[\begin{array}{l} t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ t_3 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ \mathbf{if}\;t\_2 \leq -4.239319354108506 \cdot 10^{+22}:\\ \;\;\;\;-2 \cdot \left(t\_0 \cdot \sqrt{\frac{t\_2}{t\_0}}\right)\\ \mathbf{elif}\;t\_2 \leq -2.0821119553426003 \cdot 10^{-307}:\\ \;\;\;\;2 \cdot \sqrt{t\_0 \cdot \left(t\_2 + t\_3\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \sqrt{t\_3 \cdot \left(t\_0 + t\_2\right)}\\ \end{array} \]
                                                                                                                (FPCore (x y z)
                                                                                                                  :precision binary64
                                                                                                                  :pre TRUE
                                                                                                                  (let* ((t_0 (fmin (fmin x y) z))
                                                                                                                       (t_1 (fmax (fmin x y) z))
                                                                                                                       (t_2 (fmin (fmax x y) t_1))
                                                                                                                       (t_3 (fmax (fmax x y) t_1)))
                                                                                                                  (if (<= t_2 -4.239319354108506e+22)
                                                                                                                    (* -2.0 (* t_0 (sqrt (/ t_2 t_0))))
                                                                                                                    (if (<= t_2 -2.0821119553426003e-307)
                                                                                                                      (* 2.0 (sqrt (* t_0 (+ t_2 t_3))))
                                                                                                                      (* 2.0 (sqrt (* t_3 (+ t_0 t_2))))))))
                                                                                                                double code(double x, double y, double z) {
                                                                                                                	double t_0 = fmin(fmin(x, y), z);
                                                                                                                	double t_1 = fmax(fmin(x, y), z);
                                                                                                                	double t_2 = fmin(fmax(x, y), t_1);
                                                                                                                	double t_3 = fmax(fmax(x, y), t_1);
                                                                                                                	double tmp;
                                                                                                                	if (t_2 <= -4.239319354108506e+22) {
                                                                                                                		tmp = -2.0 * (t_0 * sqrt((t_2 / t_0)));
                                                                                                                	} else if (t_2 <= -2.0821119553426003e-307) {
                                                                                                                		tmp = 2.0 * sqrt((t_0 * (t_2 + t_3)));
                                                                                                                	} else {
                                                                                                                		tmp = 2.0 * sqrt((t_3 * (t_0 + t_2)));
                                                                                                                	}
                                                                                                                	return tmp;
                                                                                                                }
                                                                                                                
                                                                                                                real(8) function code(x, y, z)
                                                                                                                use fmin_fmax_functions
                                                                                                                    real(8), intent (in) :: x
                                                                                                                    real(8), intent (in) :: y
                                                                                                                    real(8), intent (in) :: z
                                                                                                                    real(8) :: t_0
                                                                                                                    real(8) :: t_1
                                                                                                                    real(8) :: t_2
                                                                                                                    real(8) :: t_3
                                                                                                                    real(8) :: tmp
                                                                                                                    t_0 = fmin(fmin(x, y), z)
                                                                                                                    t_1 = fmax(fmin(x, y), z)
                                                                                                                    t_2 = fmin(fmax(x, y), t_1)
                                                                                                                    t_3 = fmax(fmax(x, y), t_1)
                                                                                                                    if (t_2 <= (-4.239319354108506d+22)) then
                                                                                                                        tmp = (-2.0d0) * (t_0 * sqrt((t_2 / t_0)))
                                                                                                                    else if (t_2 <= (-2.0821119553426003d-307)) then
                                                                                                                        tmp = 2.0d0 * sqrt((t_0 * (t_2 + t_3)))
                                                                                                                    else
                                                                                                                        tmp = 2.0d0 * sqrt((t_3 * (t_0 + t_2)))
                                                                                                                    end if
                                                                                                                    code = tmp
                                                                                                                end function
                                                                                                                
                                                                                                                public static double code(double x, double y, double z) {
                                                                                                                	double t_0 = fmin(fmin(x, y), z);
                                                                                                                	double t_1 = fmax(fmin(x, y), z);
                                                                                                                	double t_2 = fmin(fmax(x, y), t_1);
                                                                                                                	double t_3 = fmax(fmax(x, y), t_1);
                                                                                                                	double tmp;
                                                                                                                	if (t_2 <= -4.239319354108506e+22) {
                                                                                                                		tmp = -2.0 * (t_0 * Math.sqrt((t_2 / t_0)));
                                                                                                                	} else if (t_2 <= -2.0821119553426003e-307) {
                                                                                                                		tmp = 2.0 * Math.sqrt((t_0 * (t_2 + t_3)));
                                                                                                                	} else {
                                                                                                                		tmp = 2.0 * Math.sqrt((t_3 * (t_0 + t_2)));
                                                                                                                	}
                                                                                                                	return tmp;
                                                                                                                }
                                                                                                                
                                                                                                                def code(x, y, z):
                                                                                                                	t_0 = fmin(fmin(x, y), z)
                                                                                                                	t_1 = fmax(fmin(x, y), z)
                                                                                                                	t_2 = fmin(fmax(x, y), t_1)
                                                                                                                	t_3 = fmax(fmax(x, y), t_1)
                                                                                                                	tmp = 0
                                                                                                                	if t_2 <= -4.239319354108506e+22:
                                                                                                                		tmp = -2.0 * (t_0 * math.sqrt((t_2 / t_0)))
                                                                                                                	elif t_2 <= -2.0821119553426003e-307:
                                                                                                                		tmp = 2.0 * math.sqrt((t_0 * (t_2 + t_3)))
                                                                                                                	else:
                                                                                                                		tmp = 2.0 * math.sqrt((t_3 * (t_0 + t_2)))
                                                                                                                	return tmp
                                                                                                                
                                                                                                                function code(x, y, z)
                                                                                                                	t_0 = fmin(fmin(x, y), z)
                                                                                                                	t_1 = fmax(fmin(x, y), z)
                                                                                                                	t_2 = fmin(fmax(x, y), t_1)
                                                                                                                	t_3 = fmax(fmax(x, y), t_1)
                                                                                                                	tmp = 0.0
                                                                                                                	if (t_2 <= -4.239319354108506e+22)
                                                                                                                		tmp = Float64(-2.0 * Float64(t_0 * sqrt(Float64(t_2 / t_0))));
                                                                                                                	elseif (t_2 <= -2.0821119553426003e-307)
                                                                                                                		tmp = Float64(2.0 * sqrt(Float64(t_0 * Float64(t_2 + t_3))));
                                                                                                                	else
                                                                                                                		tmp = Float64(2.0 * sqrt(Float64(t_3 * Float64(t_0 + t_2))));
                                                                                                                	end
                                                                                                                	return tmp
                                                                                                                end
                                                                                                                
                                                                                                                function tmp_2 = code(x, y, z)
                                                                                                                	t_0 = min(min(x, y), z);
                                                                                                                	t_1 = max(min(x, y), z);
                                                                                                                	t_2 = min(max(x, y), t_1);
                                                                                                                	t_3 = max(max(x, y), t_1);
                                                                                                                	tmp = 0.0;
                                                                                                                	if (t_2 <= -4.239319354108506e+22)
                                                                                                                		tmp = -2.0 * (t_0 * sqrt((t_2 / t_0)));
                                                                                                                	elseif (t_2 <= -2.0821119553426003e-307)
                                                                                                                		tmp = 2.0 * sqrt((t_0 * (t_2 + t_3)));
                                                                                                                	else
                                                                                                                		tmp = 2.0 * sqrt((t_3 * (t_0 + t_2)));
                                                                                                                	end
                                                                                                                	tmp_2 = tmp;
                                                                                                                end
                                                                                                                
                                                                                                                code[x_, y_, z_] := Block[{t$95$0 = N[Min[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, If[LessEqual[t$95$2, -4.239319354108506e+22], N[(-2.0 * N[(t$95$0 * N[Sqrt[N[(t$95$2 / t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2.0821119553426003e-307], N[(2.0 * N[Sqrt[N[(t$95$0 * N[(t$95$2 + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[Sqrt[N[(t$95$3 * N[(t$95$0 + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
                                                                                                                
                                                                                                                f(x, y, z):
                                                                                                                	x in [-inf, +inf],
                                                                                                                	y in [-inf, +inf],
                                                                                                                	z in [-inf, +inf]
                                                                                                                code: THEORY
                                                                                                                BEGIN
                                                                                                                f(x, y, z: real): real =
                                                                                                                	LET tmp_2 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                	LET tmp_3 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                	LET tmp_1 = IF (tmp_2 < z) THEN tmp_3 ELSE z ENDIF IN
                                                                                                                	LET t_0 = tmp_1 IN
                                                                                                                		LET tmp_6 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                		LET tmp_7 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                		LET tmp_5 = IF (tmp_6 > z) THEN tmp_7 ELSE z ENDIF IN
                                                                                                                		LET t_1 = tmp_5 IN
                                                                                                                			LET tmp_10 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                			LET tmp_11 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                			LET tmp_9 = IF (tmp_10 < t_1) THEN tmp_11 ELSE t_1 ENDIF IN
                                                                                                                			LET t_2 = tmp_9 IN
                                                                                                                				LET tmp_14 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                				LET tmp_15 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                				LET tmp_13 = IF (tmp_14 > t_1) THEN tmp_15 ELSE t_1 ENDIF IN
                                                                                                                				LET t_3 = tmp_13 IN
                                                                                                                					LET tmp_17 = IF (t_2 <= (-20821119553426002996347196025835561405697388316458785341201450968945481337899787060796348824120331353716831384653559042802444302870388592096072855535603447317557718459616853259036799654135211449890320111830447389091546692768151236822209289170550596893643694413771911601967028135087778619056808672744571706375809831044721854351011064522583608860826505495103951456489907897832350584149531818016471179631461411340733316020548517331064350679128700240284622363133223411595889728810283440094047708382451353374854177713818705066625558097641844158456743352244625319670852416002805273539681595064610839178578219790827007709304063359587392669722010972310253657209587854495895223801308770056296081482026360902481756205365894494768524113081920035028815618716180324554443359375e-1070)) THEN ((2) * (sqrt((t_0 * (t_2 + t_3))))) ELSE ((2) * (sqrt((t_3 * (t_0 + t_2))))) ENDIF IN
                                                                                                                					LET tmp_16 = IF (t_2 <= (-42393193541085056466944)) THEN ((-2) * (t_0 * (sqrt((t_2 / t_0))))) ELSE tmp_17 ENDIF IN
                                                                                                                	tmp_16
                                                                                                                END code
                                                                                                                \begin{array}{l}
                                                                                                                t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\
                                                                                                                t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\
                                                                                                                t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
                                                                                                                t_3 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
                                                                                                                \mathbf{if}\;t\_2 \leq -4.239319354108506 \cdot 10^{+22}:\\
                                                                                                                \;\;\;\;-2 \cdot \left(t\_0 \cdot \sqrt{\frac{t\_2}{t\_0}}\right)\\
                                                                                                                
                                                                                                                \mathbf{elif}\;t\_2 \leq -2.0821119553426003 \cdot 10^{-307}:\\
                                                                                                                \;\;\;\;2 \cdot \sqrt{t\_0 \cdot \left(t\_2 + t\_3\right)}\\
                                                                                                                
                                                                                                                \mathbf{else}:\\
                                                                                                                \;\;\;\;2 \cdot \sqrt{t\_3 \cdot \left(t\_0 + t\_2\right)}\\
                                                                                                                
                                                                                                                
                                                                                                                \end{array}
                                                                                                                
                                                                                                                Derivation
                                                                                                                1. Split input into 3 regimes
                                                                                                                2. if y < -4.2393193541085056e22

                                                                                                                  1. Initial program 70.2%

                                                                                                                    \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                                                  2. Taylor expanded in x around -inf

                                                                                                                    \[\leadsto -2 \cdot \left(x \cdot \sqrt{-1 \cdot \frac{-1 \cdot y + -1 \cdot z}{x}}\right) \]
                                                                                                                  3. Step-by-step derivation
                                                                                                                    1. Applied rewrites29.9%

                                                                                                                      \[\leadsto -2 \cdot \left(x \cdot \sqrt{-1 \cdot \frac{\mathsf{fma}\left(-1, y, -1 \cdot z\right)}{x}}\right) \]
                                                                                                                    2. Taylor expanded in z around 0

                                                                                                                      \[\leadsto -2 \cdot \left(x \cdot \sqrt{\frac{y}{x}}\right) \]
                                                                                                                    3. Step-by-step derivation
                                                                                                                      1. Applied rewrites15.4%

                                                                                                                        \[\leadsto -2 \cdot \left(x \cdot \sqrt{\frac{y}{x}}\right) \]

                                                                                                                      if -4.2393193541085056e22 < y < -2.0821119553426003e-307

                                                                                                                      1. Initial program 70.2%

                                                                                                                        \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                                                      2. Taylor expanded in x around 0

                                                                                                                        \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                                                                                                      3. Step-by-step derivation
                                                                                                                        1. Applied rewrites24.5%

                                                                                                                          \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                                                                                                        2. Taylor expanded in x around inf

                                                                                                                          \[\leadsto 2 \cdot \sqrt{x \cdot \left(y + z\right)} \]
                                                                                                                        3. Step-by-step derivation
                                                                                                                          1. Applied rewrites47.7%

                                                                                                                            \[\leadsto 2 \cdot \sqrt{x \cdot \left(y + z\right)} \]

                                                                                                                          if -2.0821119553426003e-307 < y

                                                                                                                          1. Initial program 70.2%

                                                                                                                            \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                                                          2. Taylor expanded in z around inf

                                                                                                                            \[\leadsto 2 \cdot \sqrt{z \cdot \left(x + y\right)} \]
                                                                                                                          3. Step-by-step derivation
                                                                                                                            1. Applied rewrites47.5%

                                                                                                                              \[\leadsto 2 \cdot \sqrt{z \cdot \left(x + y\right)} \]
                                                                                                                          4. Recombined 3 regimes into one program.
                                                                                                                          5. Add Preprocessing

                                                                                                                          Alternative 9: 70.3% accurate, 0.4× speedup?

                                                                                                                          \[\begin{array}{l} t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_2 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ t_3 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\ \mathbf{if}\;t\_3 \leq -2.0821119553426003 \cdot 10^{-307}:\\ \;\;\;\;2 \cdot \sqrt{t\_0 \cdot \left(t\_3 + t\_2\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \sqrt{t\_2 \cdot \left(t\_0 + t\_3\right)}\\ \end{array} \]
                                                                                                                          (FPCore (x y z)
                                                                                                                            :precision binary64
                                                                                                                            :pre TRUE
                                                                                                                            (let* ((t_0 (fmin (fmin x y) z))
                                                                                                                                 (t_1 (fmax (fmin x y) z))
                                                                                                                                 (t_2 (fmax (fmax x y) t_1))
                                                                                                                                 (t_3 (fmin (fmax x y) t_1)))
                                                                                                                            (if (<= t_3 -2.0821119553426003e-307)
                                                                                                                              (* 2.0 (sqrt (* t_0 (+ t_3 t_2))))
                                                                                                                              (* 2.0 (sqrt (* t_2 (+ t_0 t_3)))))))
                                                                                                                          double code(double x, double y, double z) {
                                                                                                                          	double t_0 = fmin(fmin(x, y), z);
                                                                                                                          	double t_1 = fmax(fmin(x, y), z);
                                                                                                                          	double t_2 = fmax(fmax(x, y), t_1);
                                                                                                                          	double t_3 = fmin(fmax(x, y), t_1);
                                                                                                                          	double tmp;
                                                                                                                          	if (t_3 <= -2.0821119553426003e-307) {
                                                                                                                          		tmp = 2.0 * sqrt((t_0 * (t_3 + t_2)));
                                                                                                                          	} else {
                                                                                                                          		tmp = 2.0 * sqrt((t_2 * (t_0 + t_3)));
                                                                                                                          	}
                                                                                                                          	return tmp;
                                                                                                                          }
                                                                                                                          
                                                                                                                          real(8) function code(x, y, z)
                                                                                                                          use fmin_fmax_functions
                                                                                                                              real(8), intent (in) :: x
                                                                                                                              real(8), intent (in) :: y
                                                                                                                              real(8), intent (in) :: z
                                                                                                                              real(8) :: t_0
                                                                                                                              real(8) :: t_1
                                                                                                                              real(8) :: t_2
                                                                                                                              real(8) :: t_3
                                                                                                                              real(8) :: tmp
                                                                                                                              t_0 = fmin(fmin(x, y), z)
                                                                                                                              t_1 = fmax(fmin(x, y), z)
                                                                                                                              t_2 = fmax(fmax(x, y), t_1)
                                                                                                                              t_3 = fmin(fmax(x, y), t_1)
                                                                                                                              if (t_3 <= (-2.0821119553426003d-307)) then
                                                                                                                                  tmp = 2.0d0 * sqrt((t_0 * (t_3 + t_2)))
                                                                                                                              else
                                                                                                                                  tmp = 2.0d0 * sqrt((t_2 * (t_0 + t_3)))
                                                                                                                              end if
                                                                                                                              code = tmp
                                                                                                                          end function
                                                                                                                          
                                                                                                                          public static double code(double x, double y, double z) {
                                                                                                                          	double t_0 = fmin(fmin(x, y), z);
                                                                                                                          	double t_1 = fmax(fmin(x, y), z);
                                                                                                                          	double t_2 = fmax(fmax(x, y), t_1);
                                                                                                                          	double t_3 = fmin(fmax(x, y), t_1);
                                                                                                                          	double tmp;
                                                                                                                          	if (t_3 <= -2.0821119553426003e-307) {
                                                                                                                          		tmp = 2.0 * Math.sqrt((t_0 * (t_3 + t_2)));
                                                                                                                          	} else {
                                                                                                                          		tmp = 2.0 * Math.sqrt((t_2 * (t_0 + t_3)));
                                                                                                                          	}
                                                                                                                          	return tmp;
                                                                                                                          }
                                                                                                                          
                                                                                                                          def code(x, y, z):
                                                                                                                          	t_0 = fmin(fmin(x, y), z)
                                                                                                                          	t_1 = fmax(fmin(x, y), z)
                                                                                                                          	t_2 = fmax(fmax(x, y), t_1)
                                                                                                                          	t_3 = fmin(fmax(x, y), t_1)
                                                                                                                          	tmp = 0
                                                                                                                          	if t_3 <= -2.0821119553426003e-307:
                                                                                                                          		tmp = 2.0 * math.sqrt((t_0 * (t_3 + t_2)))
                                                                                                                          	else:
                                                                                                                          		tmp = 2.0 * math.sqrt((t_2 * (t_0 + t_3)))
                                                                                                                          	return tmp
                                                                                                                          
                                                                                                                          function code(x, y, z)
                                                                                                                          	t_0 = fmin(fmin(x, y), z)
                                                                                                                          	t_1 = fmax(fmin(x, y), z)
                                                                                                                          	t_2 = fmax(fmax(x, y), t_1)
                                                                                                                          	t_3 = fmin(fmax(x, y), t_1)
                                                                                                                          	tmp = 0.0
                                                                                                                          	if (t_3 <= -2.0821119553426003e-307)
                                                                                                                          		tmp = Float64(2.0 * sqrt(Float64(t_0 * Float64(t_3 + t_2))));
                                                                                                                          	else
                                                                                                                          		tmp = Float64(2.0 * sqrt(Float64(t_2 * Float64(t_0 + t_3))));
                                                                                                                          	end
                                                                                                                          	return tmp
                                                                                                                          end
                                                                                                                          
                                                                                                                          function tmp_2 = code(x, y, z)
                                                                                                                          	t_0 = min(min(x, y), z);
                                                                                                                          	t_1 = max(min(x, y), z);
                                                                                                                          	t_2 = max(max(x, y), t_1);
                                                                                                                          	t_3 = min(max(x, y), t_1);
                                                                                                                          	tmp = 0.0;
                                                                                                                          	if (t_3 <= -2.0821119553426003e-307)
                                                                                                                          		tmp = 2.0 * sqrt((t_0 * (t_3 + t_2)));
                                                                                                                          	else
                                                                                                                          		tmp = 2.0 * sqrt((t_2 * (t_0 + t_3)));
                                                                                                                          	end
                                                                                                                          	tmp_2 = tmp;
                                                                                                                          end
                                                                                                                          
                                                                                                                          code[x_, y_, z_] := Block[{t$95$0 = N[Min[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Min[N[Max[x, y], $MachinePrecision], t$95$1], $MachinePrecision]}, If[LessEqual[t$95$3, -2.0821119553426003e-307], N[(2.0 * N[Sqrt[N[(t$95$0 * N[(t$95$3 + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[Sqrt[N[(t$95$2 * N[(t$95$0 + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
                                                                                                                          
                                                                                                                          f(x, y, z):
                                                                                                                          	x in [-inf, +inf],
                                                                                                                          	y in [-inf, +inf],
                                                                                                                          	z in [-inf, +inf]
                                                                                                                          code: THEORY
                                                                                                                          BEGIN
                                                                                                                          f(x, y, z: real): real =
                                                                                                                          	LET tmp_2 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                          	LET tmp_3 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                          	LET tmp_1 = IF (tmp_2 < z) THEN tmp_3 ELSE z ENDIF IN
                                                                                                                          	LET t_0 = tmp_1 IN
                                                                                                                          		LET tmp_6 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                          		LET tmp_7 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                          		LET tmp_5 = IF (tmp_6 > z) THEN tmp_7 ELSE z ENDIF IN
                                                                                                                          		LET t_1 = tmp_5 IN
                                                                                                                          			LET tmp_10 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                          			LET tmp_11 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                          			LET tmp_9 = IF (tmp_10 > t_1) THEN tmp_11 ELSE t_1 ENDIF IN
                                                                                                                          			LET t_2 = tmp_9 IN
                                                                                                                          				LET tmp_14 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                          				LET tmp_15 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                          				LET tmp_13 = IF (tmp_14 < t_1) THEN tmp_15 ELSE t_1 ENDIF IN
                                                                                                                          				LET t_3 = tmp_13 IN
                                                                                                                          					LET tmp_16 = IF (t_3 <= (-20821119553426002996347196025835561405697388316458785341201450968945481337899787060796348824120331353716831384653559042802444302870388592096072855535603447317557718459616853259036799654135211449890320111830447389091546692768151236822209289170550596893643694413771911601967028135087778619056808672744571706375809831044721854351011064522583608860826505495103951456489907897832350584149531818016471179631461411340733316020548517331064350679128700240284622363133223411595889728810283440094047708382451353374854177713818705066625558097641844158456743352244625319670852416002805273539681595064610839178578219790827007709304063359587392669722010972310253657209587854495895223801308770056296081482026360902481756205365894494768524113081920035028815618716180324554443359375e-1070)) THEN ((2) * (sqrt((t_0 * (t_3 + t_2))))) ELSE ((2) * (sqrt((t_2 * (t_0 + t_3))))) ENDIF IN
                                                                                                                          	tmp_16
                                                                                                                          END code
                                                                                                                          \begin{array}{l}
                                                                                                                          t_0 := \mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right)\\
                                                                                                                          t_1 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\
                                                                                                                          t_2 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
                                                                                                                          t_3 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_1\right)\\
                                                                                                                          \mathbf{if}\;t\_3 \leq -2.0821119553426003 \cdot 10^{-307}:\\
                                                                                                                          \;\;\;\;2 \cdot \sqrt{t\_0 \cdot \left(t\_3 + t\_2\right)}\\
                                                                                                                          
                                                                                                                          \mathbf{else}:\\
                                                                                                                          \;\;\;\;2 \cdot \sqrt{t\_2 \cdot \left(t\_0 + t\_3\right)}\\
                                                                                                                          
                                                                                                                          
                                                                                                                          \end{array}
                                                                                                                          
                                                                                                                          Derivation
                                                                                                                          1. Split input into 2 regimes
                                                                                                                          2. if y < -2.0821119553426003e-307

                                                                                                                            1. Initial program 70.2%

                                                                                                                              \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                                                            2. Taylor expanded in x around 0

                                                                                                                              \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                                                                                                            3. Step-by-step derivation
                                                                                                                              1. Applied rewrites24.5%

                                                                                                                                \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                                                                                                              2. Taylor expanded in x around inf

                                                                                                                                \[\leadsto 2 \cdot \sqrt{x \cdot \left(y + z\right)} \]
                                                                                                                              3. Step-by-step derivation
                                                                                                                                1. Applied rewrites47.7%

                                                                                                                                  \[\leadsto 2 \cdot \sqrt{x \cdot \left(y + z\right)} \]

                                                                                                                                if -2.0821119553426003e-307 < y

                                                                                                                                1. Initial program 70.2%

                                                                                                                                  \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                                                                2. Taylor expanded in z around inf

                                                                                                                                  \[\leadsto 2 \cdot \sqrt{z \cdot \left(x + y\right)} \]
                                                                                                                                3. Step-by-step derivation
                                                                                                                                  1. Applied rewrites47.5%

                                                                                                                                    \[\leadsto 2 \cdot \sqrt{z \cdot \left(x + y\right)} \]
                                                                                                                                4. Recombined 2 regimes into one program.
                                                                                                                                5. Add Preprocessing

                                                                                                                                Alternative 10: 69.4% accurate, 0.4× speedup?

                                                                                                                                \[\begin{array}{l} t_0 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_1 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_0\right)\\ t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_0\right)\\ \mathbf{if}\;t\_2 \leq 1.4761403185952647 \cdot 10^{-282}:\\ \;\;\;\;2 \cdot \sqrt{\mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right) \cdot \left(t\_2 + t\_1\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \sqrt{t\_2 \cdot t\_1}\\ \end{array} \]
                                                                                                                                (FPCore (x y z)
                                                                                                                                  :precision binary64
                                                                                                                                  :pre TRUE
                                                                                                                                  (let* ((t_0 (fmax (fmin x y) z))
                                                                                                                                       (t_1 (fmax (fmax x y) t_0))
                                                                                                                                       (t_2 (fmin (fmax x y) t_0)))
                                                                                                                                  (if (<= t_2 1.4761403185952647e-282)
                                                                                                                                    (* 2.0 (sqrt (* (fmin (fmin x y) z) (+ t_2 t_1))))
                                                                                                                                    (* 2.0 (sqrt (* t_2 t_1))))))
                                                                                                                                double code(double x, double y, double z) {
                                                                                                                                	double t_0 = fmax(fmin(x, y), z);
                                                                                                                                	double t_1 = fmax(fmax(x, y), t_0);
                                                                                                                                	double t_2 = fmin(fmax(x, y), t_0);
                                                                                                                                	double tmp;
                                                                                                                                	if (t_2 <= 1.4761403185952647e-282) {
                                                                                                                                		tmp = 2.0 * sqrt((fmin(fmin(x, y), z) * (t_2 + t_1)));
                                                                                                                                	} else {
                                                                                                                                		tmp = 2.0 * sqrt((t_2 * t_1));
                                                                                                                                	}
                                                                                                                                	return tmp;
                                                                                                                                }
                                                                                                                                
                                                                                                                                real(8) function code(x, y, z)
                                                                                                                                use fmin_fmax_functions
                                                                                                                                    real(8), intent (in) :: x
                                                                                                                                    real(8), intent (in) :: y
                                                                                                                                    real(8), intent (in) :: z
                                                                                                                                    real(8) :: t_0
                                                                                                                                    real(8) :: t_1
                                                                                                                                    real(8) :: t_2
                                                                                                                                    real(8) :: tmp
                                                                                                                                    t_0 = fmax(fmin(x, y), z)
                                                                                                                                    t_1 = fmax(fmax(x, y), t_0)
                                                                                                                                    t_2 = fmin(fmax(x, y), t_0)
                                                                                                                                    if (t_2 <= 1.4761403185952647d-282) then
                                                                                                                                        tmp = 2.0d0 * sqrt((fmin(fmin(x, y), z) * (t_2 + t_1)))
                                                                                                                                    else
                                                                                                                                        tmp = 2.0d0 * sqrt((t_2 * t_1))
                                                                                                                                    end if
                                                                                                                                    code = tmp
                                                                                                                                end function
                                                                                                                                
                                                                                                                                public static double code(double x, double y, double z) {
                                                                                                                                	double t_0 = fmax(fmin(x, y), z);
                                                                                                                                	double t_1 = fmax(fmax(x, y), t_0);
                                                                                                                                	double t_2 = fmin(fmax(x, y), t_0);
                                                                                                                                	double tmp;
                                                                                                                                	if (t_2 <= 1.4761403185952647e-282) {
                                                                                                                                		tmp = 2.0 * Math.sqrt((fmin(fmin(x, y), z) * (t_2 + t_1)));
                                                                                                                                	} else {
                                                                                                                                		tmp = 2.0 * Math.sqrt((t_2 * t_1));
                                                                                                                                	}
                                                                                                                                	return tmp;
                                                                                                                                }
                                                                                                                                
                                                                                                                                def code(x, y, z):
                                                                                                                                	t_0 = fmax(fmin(x, y), z)
                                                                                                                                	t_1 = fmax(fmax(x, y), t_0)
                                                                                                                                	t_2 = fmin(fmax(x, y), t_0)
                                                                                                                                	tmp = 0
                                                                                                                                	if t_2 <= 1.4761403185952647e-282:
                                                                                                                                		tmp = 2.0 * math.sqrt((fmin(fmin(x, y), z) * (t_2 + t_1)))
                                                                                                                                	else:
                                                                                                                                		tmp = 2.0 * math.sqrt((t_2 * t_1))
                                                                                                                                	return tmp
                                                                                                                                
                                                                                                                                function code(x, y, z)
                                                                                                                                	t_0 = fmax(fmin(x, y), z)
                                                                                                                                	t_1 = fmax(fmax(x, y), t_0)
                                                                                                                                	t_2 = fmin(fmax(x, y), t_0)
                                                                                                                                	tmp = 0.0
                                                                                                                                	if (t_2 <= 1.4761403185952647e-282)
                                                                                                                                		tmp = Float64(2.0 * sqrt(Float64(fmin(fmin(x, y), z) * Float64(t_2 + t_1))));
                                                                                                                                	else
                                                                                                                                		tmp = Float64(2.0 * sqrt(Float64(t_2 * t_1)));
                                                                                                                                	end
                                                                                                                                	return tmp
                                                                                                                                end
                                                                                                                                
                                                                                                                                function tmp_2 = code(x, y, z)
                                                                                                                                	t_0 = max(min(x, y), z);
                                                                                                                                	t_1 = max(max(x, y), t_0);
                                                                                                                                	t_2 = min(max(x, y), t_0);
                                                                                                                                	tmp = 0.0;
                                                                                                                                	if (t_2 <= 1.4761403185952647e-282)
                                                                                                                                		tmp = 2.0 * sqrt((min(min(x, y), z) * (t_2 + t_1)));
                                                                                                                                	else
                                                                                                                                		tmp = 2.0 * sqrt((t_2 * t_1));
                                                                                                                                	end
                                                                                                                                	tmp_2 = tmp;
                                                                                                                                end
                                                                                                                                
                                                                                                                                code[x_, y_, z_] := Block[{t$95$0 = N[Max[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Max[x, y], $MachinePrecision], t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Max[x, y], $MachinePrecision], t$95$0], $MachinePrecision]}, If[LessEqual[t$95$2, 1.4761403185952647e-282], N[(2.0 * N[Sqrt[N[(N[Min[N[Min[x, y], $MachinePrecision], z], $MachinePrecision] * N[(t$95$2 + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[Sqrt[N[(t$95$2 * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
                                                                                                                                
                                                                                                                                f(x, y, z):
                                                                                                                                	x in [-inf, +inf],
                                                                                                                                	y in [-inf, +inf],
                                                                                                                                	z in [-inf, +inf]
                                                                                                                                code: THEORY
                                                                                                                                BEGIN
                                                                                                                                f(x, y, z: real): real =
                                                                                                                                	LET tmp_2 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                                	LET tmp_3 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                                	LET tmp_1 = IF (tmp_2 > z) THEN tmp_3 ELSE z ENDIF IN
                                                                                                                                	LET t_0 = tmp_1 IN
                                                                                                                                		LET tmp_6 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                                		LET tmp_7 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                                		LET tmp_5 = IF (tmp_6 > t_0) THEN tmp_7 ELSE t_0 ENDIF IN
                                                                                                                                		LET t_1 = tmp_5 IN
                                                                                                                                			LET tmp_10 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                                			LET tmp_11 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                                			LET tmp_9 = IF (tmp_10 < t_0) THEN tmp_11 ELSE t_0 ENDIF IN
                                                                                                                                			LET t_2 = tmp_9 IN
                                                                                                                                				LET tmp_19 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                                				LET tmp_20 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                                				LET tmp_18 = IF (tmp_19 < z) THEN tmp_20 ELSE z ENDIF IN
                                                                                                                                				LET tmp_16 = IF (t_2 <= (147614031859526474294695555120036569203493253587906631741363114182822367452555741948625603719696370079218651899270199883937175042294348162936777892152030379774690996112117432155452999013227131344824692676142297446714506578736307558845373440360629212674446536568204693280933006092880251257347589990388984225905761378770884773692028498248366866495649279766248633125262134831262319337700791916148064909606923302018440166843784311815662013150181057329693028143299828371665355137271564579070674694120398413588833117679488268135834993217022892670487471298687625506840315358419336060640977551746803857282090231563053167573586193576958242089781440015681144269727812857315369689248374385215356596745550632476806640625e-989)) THEN ((2) * (sqrt((tmp_18 * (t_2 + t_1))))) ELSE ((2) * (sqrt((t_2 * t_1)))) ENDIF IN
                                                                                                                                	tmp_16
                                                                                                                                END code
                                                                                                                                \begin{array}{l}
                                                                                                                                t_0 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\
                                                                                                                                t_1 := \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_0\right)\\
                                                                                                                                t_2 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_0\right)\\
                                                                                                                                \mathbf{if}\;t\_2 \leq 1.4761403185952647 \cdot 10^{-282}:\\
                                                                                                                                \;\;\;\;2 \cdot \sqrt{\mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right) \cdot \left(t\_2 + t\_1\right)}\\
                                                                                                                                
                                                                                                                                \mathbf{else}:\\
                                                                                                                                \;\;\;\;2 \cdot \sqrt{t\_2 \cdot t\_1}\\
                                                                                                                                
                                                                                                                                
                                                                                                                                \end{array}
                                                                                                                                
                                                                                                                                Derivation
                                                                                                                                1. Split input into 2 regimes
                                                                                                                                2. if y < 1.4761403185952647e-282

                                                                                                                                  1. Initial program 70.2%

                                                                                                                                    \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                                                                  2. Taylor expanded in x around 0

                                                                                                                                    \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                                                                                                                  3. Step-by-step derivation
                                                                                                                                    1. Applied rewrites24.5%

                                                                                                                                      \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                                                                                                                    2. Taylor expanded in x around inf

                                                                                                                                      \[\leadsto 2 \cdot \sqrt{x \cdot \left(y + z\right)} \]
                                                                                                                                    3. Step-by-step derivation
                                                                                                                                      1. Applied rewrites47.7%

                                                                                                                                        \[\leadsto 2 \cdot \sqrt{x \cdot \left(y + z\right)} \]

                                                                                                                                      if 1.4761403185952647e-282 < y

                                                                                                                                      1. Initial program 70.2%

                                                                                                                                        \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                                                                      2. Taylor expanded in x around 0

                                                                                                                                        \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                                                                                                                      3. Step-by-step derivation
                                                                                                                                        1. Applied rewrites24.5%

                                                                                                                                          \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                                                                                                                      4. Recombined 2 regimes into one program.
                                                                                                                                      5. Add Preprocessing

                                                                                                                                      Alternative 11: 68.1% accurate, 0.5× speedup?

                                                                                                                                      \[\begin{array}{l} t_0 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\ 2 \cdot \sqrt{\mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_0\right) \cdot \left(\mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right) + \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_0\right)\right)} \end{array} \]
                                                                                                                                      (FPCore (x y z)
                                                                                                                                        :precision binary64
                                                                                                                                        :pre TRUE
                                                                                                                                        (let* ((t_0 (fmax (fmin x y) z)))
                                                                                                                                        (*
                                                                                                                                         2.0
                                                                                                                                         (sqrt
                                                                                                                                          (*
                                                                                                                                           (fmin (fmax x y) t_0)
                                                                                                                                           (+ (fmin (fmin x y) z) (fmax (fmax x y) t_0)))))))
                                                                                                                                      double code(double x, double y, double z) {
                                                                                                                                      	double t_0 = fmax(fmin(x, y), z);
                                                                                                                                      	return 2.0 * sqrt((fmin(fmax(x, y), t_0) * (fmin(fmin(x, y), z) + fmax(fmax(x, y), t_0))));
                                                                                                                                      }
                                                                                                                                      
                                                                                                                                      real(8) function code(x, y, z)
                                                                                                                                      use fmin_fmax_functions
                                                                                                                                          real(8), intent (in) :: x
                                                                                                                                          real(8), intent (in) :: y
                                                                                                                                          real(8), intent (in) :: z
                                                                                                                                          real(8) :: t_0
                                                                                                                                          t_0 = fmax(fmin(x, y), z)
                                                                                                                                          code = 2.0d0 * sqrt((fmin(fmax(x, y), t_0) * (fmin(fmin(x, y), z) + fmax(fmax(x, y), t_0))))
                                                                                                                                      end function
                                                                                                                                      
                                                                                                                                      public static double code(double x, double y, double z) {
                                                                                                                                      	double t_0 = fmax(fmin(x, y), z);
                                                                                                                                      	return 2.0 * Math.sqrt((fmin(fmax(x, y), t_0) * (fmin(fmin(x, y), z) + fmax(fmax(x, y), t_0))));
                                                                                                                                      }
                                                                                                                                      
                                                                                                                                      def code(x, y, z):
                                                                                                                                      	t_0 = fmax(fmin(x, y), z)
                                                                                                                                      	return 2.0 * math.sqrt((fmin(fmax(x, y), t_0) * (fmin(fmin(x, y), z) + fmax(fmax(x, y), t_0))))
                                                                                                                                      
                                                                                                                                      function code(x, y, z)
                                                                                                                                      	t_0 = fmax(fmin(x, y), z)
                                                                                                                                      	return Float64(2.0 * sqrt(Float64(fmin(fmax(x, y), t_0) * Float64(fmin(fmin(x, y), z) + fmax(fmax(x, y), t_0)))))
                                                                                                                                      end
                                                                                                                                      
                                                                                                                                      function tmp = code(x, y, z)
                                                                                                                                      	t_0 = max(min(x, y), z);
                                                                                                                                      	tmp = 2.0 * sqrt((min(max(x, y), t_0) * (min(min(x, y), z) + max(max(x, y), t_0))));
                                                                                                                                      end
                                                                                                                                      
                                                                                                                                      code[x_, y_, z_] := Block[{t$95$0 = N[Max[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, N[(2.0 * N[Sqrt[N[(N[Min[N[Max[x, y], $MachinePrecision], t$95$0], $MachinePrecision] * N[(N[Min[N[Min[x, y], $MachinePrecision], z], $MachinePrecision] + N[Max[N[Max[x, y], $MachinePrecision], t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                                                                                                                                      
                                                                                                                                      f(x, y, z):
                                                                                                                                      	x in [-inf, +inf],
                                                                                                                                      	y in [-inf, +inf],
                                                                                                                                      	z in [-inf, +inf]
                                                                                                                                      code: THEORY
                                                                                                                                      BEGIN
                                                                                                                                      f(x, y, z: real): real =
                                                                                                                                      	LET tmp_2 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                                      	LET tmp_3 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                                      	LET tmp_1 = IF (tmp_2 > z) THEN tmp_3 ELSE z ENDIF IN
                                                                                                                                      	LET t_0 = tmp_1 IN
                                                                                                                                      		LET tmp_6 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                                      		LET tmp_7 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                                      		LET tmp_5 = IF (tmp_6 < t_0) THEN tmp_7 ELSE t_0 ENDIF IN
                                                                                                                                      		LET tmp_10 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                                      		LET tmp_11 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                                      		LET tmp_9 = IF (tmp_10 < z) THEN tmp_11 ELSE z ENDIF IN
                                                                                                                                      		LET tmp_14 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                                      		LET tmp_15 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                                      		LET tmp_13 = IF (tmp_14 > t_0) THEN tmp_15 ELSE t_0 ENDIF IN
                                                                                                                                      	(2) * (sqrt((tmp_5 * (tmp_9 + tmp_13))))
                                                                                                                                      END code
                                                                                                                                      \begin{array}{l}
                                                                                                                                      t_0 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\
                                                                                                                                      2 \cdot \sqrt{\mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_0\right) \cdot \left(\mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right) + \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_0\right)\right)}
                                                                                                                                      \end{array}
                                                                                                                                      
                                                                                                                                      Derivation
                                                                                                                                      1. Initial program 70.2%

                                                                                                                                        \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                                                                      2. Taylor expanded in y around inf

                                                                                                                                        \[\leadsto 2 \cdot \sqrt{y \cdot \left(x + z\right)} \]
                                                                                                                                      3. Step-by-step derivation
                                                                                                                                        1. Applied rewrites46.8%

                                                                                                                                          \[\leadsto 2 \cdot \sqrt{y \cdot \left(x + z\right)} \]
                                                                                                                                        2. Add Preprocessing

                                                                                                                                        Alternative 12: 68.1% accurate, 0.4× speedup?

                                                                                                                                        \[\begin{array}{l} t_0 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\ t_1 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_0\right)\\ \mathbf{if}\;t\_1 \leq -2.6897059964324 \cdot 10^{-311}:\\ \;\;\;\;2 \cdot \sqrt{\mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right) \cdot t\_1}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \sqrt{t\_1 \cdot \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_0\right)}\\ \end{array} \]
                                                                                                                                        (FPCore (x y z)
                                                                                                                                          :precision binary64
                                                                                                                                          :pre TRUE
                                                                                                                                          (let* ((t_0 (fmax (fmin x y) z)) (t_1 (fmin (fmax x y) t_0)))
                                                                                                                                          (if (<= t_1 -2.6897059964324e-311)
                                                                                                                                            (* 2.0 (sqrt (* (fmin (fmin x y) z) t_1)))
                                                                                                                                            (* 2.0 (sqrt (* t_1 (fmax (fmax x y) t_0)))))))
                                                                                                                                        double code(double x, double y, double z) {
                                                                                                                                        	double t_0 = fmax(fmin(x, y), z);
                                                                                                                                        	double t_1 = fmin(fmax(x, y), t_0);
                                                                                                                                        	double tmp;
                                                                                                                                        	if (t_1 <= -2.6897059964324e-311) {
                                                                                                                                        		tmp = 2.0 * sqrt((fmin(fmin(x, y), z) * t_1));
                                                                                                                                        	} else {
                                                                                                                                        		tmp = 2.0 * sqrt((t_1 * fmax(fmax(x, y), t_0)));
                                                                                                                                        	}
                                                                                                                                        	return tmp;
                                                                                                                                        }
                                                                                                                                        
                                                                                                                                        real(8) function code(x, y, z)
                                                                                                                                        use fmin_fmax_functions
                                                                                                                                            real(8), intent (in) :: x
                                                                                                                                            real(8), intent (in) :: y
                                                                                                                                            real(8), intent (in) :: z
                                                                                                                                            real(8) :: t_0
                                                                                                                                            real(8) :: t_1
                                                                                                                                            real(8) :: tmp
                                                                                                                                            t_0 = fmax(fmin(x, y), z)
                                                                                                                                            t_1 = fmin(fmax(x, y), t_0)
                                                                                                                                            if (t_1 <= (-2.6897059964324d-311)) then
                                                                                                                                                tmp = 2.0d0 * sqrt((fmin(fmin(x, y), z) * t_1))
                                                                                                                                            else
                                                                                                                                                tmp = 2.0d0 * sqrt((t_1 * fmax(fmax(x, y), t_0)))
                                                                                                                                            end if
                                                                                                                                            code = tmp
                                                                                                                                        end function
                                                                                                                                        
                                                                                                                                        public static double code(double x, double y, double z) {
                                                                                                                                        	double t_0 = fmax(fmin(x, y), z);
                                                                                                                                        	double t_1 = fmin(fmax(x, y), t_0);
                                                                                                                                        	double tmp;
                                                                                                                                        	if (t_1 <= -2.6897059964324e-311) {
                                                                                                                                        		tmp = 2.0 * Math.sqrt((fmin(fmin(x, y), z) * t_1));
                                                                                                                                        	} else {
                                                                                                                                        		tmp = 2.0 * Math.sqrt((t_1 * fmax(fmax(x, y), t_0)));
                                                                                                                                        	}
                                                                                                                                        	return tmp;
                                                                                                                                        }
                                                                                                                                        
                                                                                                                                        def code(x, y, z):
                                                                                                                                        	t_0 = fmax(fmin(x, y), z)
                                                                                                                                        	t_1 = fmin(fmax(x, y), t_0)
                                                                                                                                        	tmp = 0
                                                                                                                                        	if t_1 <= -2.6897059964324e-311:
                                                                                                                                        		tmp = 2.0 * math.sqrt((fmin(fmin(x, y), z) * t_1))
                                                                                                                                        	else:
                                                                                                                                        		tmp = 2.0 * math.sqrt((t_1 * fmax(fmax(x, y), t_0)))
                                                                                                                                        	return tmp
                                                                                                                                        
                                                                                                                                        function code(x, y, z)
                                                                                                                                        	t_0 = fmax(fmin(x, y), z)
                                                                                                                                        	t_1 = fmin(fmax(x, y), t_0)
                                                                                                                                        	tmp = 0.0
                                                                                                                                        	if (t_1 <= -2.6897059964324e-311)
                                                                                                                                        		tmp = Float64(2.0 * sqrt(Float64(fmin(fmin(x, y), z) * t_1)));
                                                                                                                                        	else
                                                                                                                                        		tmp = Float64(2.0 * sqrt(Float64(t_1 * fmax(fmax(x, y), t_0))));
                                                                                                                                        	end
                                                                                                                                        	return tmp
                                                                                                                                        end
                                                                                                                                        
                                                                                                                                        function tmp_2 = code(x, y, z)
                                                                                                                                        	t_0 = max(min(x, y), z);
                                                                                                                                        	t_1 = min(max(x, y), t_0);
                                                                                                                                        	tmp = 0.0;
                                                                                                                                        	if (t_1 <= -2.6897059964324e-311)
                                                                                                                                        		tmp = 2.0 * sqrt((min(min(x, y), z) * t_1));
                                                                                                                                        	else
                                                                                                                                        		tmp = 2.0 * sqrt((t_1 * max(max(x, y), t_0)));
                                                                                                                                        	end
                                                                                                                                        	tmp_2 = tmp;
                                                                                                                                        end
                                                                                                                                        
                                                                                                                                        code[x_, y_, z_] := Block[{t$95$0 = N[Max[N[Min[x, y], $MachinePrecision], z], $MachinePrecision]}, Block[{t$95$1 = N[Min[N[Max[x, y], $MachinePrecision], t$95$0], $MachinePrecision]}, If[LessEqual[t$95$1, -2.6897059964324e-311], N[(2.0 * N[Sqrt[N[(N[Min[N[Min[x, y], $MachinePrecision], z], $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[Sqrt[N[(t$95$1 * N[Max[N[Max[x, y], $MachinePrecision], t$95$0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
                                                                                                                                        
                                                                                                                                        f(x, y, z):
                                                                                                                                        	x in [-inf, +inf],
                                                                                                                                        	y in [-inf, +inf],
                                                                                                                                        	z in [-inf, +inf]
                                                                                                                                        code: THEORY
                                                                                                                                        BEGIN
                                                                                                                                        f(x, y, z: real): real =
                                                                                                                                        	LET tmp_2 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                                        	LET tmp_3 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                                        	LET tmp_1 = IF (tmp_2 > z) THEN tmp_3 ELSE z ENDIF IN
                                                                                                                                        	LET t_0 = tmp_1 IN
                                                                                                                                        		LET tmp_6 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                                        		LET tmp_7 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                                        		LET tmp_5 = IF (tmp_6 < t_0) THEN tmp_7 ELSE t_0 ENDIF IN
                                                                                                                                        		LET t_1 = tmp_5 IN
                                                                                                                                        			LET tmp_15 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                                        			LET tmp_16 = IF (x < y) THEN x ELSE y ENDIF IN
                                                                                                                                        			LET tmp_14 = IF (tmp_15 < z) THEN tmp_16 ELSE z ENDIF IN
                                                                                                                                        			LET tmp_19 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                                        			LET tmp_20 = IF (x > y) THEN x ELSE y ENDIF IN
                                                                                                                                        			LET tmp_18 = IF (tmp_19 > t_0) THEN tmp_20 ELSE t_0 ENDIF IN
                                                                                                                                        			LET tmp_12 = IF (t_1 <= (-26897059964323854984457557864932070009391760445761542339610042391898471264167558917467452153474676443451598028034104521207273697671388710456741579151503375942491805480867554058601375679031929379841899677138694754849947586707799076427600701760716577954404046117370353189601887577132813986855293964384192631637024090350202024909109057708678377585884243011476684260990300959142009593983450240393981367437356629969535955191842499707760111790392180536494543950897150335227668719357342881491634566025949032280083164549879316522819185289625374971018595660552551188504461198992108056734632740404091147400207050086966255877787736094318401396669937412149837413333323879339155402985652600721684971836514946507656532050807413655640399664792372647070806124247610569000244140625e-1074)) THEN ((2) * (sqrt((tmp_14 * t_1)))) ELSE ((2) * (sqrt((t_1 * tmp_18)))) ENDIF IN
                                                                                                                                        	tmp_12
                                                                                                                                        END code
                                                                                                                                        \begin{array}{l}
                                                                                                                                        t_0 := \mathsf{max}\left(\mathsf{min}\left(x, y\right), z\right)\\
                                                                                                                                        t_1 := \mathsf{min}\left(\mathsf{max}\left(x, y\right), t\_0\right)\\
                                                                                                                                        \mathbf{if}\;t\_1 \leq -2.6897059964324 \cdot 10^{-311}:\\
                                                                                                                                        \;\;\;\;2 \cdot \sqrt{\mathsf{min}\left(\mathsf{min}\left(x, y\right), z\right) \cdot t\_1}\\
                                                                                                                                        
                                                                                                                                        \mathbf{else}:\\
                                                                                                                                        \;\;\;\;2 \cdot \sqrt{t\_1 \cdot \mathsf{max}\left(\mathsf{max}\left(x, y\right), t\_0\right)}\\
                                                                                                                                        
                                                                                                                                        
                                                                                                                                        \end{array}
                                                                                                                                        
                                                                                                                                        Derivation
                                                                                                                                        1. Split input into 2 regimes
                                                                                                                                        2. if y < -2.6897059964323855e-311

                                                                                                                                          1. Initial program 70.2%

                                                                                                                                            \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                                                                          2. Taylor expanded in z around 0

                                                                                                                                            \[\leadsto 2 \cdot \sqrt{x \cdot y} \]
                                                                                                                                          3. Step-by-step derivation
                                                                                                                                            1. Applied rewrites24.6%

                                                                                                                                              \[\leadsto 2 \cdot \sqrt{x \cdot y} \]

                                                                                                                                            if -2.6897059964323855e-311 < y

                                                                                                                                            1. Initial program 70.2%

                                                                                                                                              \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                                                                            2. Taylor expanded in x around 0

                                                                                                                                              \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                                                                                                                            3. Step-by-step derivation
                                                                                                                                              1. Applied rewrites24.5%

                                                                                                                                                \[\leadsto 2 \cdot \sqrt{y \cdot z} \]
                                                                                                                                            4. Recombined 2 regimes into one program.
                                                                                                                                            5. Add Preprocessing

                                                                                                                                            Alternative 13: 34.9% accurate, 1.1× speedup?

                                                                                                                                            \[2 \cdot \sqrt{\mathsf{min}\left(x, z\right) \cdot \mathsf{min}\left(y, \mathsf{max}\left(x, z\right)\right)} \]
                                                                                                                                            (FPCore (x y z)
                                                                                                                                              :precision binary64
                                                                                                                                              :pre TRUE
                                                                                                                                              (* 2.0 (sqrt (* (fmin x z) (fmin y (fmax x z))))))
                                                                                                                                            double code(double x, double y, double z) {
                                                                                                                                            	return 2.0 * sqrt((fmin(x, z) * fmin(y, fmax(x, z))));
                                                                                                                                            }
                                                                                                                                            
                                                                                                                                            real(8) function code(x, y, z)
                                                                                                                                            use fmin_fmax_functions
                                                                                                                                                real(8), intent (in) :: x
                                                                                                                                                real(8), intent (in) :: y
                                                                                                                                                real(8), intent (in) :: z
                                                                                                                                                code = 2.0d0 * sqrt((fmin(x, z) * fmin(y, fmax(x, z))))
                                                                                                                                            end function
                                                                                                                                            
                                                                                                                                            public static double code(double x, double y, double z) {
                                                                                                                                            	return 2.0 * Math.sqrt((fmin(x, z) * fmin(y, fmax(x, z))));
                                                                                                                                            }
                                                                                                                                            
                                                                                                                                            def code(x, y, z):
                                                                                                                                            	return 2.0 * math.sqrt((fmin(x, z) * fmin(y, fmax(x, z))))
                                                                                                                                            
                                                                                                                                            function code(x, y, z)
                                                                                                                                            	return Float64(2.0 * sqrt(Float64(fmin(x, z) * fmin(y, fmax(x, z)))))
                                                                                                                                            end
                                                                                                                                            
                                                                                                                                            function tmp = code(x, y, z)
                                                                                                                                            	tmp = 2.0 * sqrt((min(x, z) * min(y, max(x, z))));
                                                                                                                                            end
                                                                                                                                            
                                                                                                                                            code[x_, y_, z_] := N[(2.0 * N[Sqrt[N[(N[Min[x, z], $MachinePrecision] * N[Min[y, N[Max[x, z], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                                                                                                                                            
                                                                                                                                            f(x, y, z):
                                                                                                                                            	x in [-inf, +inf],
                                                                                                                                            	y in [-inf, +inf],
                                                                                                                                            	z in [-inf, +inf]
                                                                                                                                            code: THEORY
                                                                                                                                            BEGIN
                                                                                                                                            f(x, y, z: real): real =
                                                                                                                                            	LET tmp = IF (x < z) THEN x ELSE z ENDIF IN
                                                                                                                                            	LET tmp_2 = IF (x > z) THEN x ELSE z ENDIF IN
                                                                                                                                            	LET tmp_3 = IF (x > z) THEN x ELSE z ENDIF IN
                                                                                                                                            	LET tmp_1 = IF (y < tmp_2) THEN y ELSE tmp_3 ENDIF IN
                                                                                                                                            	(2) * (sqrt((tmp * tmp_1)))
                                                                                                                                            END code
                                                                                                                                            2 \cdot \sqrt{\mathsf{min}\left(x, z\right) \cdot \mathsf{min}\left(y, \mathsf{max}\left(x, z\right)\right)}
                                                                                                                                            
                                                                                                                                            Derivation
                                                                                                                                            1. Initial program 70.2%

                                                                                                                                              \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                                                                            2. Taylor expanded in z around 0

                                                                                                                                              \[\leadsto 2 \cdot \sqrt{x \cdot y} \]
                                                                                                                                            3. Step-by-step derivation
                                                                                                                                              1. Applied rewrites24.6%

                                                                                                                                                \[\leadsto 2 \cdot \sqrt{x \cdot y} \]
                                                                                                                                              2. Add Preprocessing

                                                                                                                                              Alternative 14: 0.0% accurate, 4.2× speedup?

                                                                                                                                              \[\frac{0}{0} \]
                                                                                                                                              (FPCore (x y z)
                                                                                                                                                :precision binary64
                                                                                                                                                :pre TRUE
                                                                                                                                                (/ 0.0 0.0))
                                                                                                                                              double code(double x, double y, double z) {
                                                                                                                                              	return 0.0 / 0.0;
                                                                                                                                              }
                                                                                                                                              
                                                                                                                                              real(8) function code(x, y, z)
                                                                                                                                              use fmin_fmax_functions
                                                                                                                                                  real(8), intent (in) :: x
                                                                                                                                                  real(8), intent (in) :: y
                                                                                                                                                  real(8), intent (in) :: z
                                                                                                                                                  code = 0.0d0 / 0.0d0
                                                                                                                                              end function
                                                                                                                                              
                                                                                                                                              public static double code(double x, double y, double z) {
                                                                                                                                              	return 0.0 / 0.0;
                                                                                                                                              }
                                                                                                                                              
                                                                                                                                              def code(x, y, z):
                                                                                                                                              	return 0.0 / 0.0
                                                                                                                                              
                                                                                                                                              function code(x, y, z)
                                                                                                                                              	return Float64(0.0 / 0.0)
                                                                                                                                              end
                                                                                                                                              
                                                                                                                                              function tmp = code(x, y, z)
                                                                                                                                              	tmp = 0.0 / 0.0;
                                                                                                                                              end
                                                                                                                                              
                                                                                                                                              code[x_, y_, z_] := N[(0.0 / 0.0), $MachinePrecision]
                                                                                                                                              
                                                                                                                                              f(x, y, z):
                                                                                                                                              	x in [-inf, +inf],
                                                                                                                                              	y in [-inf, +inf],
                                                                                                                                              	z in [-inf, +inf]
                                                                                                                                              code: THEORY
                                                                                                                                              BEGIN
                                                                                                                                              f(x, y, z: real): real =
                                                                                                                                              	(0) / (0)
                                                                                                                                              END code
                                                                                                                                              \frac{0}{0}
                                                                                                                                              
                                                                                                                                              Derivation
                                                                                                                                              1. Initial program 70.2%

                                                                                                                                                \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z} \]
                                                                                                                                              2. Step-by-step derivation
                                                                                                                                                1. Applied rewrites0.0%

                                                                                                                                                  \[\leadsto \frac{0}{0} \]
                                                                                                                                                2. Add Preprocessing

                                                                                                                                                Reproduce

                                                                                                                                                ?
                                                                                                                                                herbie shell --seed 2026092 
                                                                                                                                                (FPCore (x y z)
                                                                                                                                                  :name "Diagrams.TwoD.Apollonian:descartes from diagrams-contrib-1.3.0.5"
                                                                                                                                                  :precision binary64
                                                                                                                                                  (* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))