NMSE Section 6.1 mentioned, B

Percentage Accurate: 78.5% → 99.1%
Time: 4.1s
Alternatives: 8
Speedup: 1.5×

Specification

?
\[\begin{array}{l} \\ \left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \end{array} \]
(FPCore (a b)
 :precision binary64
 (* (* (/ PI 2.0) (/ 1.0 (- (* b b) (* a a)))) (- (/ 1.0 a) (/ 1.0 b))))
double code(double a, double b) {
	return ((((double) M_PI) / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b));
}
public static double code(double a, double b) {
	return ((Math.PI / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b));
}
def code(a, b):
	return ((math.pi / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b))
function code(a, b)
	return Float64(Float64(Float64(pi / 2.0) * Float64(1.0 / Float64(Float64(b * b) - Float64(a * a)))) * Float64(Float64(1.0 / a) - Float64(1.0 / b)))
end
function tmp = code(a, b)
	tmp = ((pi / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b));
end
code[a_, b_] := N[(N[(N[(Pi / 2.0), $MachinePrecision] * N[(1.0 / N[(N[(b * b), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / a), $MachinePrecision] - N[(1.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)
\end{array}

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 8 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: 78.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \end{array} \]
(FPCore (a b)
 :precision binary64
 (* (* (/ PI 2.0) (/ 1.0 (- (* b b) (* a a)))) (- (/ 1.0 a) (/ 1.0 b))))
double code(double a, double b) {
	return ((((double) M_PI) / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b));
}
public static double code(double a, double b) {
	return ((Math.PI / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b));
}
def code(a, b):
	return ((math.pi / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b))
function code(a, b)
	return Float64(Float64(Float64(pi / 2.0) * Float64(1.0 / Float64(Float64(b * b) - Float64(a * a)))) * Float64(Float64(1.0 / a) - Float64(1.0 / b)))
end
function tmp = code(a, b)
	tmp = ((pi / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b));
end
code[a_, b_] := N[(N[(N[(Pi / 2.0), $MachinePrecision] * N[(1.0 / N[(N[(b * b), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / a), $MachinePrecision] - N[(1.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)
\end{array}

Alternative 1: 99.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \frac{\frac{\pi}{\left(b + a\right) \cdot 2} \cdot \left(b - a\right)}{\left(b - a\right) \cdot \left(b \cdot a\right)} \end{array} \]
(FPCore (a b)
 :precision binary64
 (/ (* (/ PI (* (+ b a) 2.0)) (- b a)) (* (- b a) (* b a))))
double code(double a, double b) {
	return ((((double) M_PI) / ((b + a) * 2.0)) * (b - a)) / ((b - a) * (b * a));
}
public static double code(double a, double b) {
	return ((Math.PI / ((b + a) * 2.0)) * (b - a)) / ((b - a) * (b * a));
}
def code(a, b):
	return ((math.pi / ((b + a) * 2.0)) * (b - a)) / ((b - a) * (b * a))
function code(a, b)
	return Float64(Float64(Float64(pi / Float64(Float64(b + a) * 2.0)) * Float64(b - a)) / Float64(Float64(b - a) * Float64(b * a)))
end
function tmp = code(a, b)
	tmp = ((pi / ((b + a) * 2.0)) * (b - a)) / ((b - a) * (b * a));
end
code[a_, b_] := N[(N[(N[(Pi / N[(N[(b + a), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] / N[(N[(b - a), $MachinePrecision] * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{\pi}{\left(b + a\right) \cdot 2} \cdot \left(b - a\right)}{\left(b - a\right) \cdot \left(b \cdot a\right)}
\end{array}
Derivation
  1. Initial program 78.5%

    \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
  2. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
    2. metadata-evalN/A

      \[\leadsto \left(\frac{\pi}{2} \cdot \frac{\color{blue}{1 \cdot 1}}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
    3. lift-*.f64N/A

      \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{\color{blue}{b \cdot b} - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
    4. lift-*.f64N/A

      \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{b \cdot b - \color{blue}{a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
    5. lift--.f64N/A

      \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{\color{blue}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
    6. difference-of-squaresN/A

      \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{\color{blue}{\left(b + a\right) \cdot \left(b - a\right)}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
    7. times-fracN/A

      \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\left(\frac{1}{b + a} \cdot \frac{1}{b - a}\right)}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
    8. lower-*.f64N/A

      \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\left(\frac{1}{b + a} \cdot \frac{1}{b - a}\right)}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
    9. lower-/.f64N/A

      \[\leadsto \left(\frac{\pi}{2} \cdot \left(\color{blue}{\frac{1}{b + a}} \cdot \frac{1}{b - a}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
    10. lower-+.f64N/A

      \[\leadsto \left(\frac{\pi}{2} \cdot \left(\frac{1}{\color{blue}{b + a}} \cdot \frac{1}{b - a}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
    11. lower-/.f64N/A

      \[\leadsto \left(\frac{\pi}{2} \cdot \left(\frac{1}{b + a} \cdot \color{blue}{\frac{1}{b - a}}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
    12. lower--.f6488.4

      \[\leadsto \left(\frac{\pi}{2} \cdot \left(\frac{1}{b + a} \cdot \frac{1}{\color{blue}{b - a}}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
  3. Applied rewrites88.4%

    \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\left(\frac{1}{b + a} \cdot \frac{1}{b - a}\right)}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
  4. Step-by-step derivation
    1. Applied rewrites87.8%

      \[\leadsto \color{blue}{\frac{\pi}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b}} \]
    2. Step-by-step derivation
      1. lift-PI.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right)}}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b} \]
      2. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)}} \cdot \frac{b - a}{a \cdot b} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)}} \cdot \frac{b - a}{a \cdot b} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{\left(2 \cdot \left(b + a\right)\right)} \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b} \]
      5. lift-+.f64N/A

        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \color{blue}{\left(b + a\right)}\right) \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b} \]
      6. lift--.f64N/A

        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \left(b + a\right)\right) \cdot \color{blue}{\left(b - a\right)}} \cdot \frac{b - a}{a \cdot b} \]
      7. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{2 \cdot \left(b + a\right)}}{b - a}} \cdot \frac{b - a}{a \cdot b} \]
      8. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{2 \cdot \left(b + a\right)}}{b - a}} \cdot \frac{b - a}{a \cdot b} \]
      9. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{2 \cdot \left(b + a\right)}}}{b - a} \cdot \frac{b - a}{a \cdot b} \]
      10. lift-PI.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\pi}}{2 \cdot \left(b + a\right)}}{b - a} \cdot \frac{b - a}{a \cdot b} \]
      11. *-commutativeN/A

        \[\leadsto \frac{\frac{\pi}{\color{blue}{\left(b + a\right) \cdot 2}}}{b - a} \cdot \frac{b - a}{a \cdot b} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{\frac{\pi}{\color{blue}{\left(b + a\right) \cdot 2}}}{b - a} \cdot \frac{b - a}{a \cdot b} \]
      13. +-commutativeN/A

        \[\leadsto \frac{\frac{\pi}{\color{blue}{\left(a + b\right)} \cdot 2}}{b - a} \cdot \frac{b - a}{a \cdot b} \]
      14. lower-+.f64N/A

        \[\leadsto \frac{\frac{\pi}{\color{blue}{\left(a + b\right)} \cdot 2}}{b - a} \cdot \frac{b - a}{a \cdot b} \]
      15. lift--.f6488.5

        \[\leadsto \frac{\frac{\pi}{\left(a + b\right) \cdot 2}}{\color{blue}{b - a}} \cdot \frac{b - a}{a \cdot b} \]
    3. Applied rewrites88.5%

      \[\leadsto \color{blue}{\frac{\frac{\pi}{\left(a + b\right) \cdot 2}}{b - a}} \cdot \frac{b - a}{a \cdot b} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\pi}{\left(a + b\right) \cdot 2}}{b - a} \cdot \frac{b - a}{a \cdot b}} \]
      2. lift--.f64N/A

        \[\leadsto \frac{\frac{\pi}{\left(a + b\right) \cdot 2}}{\color{blue}{b - a}} \cdot \frac{b - a}{a \cdot b} \]
      3. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\pi}{\left(a + b\right) \cdot 2}}{b - a}} \cdot \frac{b - a}{a \cdot b} \]
      4. lift-PI.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\mathsf{PI}\left(\right)}}{\left(a + b\right) \cdot 2}}{b - a} \cdot \frac{b - a}{a \cdot b} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{\left(a + b\right) \cdot 2}}}{b - a} \cdot \frac{b - a}{a \cdot b} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{\frac{\mathsf{PI}\left(\right)}{\color{blue}{\left(a + b\right) \cdot 2}}}{b - a} \cdot \frac{b - a}{a \cdot b} \]
      7. lift-+.f64N/A

        \[\leadsto \frac{\frac{\mathsf{PI}\left(\right)}{\color{blue}{\left(a + b\right)} \cdot 2}}{b - a} \cdot \frac{b - a}{a \cdot b} \]
      8. lift--.f64N/A

        \[\leadsto \frac{\frac{\mathsf{PI}\left(\right)}{\left(a + b\right) \cdot 2}}{b - a} \cdot \frac{\color{blue}{b - a}}{a \cdot b} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{\frac{\mathsf{PI}\left(\right)}{\left(a + b\right) \cdot 2}}{b - a} \cdot \frac{b - a}{\color{blue}{a \cdot b}} \]
      10. lift-/.f64N/A

        \[\leadsto \frac{\frac{\mathsf{PI}\left(\right)}{\left(a + b\right) \cdot 2}}{b - a} \cdot \color{blue}{\frac{b - a}{a \cdot b}} \]
      11. frac-timesN/A

        \[\leadsto \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{\left(a + b\right) \cdot 2} \cdot \left(b - a\right)}{\left(b - a\right) \cdot \left(a \cdot b\right)}} \]
      12. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{\left(a + b\right) \cdot 2} \cdot \left(b - a\right)}{\left(b - a\right) \cdot \left(a \cdot b\right)}} \]
    5. Applied rewrites99.1%

      \[\leadsto \color{blue}{\frac{\frac{\pi}{\left(b + a\right) \cdot 2} \cdot \left(b - a\right)}{\left(b - a\right) \cdot \left(b \cdot a\right)}} \]
    6. Add Preprocessing

    Alternative 2: 96.4% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{b - a}{a \cdot b}\\ \mathbf{if}\;a \leq -6.6 \cdot 10^{+154}:\\ \;\;\;\;\frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\ \mathbf{elif}\;a \leq -1.45 \cdot 10^{-198}:\\ \;\;\;\;\frac{\pi \cdot t\_0}{\left(\left(a + b\right) \cdot 2\right) \cdot \left(b - a\right)}\\ \mathbf{elif}\;a \leq 9.2 \cdot 10^{-174}:\\ \;\;\;\;\frac{0.5 \cdot \pi}{\left(b \cdot a\right) \cdot b}\\ \mathbf{elif}\;a \leq 7 \cdot 10^{+130}:\\ \;\;\;\;\frac{\pi}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2}\\ \end{array} \end{array} \]
    (FPCore (a b)
     :precision binary64
     (let* ((t_0 (/ (- b a) (* a b))))
       (if (<= a -6.6e+154)
         (* (/ PI (* a (* a b))) 0.5)
         (if (<= a -1.45e-198)
           (/ (* PI t_0) (* (* (+ a b) 2.0) (- b a)))
           (if (<= a 9.2e-174)
             (/ (* 0.5 PI) (* (* b a) b))
             (if (<= a 7e+130)
               (* (/ PI (* (* 2.0 (+ b a)) (- b a))) t_0)
               (/ (/ PI a) (* (* a b) 2.0))))))))
    double code(double a, double b) {
    	double t_0 = (b - a) / (a * b);
    	double tmp;
    	if (a <= -6.6e+154) {
    		tmp = (((double) M_PI) / (a * (a * b))) * 0.5;
    	} else if (a <= -1.45e-198) {
    		tmp = (((double) M_PI) * t_0) / (((a + b) * 2.0) * (b - a));
    	} else if (a <= 9.2e-174) {
    		tmp = (0.5 * ((double) M_PI)) / ((b * a) * b);
    	} else if (a <= 7e+130) {
    		tmp = (((double) M_PI) / ((2.0 * (b + a)) * (b - a))) * t_0;
    	} else {
    		tmp = (((double) M_PI) / a) / ((a * b) * 2.0);
    	}
    	return tmp;
    }
    
    public static double code(double a, double b) {
    	double t_0 = (b - a) / (a * b);
    	double tmp;
    	if (a <= -6.6e+154) {
    		tmp = (Math.PI / (a * (a * b))) * 0.5;
    	} else if (a <= -1.45e-198) {
    		tmp = (Math.PI * t_0) / (((a + b) * 2.0) * (b - a));
    	} else if (a <= 9.2e-174) {
    		tmp = (0.5 * Math.PI) / ((b * a) * b);
    	} else if (a <= 7e+130) {
    		tmp = (Math.PI / ((2.0 * (b + a)) * (b - a))) * t_0;
    	} else {
    		tmp = (Math.PI / a) / ((a * b) * 2.0);
    	}
    	return tmp;
    }
    
    def code(a, b):
    	t_0 = (b - a) / (a * b)
    	tmp = 0
    	if a <= -6.6e+154:
    		tmp = (math.pi / (a * (a * b))) * 0.5
    	elif a <= -1.45e-198:
    		tmp = (math.pi * t_0) / (((a + b) * 2.0) * (b - a))
    	elif a <= 9.2e-174:
    		tmp = (0.5 * math.pi) / ((b * a) * b)
    	elif a <= 7e+130:
    		tmp = (math.pi / ((2.0 * (b + a)) * (b - a))) * t_0
    	else:
    		tmp = (math.pi / a) / ((a * b) * 2.0)
    	return tmp
    
    function code(a, b)
    	t_0 = Float64(Float64(b - a) / Float64(a * b))
    	tmp = 0.0
    	if (a <= -6.6e+154)
    		tmp = Float64(Float64(pi / Float64(a * Float64(a * b))) * 0.5);
    	elseif (a <= -1.45e-198)
    		tmp = Float64(Float64(pi * t_0) / Float64(Float64(Float64(a + b) * 2.0) * Float64(b - a)));
    	elseif (a <= 9.2e-174)
    		tmp = Float64(Float64(0.5 * pi) / Float64(Float64(b * a) * b));
    	elseif (a <= 7e+130)
    		tmp = Float64(Float64(pi / Float64(Float64(2.0 * Float64(b + a)) * Float64(b - a))) * t_0);
    	else
    		tmp = Float64(Float64(pi / a) / Float64(Float64(a * b) * 2.0));
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b)
    	t_0 = (b - a) / (a * b);
    	tmp = 0.0;
    	if (a <= -6.6e+154)
    		tmp = (pi / (a * (a * b))) * 0.5;
    	elseif (a <= -1.45e-198)
    		tmp = (pi * t_0) / (((a + b) * 2.0) * (b - a));
    	elseif (a <= 9.2e-174)
    		tmp = (0.5 * pi) / ((b * a) * b);
    	elseif (a <= 7e+130)
    		tmp = (pi / ((2.0 * (b + a)) * (b - a))) * t_0;
    	else
    		tmp = (pi / a) / ((a * b) * 2.0);
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b_] := Block[{t$95$0 = N[(N[(b - a), $MachinePrecision] / N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.6e+154], N[(N[(Pi / N[(a * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[a, -1.45e-198], N[(N[(Pi * t$95$0), $MachinePrecision] / N[(N[(N[(a + b), $MachinePrecision] * 2.0), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.2e-174], N[(N[(0.5 * Pi), $MachinePrecision] / N[(N[(b * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7e+130], N[(N[(Pi / N[(N[(2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(Pi / a), $MachinePrecision] / N[(N[(a * b), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{b - a}{a \cdot b}\\
    \mathbf{if}\;a \leq -6.6 \cdot 10^{+154}:\\
    \;\;\;\;\frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\
    
    \mathbf{elif}\;a \leq -1.45 \cdot 10^{-198}:\\
    \;\;\;\;\frac{\pi \cdot t\_0}{\left(\left(a + b\right) \cdot 2\right) \cdot \left(b - a\right)}\\
    
    \mathbf{elif}\;a \leq 9.2 \cdot 10^{-174}:\\
    \;\;\;\;\frac{0.5 \cdot \pi}{\left(b \cdot a\right) \cdot b}\\
    
    \mathbf{elif}\;a \leq 7 \cdot 10^{+130}:\\
    \;\;\;\;\frac{\pi}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 5 regimes
    2. if a < -6.6e154

      1. Initial program 50.2%

        \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
      2. Taylor expanded in a around inf

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \color{blue}{\frac{1}{2}} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \color{blue}{\frac{1}{2}} \]
        3. lower-/.f64N/A

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
        4. lift-PI.f64N/A

          \[\leadsto \frac{\pi}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
        5. lower-*.f64N/A

          \[\leadsto \frac{\pi}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
        6. pow2N/A

          \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
        7. lift-*.f6476.3

          \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot 0.5 \]
      4. Applied rewrites76.3%

        \[\leadsto \color{blue}{\frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot 0.5} \]
      5. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
        3. associate-*l*N/A

          \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot \frac{1}{2} \]
        4. lower-*.f64N/A

          \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot \frac{1}{2} \]
        5. lift-*.f6499.3

          \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]
      6. Applied rewrites99.3%

        \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]

      if -6.6e154 < a < -1.45e-198

      1. Initial program 92.9%

        \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
      2. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        2. metadata-evalN/A

          \[\leadsto \left(\frac{\pi}{2} \cdot \frac{\color{blue}{1 \cdot 1}}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        3. lift-*.f64N/A

          \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{\color{blue}{b \cdot b} - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        4. lift-*.f64N/A

          \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{b \cdot b - \color{blue}{a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        5. lift--.f64N/A

          \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{\color{blue}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        6. difference-of-squaresN/A

          \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{\color{blue}{\left(b + a\right) \cdot \left(b - a\right)}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        7. times-fracN/A

          \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\left(\frac{1}{b + a} \cdot \frac{1}{b - a}\right)}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        8. lower-*.f64N/A

          \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\left(\frac{1}{b + a} \cdot \frac{1}{b - a}\right)}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        9. lower-/.f64N/A

          \[\leadsto \left(\frac{\pi}{2} \cdot \left(\color{blue}{\frac{1}{b + a}} \cdot \frac{1}{b - a}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        10. lower-+.f64N/A

          \[\leadsto \left(\frac{\pi}{2} \cdot \left(\frac{1}{\color{blue}{b + a}} \cdot \frac{1}{b - a}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        11. lower-/.f64N/A

          \[\leadsto \left(\frac{\pi}{2} \cdot \left(\frac{1}{b + a} \cdot \color{blue}{\frac{1}{b - a}}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        12. lower--.f6495.6

          \[\leadsto \left(\frac{\pi}{2} \cdot \left(\frac{1}{b + a} \cdot \frac{1}{\color{blue}{b - a}}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
      3. Applied rewrites95.6%

        \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\left(\frac{1}{b + a} \cdot \frac{1}{b - a}\right)}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
      4. Step-by-step derivation
        1. Applied rewrites95.2%

          \[\leadsto \color{blue}{\frac{\pi}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b}} \]
        2. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \color{blue}{\frac{\pi}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b}} \]
          2. lift-PI.f64N/A

            \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right)}}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b} \]
          3. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)}} \cdot \frac{b - a}{a \cdot b} \]
          4. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)}} \cdot \frac{b - a}{a \cdot b} \]
          5. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{\left(2 \cdot \left(b + a\right)\right)} \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b} \]
          6. lift-+.f64N/A

            \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \color{blue}{\left(b + a\right)}\right) \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b} \]
          7. lift--.f64N/A

            \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \left(b + a\right)\right) \cdot \color{blue}{\left(b - a\right)}} \cdot \frac{b - a}{a \cdot b} \]
          8. lift--.f64N/A

            \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \frac{\color{blue}{b - a}}{a \cdot b} \]
          9. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \frac{b - a}{\color{blue}{a \cdot b}} \]
          10. lift-/.f64N/A

            \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \color{blue}{\frac{b - a}{a \cdot b}} \]
          11. associate-*l/N/A

            \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \frac{b - a}{a \cdot b}}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)}} \]
          12. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \frac{b - a}{a \cdot b}}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)}} \]
        3. Applied rewrites95.2%

          \[\leadsto \color{blue}{\frac{\pi \cdot \frac{b - a}{a \cdot b}}{\left(\left(a + b\right) \cdot 2\right) \cdot \left(b - a\right)}} \]

        if -1.45e-198 < a < 9.1999999999999995e-174

        1. Initial program 71.2%

          \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        2. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)} \]
          2. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          3. lift-PI.f64N/A

            \[\leadsto \left(\frac{\color{blue}{\mathsf{PI}\left(\right)}}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          4. lift-/.f64N/A

            \[\leadsto \left(\color{blue}{\frac{\mathsf{PI}\left(\right)}{2}} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          5. lift-/.f64N/A

            \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          6. lift-*.f64N/A

            \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b} - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          7. lift-*.f64N/A

            \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - \color{blue}{a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          8. lift--.f64N/A

            \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          9. lift--.f64N/A

            \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right)} \]
          10. lift-/.f64N/A

            \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\color{blue}{\frac{1}{a}} - \frac{1}{b}\right) \]
          11. lift-/.f64N/A

            \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \color{blue}{\frac{1}{b}}\right) \]
          12. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
          13. frac-subN/A

            \[\leadsto \color{blue}{\frac{1 \cdot b - a \cdot 1}{a \cdot b}} \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
          14. associate-*l/N/A

            \[\leadsto \frac{1 \cdot b - a \cdot 1}{a \cdot b} \cdot \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}}{2}} \]
          15. frac-timesN/A

            \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}\right)}{\left(a \cdot b\right) \cdot 2}} \]
        3. Applied rewrites80.6%

          \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\pi \cdot \frac{1}{\left(b + a\right) \cdot \left(b - a\right)}\right)}{\left(a \cdot b\right) \cdot 2}} \]
        4. Taylor expanded in a around 0

          \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
        5. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
          2. lower-/.f64N/A

            \[\leadsto \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{\color{blue}{a \cdot {b}^{2}}} \]
          3. lift-PI.f64N/A

            \[\leadsto \frac{1}{2} \cdot \frac{\pi}{\color{blue}{a} \cdot {b}^{2}} \]
          4. lower-*.f64N/A

            \[\leadsto \frac{1}{2} \cdot \frac{\pi}{a \cdot \color{blue}{{b}^{2}}} \]
          5. pow2N/A

            \[\leadsto \frac{1}{2} \cdot \frac{\pi}{a \cdot \left(b \cdot \color{blue}{b}\right)} \]
          6. lower-*.f6476.0

            \[\leadsto 0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot \color{blue}{b}\right)} \]
        6. Applied rewrites76.0%

          \[\leadsto \color{blue}{0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot b\right)}} \]
        7. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{\pi}{a \cdot \left(b \cdot b\right)}} \]
          2. lift-PI.f64N/A

            \[\leadsto \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{\color{blue}{a} \cdot \left(b \cdot b\right)} \]
          3. lift-/.f64N/A

            \[\leadsto \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{\color{blue}{a \cdot \left(b \cdot b\right)}} \]
          4. associate-*r/N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}{\color{blue}{a \cdot \left(b \cdot b\right)}} \]
          5. lower-/.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}{\color{blue}{a \cdot \left(b \cdot b\right)}} \]
          6. lower-*.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}{\color{blue}{a} \cdot \left(b \cdot b\right)} \]
          7. lift-PI.f6476.1

            \[\leadsto \frac{0.5 \cdot \pi}{a \cdot \left(b \cdot b\right)} \]
          8. lift-*.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \pi}{a \cdot \color{blue}{\left(b \cdot b\right)}} \]
          9. lift-*.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \pi}{a \cdot \left(b \cdot \color{blue}{b}\right)} \]
          10. associate-*r*N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \pi}{\left(a \cdot b\right) \cdot \color{blue}{b}} \]
          11. lower-*.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \pi}{\left(a \cdot b\right) \cdot \color{blue}{b}} \]
          12. *-commutativeN/A

            \[\leadsto \frac{\frac{1}{2} \cdot \pi}{\left(b \cdot a\right) \cdot b} \]
          13. lower-*.f6494.7

            \[\leadsto \frac{0.5 \cdot \pi}{\left(b \cdot a\right) \cdot b} \]
        8. Applied rewrites94.7%

          \[\leadsto \frac{0.5 \cdot \pi}{\color{blue}{\left(b \cdot a\right) \cdot b}} \]

        if 9.1999999999999995e-174 < a < 7.0000000000000002e130

        1. Initial program 94.7%

          \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        2. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          2. metadata-evalN/A

            \[\leadsto \left(\frac{\pi}{2} \cdot \frac{\color{blue}{1 \cdot 1}}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          3. lift-*.f64N/A

            \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{\color{blue}{b \cdot b} - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          4. lift-*.f64N/A

            \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{b \cdot b - \color{blue}{a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          5. lift--.f64N/A

            \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{\color{blue}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          6. difference-of-squaresN/A

            \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{\color{blue}{\left(b + a\right) \cdot \left(b - a\right)}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          7. times-fracN/A

            \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\left(\frac{1}{b + a} \cdot \frac{1}{b - a}\right)}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          8. lower-*.f64N/A

            \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\left(\frac{1}{b + a} \cdot \frac{1}{b - a}\right)}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          9. lower-/.f64N/A

            \[\leadsto \left(\frac{\pi}{2} \cdot \left(\color{blue}{\frac{1}{b + a}} \cdot \frac{1}{b - a}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          10. lower-+.f64N/A

            \[\leadsto \left(\frac{\pi}{2} \cdot \left(\frac{1}{\color{blue}{b + a}} \cdot \frac{1}{b - a}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          11. lower-/.f64N/A

            \[\leadsto \left(\frac{\pi}{2} \cdot \left(\frac{1}{b + a} \cdot \color{blue}{\frac{1}{b - a}}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          12. lower--.f6495.9

            \[\leadsto \left(\frac{\pi}{2} \cdot \left(\frac{1}{b + a} \cdot \frac{1}{\color{blue}{b - a}}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        3. Applied rewrites95.9%

          \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\left(\frac{1}{b + a} \cdot \frac{1}{b - a}\right)}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        4. Step-by-step derivation
          1. Applied rewrites95.7%

            \[\leadsto \color{blue}{\frac{\pi}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b}} \]

          if 7.0000000000000002e130 < a

          1. Initial program 57.0%

            \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          2. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)} \]
            2. lift-*.f64N/A

              \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            3. lift-PI.f64N/A

              \[\leadsto \left(\frac{\color{blue}{\mathsf{PI}\left(\right)}}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            4. lift-/.f64N/A

              \[\leadsto \left(\color{blue}{\frac{\mathsf{PI}\left(\right)}{2}} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            5. lift-/.f64N/A

              \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            6. lift-*.f64N/A

              \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b} - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            7. lift-*.f64N/A

              \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - \color{blue}{a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            8. lift--.f64N/A

              \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            9. lift--.f64N/A

              \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right)} \]
            10. lift-/.f64N/A

              \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\color{blue}{\frac{1}{a}} - \frac{1}{b}\right) \]
            11. lift-/.f64N/A

              \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \color{blue}{\frac{1}{b}}\right) \]
            12. *-commutativeN/A

              \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
            13. frac-subN/A

              \[\leadsto \color{blue}{\frac{1 \cdot b - a \cdot 1}{a \cdot b}} \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
            14. associate-*l/N/A

              \[\leadsto \frac{1 \cdot b - a \cdot 1}{a \cdot b} \cdot \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}}{2}} \]
            15. frac-timesN/A

              \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}\right)}{\left(a \cdot b\right) \cdot 2}} \]
          3. Applied rewrites79.8%

            \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\pi \cdot \frac{1}{\left(b + a\right) \cdot \left(b - a\right)}\right)}{\left(a \cdot b\right) \cdot 2}} \]
          4. Taylor expanded in a around inf

            \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{a}}}{\left(a \cdot b\right) \cdot 2} \]
          5. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{\frac{\mathsf{PI}\left(\right)}{\color{blue}{a}}}{\left(a \cdot b\right) \cdot 2} \]
            2. lift-PI.f6499.8

              \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
          6. Applied rewrites99.8%

            \[\leadsto \frac{\color{blue}{\frac{\pi}{a}}}{\left(a \cdot b\right) \cdot 2} \]
        5. Recombined 5 regimes into one program.
        6. Add Preprocessing

        Alternative 3: 96.4% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\pi}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b}\\ \mathbf{if}\;a \leq -6.6 \cdot 10^{+154}:\\ \;\;\;\;\frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\ \mathbf{elif}\;a \leq -1.45 \cdot 10^{-198}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 9.2 \cdot 10^{-174}:\\ \;\;\;\;\frac{0.5 \cdot \pi}{\left(b \cdot a\right) \cdot b}\\ \mathbf{elif}\;a \leq 7 \cdot 10^{+130}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2}\\ \end{array} \end{array} \]
        (FPCore (a b)
         :precision binary64
         (let* ((t_0 (* (/ PI (* (* 2.0 (+ b a)) (- b a))) (/ (- b a) (* a b)))))
           (if (<= a -6.6e+154)
             (* (/ PI (* a (* a b))) 0.5)
             (if (<= a -1.45e-198)
               t_0
               (if (<= a 9.2e-174)
                 (/ (* 0.5 PI) (* (* b a) b))
                 (if (<= a 7e+130) t_0 (/ (/ PI a) (* (* a b) 2.0))))))))
        double code(double a, double b) {
        	double t_0 = (((double) M_PI) / ((2.0 * (b + a)) * (b - a))) * ((b - a) / (a * b));
        	double tmp;
        	if (a <= -6.6e+154) {
        		tmp = (((double) M_PI) / (a * (a * b))) * 0.5;
        	} else if (a <= -1.45e-198) {
        		tmp = t_0;
        	} else if (a <= 9.2e-174) {
        		tmp = (0.5 * ((double) M_PI)) / ((b * a) * b);
        	} else if (a <= 7e+130) {
        		tmp = t_0;
        	} else {
        		tmp = (((double) M_PI) / a) / ((a * b) * 2.0);
        	}
        	return tmp;
        }
        
        public static double code(double a, double b) {
        	double t_0 = (Math.PI / ((2.0 * (b + a)) * (b - a))) * ((b - a) / (a * b));
        	double tmp;
        	if (a <= -6.6e+154) {
        		tmp = (Math.PI / (a * (a * b))) * 0.5;
        	} else if (a <= -1.45e-198) {
        		tmp = t_0;
        	} else if (a <= 9.2e-174) {
        		tmp = (0.5 * Math.PI) / ((b * a) * b);
        	} else if (a <= 7e+130) {
        		tmp = t_0;
        	} else {
        		tmp = (Math.PI / a) / ((a * b) * 2.0);
        	}
        	return tmp;
        }
        
        def code(a, b):
        	t_0 = (math.pi / ((2.0 * (b + a)) * (b - a))) * ((b - a) / (a * b))
        	tmp = 0
        	if a <= -6.6e+154:
        		tmp = (math.pi / (a * (a * b))) * 0.5
        	elif a <= -1.45e-198:
        		tmp = t_0
        	elif a <= 9.2e-174:
        		tmp = (0.5 * math.pi) / ((b * a) * b)
        	elif a <= 7e+130:
        		tmp = t_0
        	else:
        		tmp = (math.pi / a) / ((a * b) * 2.0)
        	return tmp
        
        function code(a, b)
        	t_0 = Float64(Float64(pi / Float64(Float64(2.0 * Float64(b + a)) * Float64(b - a))) * Float64(Float64(b - a) / Float64(a * b)))
        	tmp = 0.0
        	if (a <= -6.6e+154)
        		tmp = Float64(Float64(pi / Float64(a * Float64(a * b))) * 0.5);
        	elseif (a <= -1.45e-198)
        		tmp = t_0;
        	elseif (a <= 9.2e-174)
        		tmp = Float64(Float64(0.5 * pi) / Float64(Float64(b * a) * b));
        	elseif (a <= 7e+130)
        		tmp = t_0;
        	else
        		tmp = Float64(Float64(pi / a) / Float64(Float64(a * b) * 2.0));
        	end
        	return tmp
        end
        
        function tmp_2 = code(a, b)
        	t_0 = (pi / ((2.0 * (b + a)) * (b - a))) * ((b - a) / (a * b));
        	tmp = 0.0;
        	if (a <= -6.6e+154)
        		tmp = (pi / (a * (a * b))) * 0.5;
        	elseif (a <= -1.45e-198)
        		tmp = t_0;
        	elseif (a <= 9.2e-174)
        		tmp = (0.5 * pi) / ((b * a) * b);
        	elseif (a <= 7e+130)
        		tmp = t_0;
        	else
        		tmp = (pi / a) / ((a * b) * 2.0);
        	end
        	tmp_2 = tmp;
        end
        
        code[a_, b_] := Block[{t$95$0 = N[(N[(Pi / N[(N[(2.0 * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] / N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.6e+154], N[(N[(Pi / N[(a * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[a, -1.45e-198], t$95$0, If[LessEqual[a, 9.2e-174], N[(N[(0.5 * Pi), $MachinePrecision] / N[(N[(b * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7e+130], t$95$0, N[(N[(Pi / a), $MachinePrecision] / N[(N[(a * b), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \frac{\pi}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b}\\
        \mathbf{if}\;a \leq -6.6 \cdot 10^{+154}:\\
        \;\;\;\;\frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\
        
        \mathbf{elif}\;a \leq -1.45 \cdot 10^{-198}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;a \leq 9.2 \cdot 10^{-174}:\\
        \;\;\;\;\frac{0.5 \cdot \pi}{\left(b \cdot a\right) \cdot b}\\
        
        \mathbf{elif}\;a \leq 7 \cdot 10^{+130}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if a < -6.6e154

          1. Initial program 50.2%

            \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          2. Taylor expanded in a around inf

            \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
          3. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \color{blue}{\frac{1}{2}} \]
            2. lower-*.f64N/A

              \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \color{blue}{\frac{1}{2}} \]
            3. lower-/.f64N/A

              \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
            4. lift-PI.f64N/A

              \[\leadsto \frac{\pi}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
            5. lower-*.f64N/A

              \[\leadsto \frac{\pi}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
            6. pow2N/A

              \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
            7. lift-*.f6476.3

              \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot 0.5 \]
          4. Applied rewrites76.3%

            \[\leadsto \color{blue}{\frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot 0.5} \]
          5. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
            2. lift-*.f64N/A

              \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
            3. associate-*l*N/A

              \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot \frac{1}{2} \]
            4. lower-*.f64N/A

              \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot \frac{1}{2} \]
            5. lift-*.f6499.3

              \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]
          6. Applied rewrites99.3%

            \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]

          if -6.6e154 < a < -1.45e-198 or 9.1999999999999995e-174 < a < 7.0000000000000002e130

          1. Initial program 93.7%

            \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          2. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            2. metadata-evalN/A

              \[\leadsto \left(\frac{\pi}{2} \cdot \frac{\color{blue}{1 \cdot 1}}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            3. lift-*.f64N/A

              \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{\color{blue}{b \cdot b} - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            4. lift-*.f64N/A

              \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{b \cdot b - \color{blue}{a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            5. lift--.f64N/A

              \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{\color{blue}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            6. difference-of-squaresN/A

              \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{\color{blue}{\left(b + a\right) \cdot \left(b - a\right)}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            7. times-fracN/A

              \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\left(\frac{1}{b + a} \cdot \frac{1}{b - a}\right)}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            8. lower-*.f64N/A

              \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\left(\frac{1}{b + a} \cdot \frac{1}{b - a}\right)}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            9. lower-/.f64N/A

              \[\leadsto \left(\frac{\pi}{2} \cdot \left(\color{blue}{\frac{1}{b + a}} \cdot \frac{1}{b - a}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            10. lower-+.f64N/A

              \[\leadsto \left(\frac{\pi}{2} \cdot \left(\frac{1}{\color{blue}{b + a}} \cdot \frac{1}{b - a}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            11. lower-/.f64N/A

              \[\leadsto \left(\frac{\pi}{2} \cdot \left(\frac{1}{b + a} \cdot \color{blue}{\frac{1}{b - a}}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            12. lower--.f6495.7

              \[\leadsto \left(\frac{\pi}{2} \cdot \left(\frac{1}{b + a} \cdot \frac{1}{\color{blue}{b - a}}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          3. Applied rewrites95.7%

            \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\left(\frac{1}{b + a} \cdot \frac{1}{b - a}\right)}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          4. Step-by-step derivation
            1. Applied rewrites95.4%

              \[\leadsto \color{blue}{\frac{\pi}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b}} \]

            if -1.45e-198 < a < 9.1999999999999995e-174

            1. Initial program 71.2%

              \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            2. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)} \]
              2. lift-*.f64N/A

                \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              3. lift-PI.f64N/A

                \[\leadsto \left(\frac{\color{blue}{\mathsf{PI}\left(\right)}}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              4. lift-/.f64N/A

                \[\leadsto \left(\color{blue}{\frac{\mathsf{PI}\left(\right)}{2}} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              5. lift-/.f64N/A

                \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              6. lift-*.f64N/A

                \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b} - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              7. lift-*.f64N/A

                \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - \color{blue}{a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              8. lift--.f64N/A

                \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              9. lift--.f64N/A

                \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right)} \]
              10. lift-/.f64N/A

                \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\color{blue}{\frac{1}{a}} - \frac{1}{b}\right) \]
              11. lift-/.f64N/A

                \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \color{blue}{\frac{1}{b}}\right) \]
              12. *-commutativeN/A

                \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
              13. frac-subN/A

                \[\leadsto \color{blue}{\frac{1 \cdot b - a \cdot 1}{a \cdot b}} \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
              14. associate-*l/N/A

                \[\leadsto \frac{1 \cdot b - a \cdot 1}{a \cdot b} \cdot \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}}{2}} \]
              15. frac-timesN/A

                \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}\right)}{\left(a \cdot b\right) \cdot 2}} \]
            3. Applied rewrites80.6%

              \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\pi \cdot \frac{1}{\left(b + a\right) \cdot \left(b - a\right)}\right)}{\left(a \cdot b\right) \cdot 2}} \]
            4. Taylor expanded in a around 0

              \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
            5. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
              2. lower-/.f64N/A

                \[\leadsto \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{\color{blue}{a \cdot {b}^{2}}} \]
              3. lift-PI.f64N/A

                \[\leadsto \frac{1}{2} \cdot \frac{\pi}{\color{blue}{a} \cdot {b}^{2}} \]
              4. lower-*.f64N/A

                \[\leadsto \frac{1}{2} \cdot \frac{\pi}{a \cdot \color{blue}{{b}^{2}}} \]
              5. pow2N/A

                \[\leadsto \frac{1}{2} \cdot \frac{\pi}{a \cdot \left(b \cdot \color{blue}{b}\right)} \]
              6. lower-*.f6476.0

                \[\leadsto 0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot \color{blue}{b}\right)} \]
            6. Applied rewrites76.0%

              \[\leadsto \color{blue}{0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot b\right)}} \]
            7. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{\pi}{a \cdot \left(b \cdot b\right)}} \]
              2. lift-PI.f64N/A

                \[\leadsto \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{\color{blue}{a} \cdot \left(b \cdot b\right)} \]
              3. lift-/.f64N/A

                \[\leadsto \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{\color{blue}{a \cdot \left(b \cdot b\right)}} \]
              4. associate-*r/N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}{\color{blue}{a \cdot \left(b \cdot b\right)}} \]
              5. lower-/.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}{\color{blue}{a \cdot \left(b \cdot b\right)}} \]
              6. lower-*.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}{\color{blue}{a} \cdot \left(b \cdot b\right)} \]
              7. lift-PI.f6476.1

                \[\leadsto \frac{0.5 \cdot \pi}{a \cdot \left(b \cdot b\right)} \]
              8. lift-*.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \pi}{a \cdot \color{blue}{\left(b \cdot b\right)}} \]
              9. lift-*.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \pi}{a \cdot \left(b \cdot \color{blue}{b}\right)} \]
              10. associate-*r*N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \pi}{\left(a \cdot b\right) \cdot \color{blue}{b}} \]
              11. lower-*.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \pi}{\left(a \cdot b\right) \cdot \color{blue}{b}} \]
              12. *-commutativeN/A

                \[\leadsto \frac{\frac{1}{2} \cdot \pi}{\left(b \cdot a\right) \cdot b} \]
              13. lower-*.f6494.7

                \[\leadsto \frac{0.5 \cdot \pi}{\left(b \cdot a\right) \cdot b} \]
            8. Applied rewrites94.7%

              \[\leadsto \frac{0.5 \cdot \pi}{\color{blue}{\left(b \cdot a\right) \cdot b}} \]

            if 7.0000000000000002e130 < a

            1. Initial program 57.0%

              \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            2. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)} \]
              2. lift-*.f64N/A

                \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              3. lift-PI.f64N/A

                \[\leadsto \left(\frac{\color{blue}{\mathsf{PI}\left(\right)}}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              4. lift-/.f64N/A

                \[\leadsto \left(\color{blue}{\frac{\mathsf{PI}\left(\right)}{2}} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              5. lift-/.f64N/A

                \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              6. lift-*.f64N/A

                \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b} - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              7. lift-*.f64N/A

                \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - \color{blue}{a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              8. lift--.f64N/A

                \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              9. lift--.f64N/A

                \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right)} \]
              10. lift-/.f64N/A

                \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\color{blue}{\frac{1}{a}} - \frac{1}{b}\right) \]
              11. lift-/.f64N/A

                \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \color{blue}{\frac{1}{b}}\right) \]
              12. *-commutativeN/A

                \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
              13. frac-subN/A

                \[\leadsto \color{blue}{\frac{1 \cdot b - a \cdot 1}{a \cdot b}} \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
              14. associate-*l/N/A

                \[\leadsto \frac{1 \cdot b - a \cdot 1}{a \cdot b} \cdot \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}}{2}} \]
              15. frac-timesN/A

                \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}\right)}{\left(a \cdot b\right) \cdot 2}} \]
            3. Applied rewrites79.8%

              \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\pi \cdot \frac{1}{\left(b + a\right) \cdot \left(b - a\right)}\right)}{\left(a \cdot b\right) \cdot 2}} \]
            4. Taylor expanded in a around inf

              \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{a}}}{\left(a \cdot b\right) \cdot 2} \]
            5. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{\frac{\mathsf{PI}\left(\right)}{\color{blue}{a}}}{\left(a \cdot b\right) \cdot 2} \]
              2. lift-PI.f6499.8

                \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
            6. Applied rewrites99.8%

              \[\leadsto \frac{\color{blue}{\frac{\pi}{a}}}{\left(a \cdot b\right) \cdot 2} \]
          5. Recombined 4 regimes into one program.
          6. Add Preprocessing

          Alternative 4: 92.9% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\pi \cdot \left(b - a\right)}{\left(\left(\left(a + b\right) \cdot 2\right) \cdot \left(b - a\right)\right) \cdot \left(a \cdot b\right)}\\ \mathbf{if}\;a \leq -6.3 \cdot 10^{+94}:\\ \;\;\;\;\frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\ \mathbf{elif}\;a \leq -5.8 \cdot 10^{-88}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 1.32 \cdot 10^{-185}:\\ \;\;\;\;\frac{0.5 \cdot \pi}{\left(b \cdot a\right) \cdot b}\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{+81}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2}\\ \end{array} \end{array} \]
          (FPCore (a b)
           :precision binary64
           (let* ((t_0 (/ (* PI (- b a)) (* (* (* (+ a b) 2.0) (- b a)) (* a b)))))
             (if (<= a -6.3e+94)
               (* (/ PI (* a (* a b))) 0.5)
               (if (<= a -5.8e-88)
                 t_0
                 (if (<= a 1.32e-185)
                   (/ (* 0.5 PI) (* (* b a) b))
                   (if (<= a 4.8e+81) t_0 (/ (/ PI a) (* (* a b) 2.0))))))))
          double code(double a, double b) {
          	double t_0 = (((double) M_PI) * (b - a)) / ((((a + b) * 2.0) * (b - a)) * (a * b));
          	double tmp;
          	if (a <= -6.3e+94) {
          		tmp = (((double) M_PI) / (a * (a * b))) * 0.5;
          	} else if (a <= -5.8e-88) {
          		tmp = t_0;
          	} else if (a <= 1.32e-185) {
          		tmp = (0.5 * ((double) M_PI)) / ((b * a) * b);
          	} else if (a <= 4.8e+81) {
          		tmp = t_0;
          	} else {
          		tmp = (((double) M_PI) / a) / ((a * b) * 2.0);
          	}
          	return tmp;
          }
          
          public static double code(double a, double b) {
          	double t_0 = (Math.PI * (b - a)) / ((((a + b) * 2.0) * (b - a)) * (a * b));
          	double tmp;
          	if (a <= -6.3e+94) {
          		tmp = (Math.PI / (a * (a * b))) * 0.5;
          	} else if (a <= -5.8e-88) {
          		tmp = t_0;
          	} else if (a <= 1.32e-185) {
          		tmp = (0.5 * Math.PI) / ((b * a) * b);
          	} else if (a <= 4.8e+81) {
          		tmp = t_0;
          	} else {
          		tmp = (Math.PI / a) / ((a * b) * 2.0);
          	}
          	return tmp;
          }
          
          def code(a, b):
          	t_0 = (math.pi * (b - a)) / ((((a + b) * 2.0) * (b - a)) * (a * b))
          	tmp = 0
          	if a <= -6.3e+94:
          		tmp = (math.pi / (a * (a * b))) * 0.5
          	elif a <= -5.8e-88:
          		tmp = t_0
          	elif a <= 1.32e-185:
          		tmp = (0.5 * math.pi) / ((b * a) * b)
          	elif a <= 4.8e+81:
          		tmp = t_0
          	else:
          		tmp = (math.pi / a) / ((a * b) * 2.0)
          	return tmp
          
          function code(a, b)
          	t_0 = Float64(Float64(pi * Float64(b - a)) / Float64(Float64(Float64(Float64(a + b) * 2.0) * Float64(b - a)) * Float64(a * b)))
          	tmp = 0.0
          	if (a <= -6.3e+94)
          		tmp = Float64(Float64(pi / Float64(a * Float64(a * b))) * 0.5);
          	elseif (a <= -5.8e-88)
          		tmp = t_0;
          	elseif (a <= 1.32e-185)
          		tmp = Float64(Float64(0.5 * pi) / Float64(Float64(b * a) * b));
          	elseif (a <= 4.8e+81)
          		tmp = t_0;
          	else
          		tmp = Float64(Float64(pi / a) / Float64(Float64(a * b) * 2.0));
          	end
          	return tmp
          end
          
          function tmp_2 = code(a, b)
          	t_0 = (pi * (b - a)) / ((((a + b) * 2.0) * (b - a)) * (a * b));
          	tmp = 0.0;
          	if (a <= -6.3e+94)
          		tmp = (pi / (a * (a * b))) * 0.5;
          	elseif (a <= -5.8e-88)
          		tmp = t_0;
          	elseif (a <= 1.32e-185)
          		tmp = (0.5 * pi) / ((b * a) * b);
          	elseif (a <= 4.8e+81)
          		tmp = t_0;
          	else
          		tmp = (pi / a) / ((a * b) * 2.0);
          	end
          	tmp_2 = tmp;
          end
          
          code[a_, b_] := Block[{t$95$0 = N[(N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(a + b), $MachinePrecision] * 2.0), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.3e+94], N[(N[(Pi / N[(a * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[a, -5.8e-88], t$95$0, If[LessEqual[a, 1.32e-185], N[(N[(0.5 * Pi), $MachinePrecision] / N[(N[(b * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.8e+81], t$95$0, N[(N[(Pi / a), $MachinePrecision] / N[(N[(a * b), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \frac{\pi \cdot \left(b - a\right)}{\left(\left(\left(a + b\right) \cdot 2\right) \cdot \left(b - a\right)\right) \cdot \left(a \cdot b\right)}\\
          \mathbf{if}\;a \leq -6.3 \cdot 10^{+94}:\\
          \;\;\;\;\frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\
          
          \mathbf{elif}\;a \leq -5.8 \cdot 10^{-88}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;a \leq 1.32 \cdot 10^{-185}:\\
          \;\;\;\;\frac{0.5 \cdot \pi}{\left(b \cdot a\right) \cdot b}\\
          
          \mathbf{elif}\;a \leq 4.8 \cdot 10^{+81}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if a < -6.3000000000000001e94

            1. Initial program 64.9%

              \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            2. Taylor expanded in a around inf

              \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
            3. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \color{blue}{\frac{1}{2}} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \color{blue}{\frac{1}{2}} \]
              3. lower-/.f64N/A

                \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
              4. lift-PI.f64N/A

                \[\leadsto \frac{\pi}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
              5. lower-*.f64N/A

                \[\leadsto \frac{\pi}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
              6. pow2N/A

                \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
              7. lift-*.f6482.9

                \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot 0.5 \]
            4. Applied rewrites82.9%

              \[\leadsto \color{blue}{\frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot 0.5} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
              2. lift-*.f64N/A

                \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
              3. associate-*l*N/A

                \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot \frac{1}{2} \]
              4. lower-*.f64N/A

                \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot \frac{1}{2} \]
              5. lift-*.f6499.0

                \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]
            6. Applied rewrites99.0%

              \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]

            if -6.3000000000000001e94 < a < -5.8000000000000003e-88 or 1.32e-185 < a < 4.79999999999999979e81

            1. Initial program 95.0%

              \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            2. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              2. metadata-evalN/A

                \[\leadsto \left(\frac{\pi}{2} \cdot \frac{\color{blue}{1 \cdot 1}}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              3. lift-*.f64N/A

                \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{\color{blue}{b \cdot b} - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              4. lift-*.f64N/A

                \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{b \cdot b - \color{blue}{a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              5. lift--.f64N/A

                \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{\color{blue}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              6. difference-of-squaresN/A

                \[\leadsto \left(\frac{\pi}{2} \cdot \frac{1 \cdot 1}{\color{blue}{\left(b + a\right) \cdot \left(b - a\right)}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              7. times-fracN/A

                \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\left(\frac{1}{b + a} \cdot \frac{1}{b - a}\right)}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              8. lower-*.f64N/A

                \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\left(\frac{1}{b + a} \cdot \frac{1}{b - a}\right)}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              9. lower-/.f64N/A

                \[\leadsto \left(\frac{\pi}{2} \cdot \left(\color{blue}{\frac{1}{b + a}} \cdot \frac{1}{b - a}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              10. lower-+.f64N/A

                \[\leadsto \left(\frac{\pi}{2} \cdot \left(\frac{1}{\color{blue}{b + a}} \cdot \frac{1}{b - a}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              11. lower-/.f64N/A

                \[\leadsto \left(\frac{\pi}{2} \cdot \left(\frac{1}{b + a} \cdot \color{blue}{\frac{1}{b - a}}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              12. lower--.f6496.2

                \[\leadsto \left(\frac{\pi}{2} \cdot \left(\frac{1}{b + a} \cdot \frac{1}{\color{blue}{b - a}}\right)\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            3. Applied rewrites96.2%

              \[\leadsto \left(\frac{\pi}{2} \cdot \color{blue}{\left(\frac{1}{b + a} \cdot \frac{1}{b - a}\right)}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            4. Step-by-step derivation
              1. Applied rewrites96.0%

                \[\leadsto \color{blue}{\frac{\pi}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b}} \]
              2. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \color{blue}{\frac{\pi}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b}} \]
                2. lift-PI.f64N/A

                  \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right)}}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b} \]
                3. lift-/.f64N/A

                  \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)}} \cdot \frac{b - a}{a \cdot b} \]
                4. lift-*.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)}} \cdot \frac{b - a}{a \cdot b} \]
                5. lift-*.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{\left(2 \cdot \left(b + a\right)\right)} \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b} \]
                6. lift-+.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \color{blue}{\left(b + a\right)}\right) \cdot \left(b - a\right)} \cdot \frac{b - a}{a \cdot b} \]
                7. lift--.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \left(b + a\right)\right) \cdot \color{blue}{\left(b - a\right)}} \cdot \frac{b - a}{a \cdot b} \]
                8. lift--.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \frac{\color{blue}{b - a}}{a \cdot b} \]
                9. lift-*.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \frac{b - a}{\color{blue}{a \cdot b}} \]
                10. lift-/.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \cdot \color{blue}{\frac{b - a}{a \cdot b}} \]
                11. frac-timesN/A

                  \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \left(a \cdot b\right)}} \]
                12. lower-/.f64N/A

                  \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \left(a \cdot b\right)}} \]
                13. lower-*.f64N/A

                  \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}}{\left(\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \left(a \cdot b\right)} \]
                14. lift-PI.f64N/A

                  \[\leadsto \frac{\color{blue}{\pi} \cdot \left(b - a\right)}{\left(\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \left(a \cdot b\right)} \]
                15. lift--.f64N/A

                  \[\leadsto \frac{\pi \cdot \color{blue}{\left(b - a\right)}}{\left(\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \left(a \cdot b\right)} \]
                16. lower-*.f64N/A

                  \[\leadsto \frac{\pi \cdot \left(b - a\right)}{\color{blue}{\left(\left(2 \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \left(a \cdot b\right)}} \]
              3. Applied rewrites87.2%

                \[\leadsto \color{blue}{\frac{\pi \cdot \left(b - a\right)}{\left(\left(\left(a + b\right) \cdot 2\right) \cdot \left(b - a\right)\right) \cdot \left(a \cdot b\right)}} \]

              if -5.8000000000000003e-88 < a < 1.32e-185

              1. Initial program 74.1%

                \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              2. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)} \]
                2. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                3. lift-PI.f64N/A

                  \[\leadsto \left(\frac{\color{blue}{\mathsf{PI}\left(\right)}}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                4. lift-/.f64N/A

                  \[\leadsto \left(\color{blue}{\frac{\mathsf{PI}\left(\right)}{2}} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                5. lift-/.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                6. lift-*.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b} - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                7. lift-*.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - \color{blue}{a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                8. lift--.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                9. lift--.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right)} \]
                10. lift-/.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\color{blue}{\frac{1}{a}} - \frac{1}{b}\right) \]
                11. lift-/.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \color{blue}{\frac{1}{b}}\right) \]
                12. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
                13. frac-subN/A

                  \[\leadsto \color{blue}{\frac{1 \cdot b - a \cdot 1}{a \cdot b}} \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
                14. associate-*l/N/A

                  \[\leadsto \frac{1 \cdot b - a \cdot 1}{a \cdot b} \cdot \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}}{2}} \]
                15. frac-timesN/A

                  \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}\right)}{\left(a \cdot b\right) \cdot 2}} \]
              3. Applied rewrites82.9%

                \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\pi \cdot \frac{1}{\left(b + a\right) \cdot \left(b - a\right)}\right)}{\left(a \cdot b\right) \cdot 2}} \]
              4. Taylor expanded in a around 0

                \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
              5. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
                2. lower-/.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{\color{blue}{a \cdot {b}^{2}}} \]
                3. lift-PI.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\pi}{\color{blue}{a} \cdot {b}^{2}} \]
                4. lower-*.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\pi}{a \cdot \color{blue}{{b}^{2}}} \]
                5. pow2N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\pi}{a \cdot \left(b \cdot \color{blue}{b}\right)} \]
                6. lower-*.f6475.6

                  \[\leadsto 0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot \color{blue}{b}\right)} \]
              6. Applied rewrites75.6%

                \[\leadsto \color{blue}{0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot b\right)}} \]
              7. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{\pi}{a \cdot \left(b \cdot b\right)}} \]
                2. lift-PI.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{\color{blue}{a} \cdot \left(b \cdot b\right)} \]
                3. lift-/.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{\color{blue}{a \cdot \left(b \cdot b\right)}} \]
                4. associate-*r/N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}{\color{blue}{a \cdot \left(b \cdot b\right)}} \]
                5. lower-/.f64N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}{\color{blue}{a \cdot \left(b \cdot b\right)}} \]
                6. lower-*.f64N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}{\color{blue}{a} \cdot \left(b \cdot b\right)} \]
                7. lift-PI.f6475.6

                  \[\leadsto \frac{0.5 \cdot \pi}{a \cdot \left(b \cdot b\right)} \]
                8. lift-*.f64N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \pi}{a \cdot \color{blue}{\left(b \cdot b\right)}} \]
                9. lift-*.f64N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \pi}{a \cdot \left(b \cdot \color{blue}{b}\right)} \]
                10. associate-*r*N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \pi}{\left(a \cdot b\right) \cdot \color{blue}{b}} \]
                11. lower-*.f64N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \pi}{\left(a \cdot b\right) \cdot \color{blue}{b}} \]
                12. *-commutativeN/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \pi}{\left(b \cdot a\right) \cdot b} \]
                13. lower-*.f6492.0

                  \[\leadsto \frac{0.5 \cdot \pi}{\left(b \cdot a\right) \cdot b} \]
              8. Applied rewrites92.0%

                \[\leadsto \frac{0.5 \cdot \pi}{\color{blue}{\left(b \cdot a\right) \cdot b}} \]

              if 4.79999999999999979e81 < a

              1. Initial program 66.0%

                \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              2. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)} \]
                2. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                3. lift-PI.f64N/A

                  \[\leadsto \left(\frac{\color{blue}{\mathsf{PI}\left(\right)}}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                4. lift-/.f64N/A

                  \[\leadsto \left(\color{blue}{\frac{\mathsf{PI}\left(\right)}{2}} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                5. lift-/.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                6. lift-*.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b} - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                7. lift-*.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - \color{blue}{a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                8. lift--.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                9. lift--.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right)} \]
                10. lift-/.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\color{blue}{\frac{1}{a}} - \frac{1}{b}\right) \]
                11. lift-/.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \color{blue}{\frac{1}{b}}\right) \]
                12. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
                13. frac-subN/A

                  \[\leadsto \color{blue}{\frac{1 \cdot b - a \cdot 1}{a \cdot b}} \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
                14. associate-*l/N/A

                  \[\leadsto \frac{1 \cdot b - a \cdot 1}{a \cdot b} \cdot \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}}{2}} \]
                15. frac-timesN/A

                  \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}\right)}{\left(a \cdot b\right) \cdot 2}} \]
              3. Applied rewrites83.9%

                \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\pi \cdot \frac{1}{\left(b + a\right) \cdot \left(b - a\right)}\right)}{\left(a \cdot b\right) \cdot 2}} \]
              4. Taylor expanded in a around inf

                \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{a}}}{\left(a \cdot b\right) \cdot 2} \]
              5. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{\frac{\mathsf{PI}\left(\right)}{\color{blue}{a}}}{\left(a \cdot b\right) \cdot 2} \]
                2. lift-PI.f6499.4

                  \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
              6. Applied rewrites99.4%

                \[\leadsto \frac{\color{blue}{\frac{\pi}{a}}}{\left(a \cdot b\right) \cdot 2} \]
            5. Recombined 4 regimes into one program.
            6. Add Preprocessing

            Alternative 5: 87.0% accurate, 1.5× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{+16}:\\ \;\;\;\;\frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\ \mathbf{elif}\;a \leq 1.85 \cdot 10^{-10}:\\ \;\;\;\;\frac{0.5 \cdot \pi}{\left(b \cdot a\right) \cdot b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2}\\ \end{array} \end{array} \]
            (FPCore (a b)
             :precision binary64
             (if (<= a -2e+16)
               (* (/ PI (* a (* a b))) 0.5)
               (if (<= a 1.85e-10)
                 (/ (* 0.5 PI) (* (* b a) b))
                 (/ (/ PI a) (* (* a b) 2.0)))))
            double code(double a, double b) {
            	double tmp;
            	if (a <= -2e+16) {
            		tmp = (((double) M_PI) / (a * (a * b))) * 0.5;
            	} else if (a <= 1.85e-10) {
            		tmp = (0.5 * ((double) M_PI)) / ((b * a) * b);
            	} else {
            		tmp = (((double) M_PI) / a) / ((a * b) * 2.0);
            	}
            	return tmp;
            }
            
            public static double code(double a, double b) {
            	double tmp;
            	if (a <= -2e+16) {
            		tmp = (Math.PI / (a * (a * b))) * 0.5;
            	} else if (a <= 1.85e-10) {
            		tmp = (0.5 * Math.PI) / ((b * a) * b);
            	} else {
            		tmp = (Math.PI / a) / ((a * b) * 2.0);
            	}
            	return tmp;
            }
            
            def code(a, b):
            	tmp = 0
            	if a <= -2e+16:
            		tmp = (math.pi / (a * (a * b))) * 0.5
            	elif a <= 1.85e-10:
            		tmp = (0.5 * math.pi) / ((b * a) * b)
            	else:
            		tmp = (math.pi / a) / ((a * b) * 2.0)
            	return tmp
            
            function code(a, b)
            	tmp = 0.0
            	if (a <= -2e+16)
            		tmp = Float64(Float64(pi / Float64(a * Float64(a * b))) * 0.5);
            	elseif (a <= 1.85e-10)
            		tmp = Float64(Float64(0.5 * pi) / Float64(Float64(b * a) * b));
            	else
            		tmp = Float64(Float64(pi / a) / Float64(Float64(a * b) * 2.0));
            	end
            	return tmp
            end
            
            function tmp_2 = code(a, b)
            	tmp = 0.0;
            	if (a <= -2e+16)
            		tmp = (pi / (a * (a * b))) * 0.5;
            	elseif (a <= 1.85e-10)
            		tmp = (0.5 * pi) / ((b * a) * b);
            	else
            		tmp = (pi / a) / ((a * b) * 2.0);
            	end
            	tmp_2 = tmp;
            end
            
            code[a_, b_] := If[LessEqual[a, -2e+16], N[(N[(Pi / N[(a * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[a, 1.85e-10], N[(N[(0.5 * Pi), $MachinePrecision] / N[(N[(b * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(Pi / a), $MachinePrecision] / N[(N[(a * b), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;a \leq -2 \cdot 10^{+16}:\\
            \;\;\;\;\frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\
            
            \mathbf{elif}\;a \leq 1.85 \cdot 10^{-10}:\\
            \;\;\;\;\frac{0.5 \cdot \pi}{\left(b \cdot a\right) \cdot b}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if a < -2e16

              1. Initial program 74.2%

                \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              2. Taylor expanded in a around inf

                \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \color{blue}{\frac{1}{2}} \]
                2. lower-*.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \color{blue}{\frac{1}{2}} \]
                3. lower-/.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
                4. lift-PI.f64N/A

                  \[\leadsto \frac{\pi}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
                5. lower-*.f64N/A

                  \[\leadsto \frac{\pi}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
                6. pow2N/A

                  \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
                7. lift-*.f6481.9

                  \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot 0.5 \]
              4. Applied rewrites81.9%

                \[\leadsto \color{blue}{\frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot 0.5} \]
              5. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
                2. lift-*.f64N/A

                  \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
                3. associate-*l*N/A

                  \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot \frac{1}{2} \]
                4. lower-*.f64N/A

                  \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot \frac{1}{2} \]
                5. lift-*.f6493.7

                  \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]
              6. Applied rewrites93.7%

                \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]

              if -2e16 < a < 1.85000000000000007e-10

              1. Initial program 82.1%

                \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              2. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)} \]
                2. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                3. lift-PI.f64N/A

                  \[\leadsto \left(\frac{\color{blue}{\mathsf{PI}\left(\right)}}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                4. lift-/.f64N/A

                  \[\leadsto \left(\color{blue}{\frac{\mathsf{PI}\left(\right)}{2}} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                5. lift-/.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                6. lift-*.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b} - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                7. lift-*.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - \color{blue}{a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                8. lift--.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                9. lift--.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right)} \]
                10. lift-/.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\color{blue}{\frac{1}{a}} - \frac{1}{b}\right) \]
                11. lift-/.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \color{blue}{\frac{1}{b}}\right) \]
                12. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
                13. frac-subN/A

                  \[\leadsto \color{blue}{\frac{1 \cdot b - a \cdot 1}{a \cdot b}} \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
                14. associate-*l/N/A

                  \[\leadsto \frac{1 \cdot b - a \cdot 1}{a \cdot b} \cdot \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}}{2}} \]
                15. frac-timesN/A

                  \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}\right)}{\left(a \cdot b\right) \cdot 2}} \]
              3. Applied rewrites87.7%

                \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\pi \cdot \frac{1}{\left(b + a\right) \cdot \left(b - a\right)}\right)}{\left(a \cdot b\right) \cdot 2}} \]
              4. Taylor expanded in a around 0

                \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
              5. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
                2. lower-/.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{\color{blue}{a \cdot {b}^{2}}} \]
                3. lift-PI.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\pi}{\color{blue}{a} \cdot {b}^{2}} \]
                4. lower-*.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\pi}{a \cdot \color{blue}{{b}^{2}}} \]
                5. pow2N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\pi}{a \cdot \left(b \cdot \color{blue}{b}\right)} \]
                6. lower-*.f6470.9

                  \[\leadsto 0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot \color{blue}{b}\right)} \]
              6. Applied rewrites70.9%

                \[\leadsto \color{blue}{0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot b\right)}} \]
              7. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{\pi}{a \cdot \left(b \cdot b\right)}} \]
                2. lift-PI.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{\color{blue}{a} \cdot \left(b \cdot b\right)} \]
                3. lift-/.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{\color{blue}{a \cdot \left(b \cdot b\right)}} \]
                4. associate-*r/N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}{\color{blue}{a \cdot \left(b \cdot b\right)}} \]
                5. lower-/.f64N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}{\color{blue}{a \cdot \left(b \cdot b\right)}} \]
                6. lower-*.f64N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}{\color{blue}{a} \cdot \left(b \cdot b\right)} \]
                7. lift-PI.f6471.0

                  \[\leadsto \frac{0.5 \cdot \pi}{a \cdot \left(b \cdot b\right)} \]
                8. lift-*.f64N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \pi}{a \cdot \color{blue}{\left(b \cdot b\right)}} \]
                9. lift-*.f64N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \pi}{a \cdot \left(b \cdot \color{blue}{b}\right)} \]
                10. associate-*r*N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \pi}{\left(a \cdot b\right) \cdot \color{blue}{b}} \]
                11. lower-*.f64N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \pi}{\left(a \cdot b\right) \cdot \color{blue}{b}} \]
                12. *-commutativeN/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \pi}{\left(b \cdot a\right) \cdot b} \]
                13. lower-*.f6482.3

                  \[\leadsto \frac{0.5 \cdot \pi}{\left(b \cdot a\right) \cdot b} \]
              8. Applied rewrites82.3%

                \[\leadsto \frac{0.5 \cdot \pi}{\color{blue}{\left(b \cdot a\right) \cdot b}} \]

              if 1.85000000000000007e-10 < a

              1. Initial program 75.7%

                \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              2. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)} \]
                2. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                3. lift-PI.f64N/A

                  \[\leadsto \left(\frac{\color{blue}{\mathsf{PI}\left(\right)}}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                4. lift-/.f64N/A

                  \[\leadsto \left(\color{blue}{\frac{\mathsf{PI}\left(\right)}{2}} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                5. lift-/.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                6. lift-*.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b} - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                7. lift-*.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - \color{blue}{a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                8. lift--.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                9. lift--.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right)} \]
                10. lift-/.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\color{blue}{\frac{1}{a}} - \frac{1}{b}\right) \]
                11. lift-/.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \color{blue}{\frac{1}{b}}\right) \]
                12. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
                13. frac-subN/A

                  \[\leadsto \color{blue}{\frac{1 \cdot b - a \cdot 1}{a \cdot b}} \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
                14. associate-*l/N/A

                  \[\leadsto \frac{1 \cdot b - a \cdot 1}{a \cdot b} \cdot \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}}{2}} \]
                15. frac-timesN/A

                  \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}\right)}{\left(a \cdot b\right) \cdot 2}} \]
              3. Applied rewrites88.4%

                \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\pi \cdot \frac{1}{\left(b + a\right) \cdot \left(b - a\right)}\right)}{\left(a \cdot b\right) \cdot 2}} \]
              4. Taylor expanded in a around inf

                \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{a}}}{\left(a \cdot b\right) \cdot 2} \]
              5. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{\frac{\mathsf{PI}\left(\right)}{\color{blue}{a}}}{\left(a \cdot b\right) \cdot 2} \]
                2. lift-PI.f6489.8

                  \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
              6. Applied rewrites89.8%

                \[\leadsto \frac{\color{blue}{\frac{\pi}{a}}}{\left(a \cdot b\right) \cdot 2} \]
            3. Recombined 3 regimes into one program.
            4. Add Preprocessing

            Alternative 6: 86.9% accurate, 1.5× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\ \mathbf{if}\;a \leq -2 \cdot 10^{+16}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 1.85 \cdot 10^{-10}:\\ \;\;\;\;\frac{0.5 \cdot \pi}{\left(b \cdot a\right) \cdot b}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (a b)
             :precision binary64
             (let* ((t_0 (* (/ PI (* a (* a b))) 0.5)))
               (if (<= a -2e+16)
                 t_0
                 (if (<= a 1.85e-10) (/ (* 0.5 PI) (* (* b a) b)) t_0))))
            double code(double a, double b) {
            	double t_0 = (((double) M_PI) / (a * (a * b))) * 0.5;
            	double tmp;
            	if (a <= -2e+16) {
            		tmp = t_0;
            	} else if (a <= 1.85e-10) {
            		tmp = (0.5 * ((double) M_PI)) / ((b * a) * b);
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            public static double code(double a, double b) {
            	double t_0 = (Math.PI / (a * (a * b))) * 0.5;
            	double tmp;
            	if (a <= -2e+16) {
            		tmp = t_0;
            	} else if (a <= 1.85e-10) {
            		tmp = (0.5 * Math.PI) / ((b * a) * b);
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            def code(a, b):
            	t_0 = (math.pi / (a * (a * b))) * 0.5
            	tmp = 0
            	if a <= -2e+16:
            		tmp = t_0
            	elif a <= 1.85e-10:
            		tmp = (0.5 * math.pi) / ((b * a) * b)
            	else:
            		tmp = t_0
            	return tmp
            
            function code(a, b)
            	t_0 = Float64(Float64(pi / Float64(a * Float64(a * b))) * 0.5)
            	tmp = 0.0
            	if (a <= -2e+16)
            		tmp = t_0;
            	elseif (a <= 1.85e-10)
            		tmp = Float64(Float64(0.5 * pi) / Float64(Float64(b * a) * b));
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(a, b)
            	t_0 = (pi / (a * (a * b))) * 0.5;
            	tmp = 0.0;
            	if (a <= -2e+16)
            		tmp = t_0;
            	elseif (a <= 1.85e-10)
            		tmp = (0.5 * pi) / ((b * a) * b);
            	else
            		tmp = t_0;
            	end
            	tmp_2 = tmp;
            end
            
            code[a_, b_] := Block[{t$95$0 = N[(N[(Pi / N[(a * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[a, -2e+16], t$95$0, If[LessEqual[a, 1.85e-10], N[(N[(0.5 * Pi), $MachinePrecision] / N[(N[(b * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$0]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\
            \mathbf{if}\;a \leq -2 \cdot 10^{+16}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;a \leq 1.85 \cdot 10^{-10}:\\
            \;\;\;\;\frac{0.5 \cdot \pi}{\left(b \cdot a\right) \cdot b}\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < -2e16 or 1.85000000000000007e-10 < a

              1. Initial program 74.9%

                \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              2. Taylor expanded in a around inf

                \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \color{blue}{\frac{1}{2}} \]
                2. lower-*.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \color{blue}{\frac{1}{2}} \]
                3. lower-/.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
                4. lift-PI.f64N/A

                  \[\leadsto \frac{\pi}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
                5. lower-*.f64N/A

                  \[\leadsto \frac{\pi}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
                6. pow2N/A

                  \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
                7. lift-*.f6480.3

                  \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot 0.5 \]
              4. Applied rewrites80.3%

                \[\leadsto \color{blue}{\frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot 0.5} \]
              5. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
                2. lift-*.f64N/A

                  \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
                3. associate-*l*N/A

                  \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot \frac{1}{2} \]
                4. lower-*.f64N/A

                  \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot \frac{1}{2} \]
                5. lift-*.f6491.6

                  \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]
              6. Applied rewrites91.6%

                \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]

              if -2e16 < a < 1.85000000000000007e-10

              1. Initial program 82.1%

                \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              2. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)} \]
                2. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                3. lift-PI.f64N/A

                  \[\leadsto \left(\frac{\color{blue}{\mathsf{PI}\left(\right)}}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                4. lift-/.f64N/A

                  \[\leadsto \left(\color{blue}{\frac{\mathsf{PI}\left(\right)}{2}} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                5. lift-/.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                6. lift-*.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b} - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                7. lift-*.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - \color{blue}{a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                8. lift--.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{\color{blue}{b \cdot b - a \cdot a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                9. lift--.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right)} \]
                10. lift-/.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\color{blue}{\frac{1}{a}} - \frac{1}{b}\right) \]
                11. lift-/.f64N/A

                  \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \color{blue}{\frac{1}{b}}\right) \]
                12. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
                13. frac-subN/A

                  \[\leadsto \color{blue}{\frac{1 \cdot b - a \cdot 1}{a \cdot b}} \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
                14. associate-*l/N/A

                  \[\leadsto \frac{1 \cdot b - a \cdot 1}{a \cdot b} \cdot \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}}{2}} \]
                15. frac-timesN/A

                  \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{b \cdot b - a \cdot a}\right)}{\left(a \cdot b\right) \cdot 2}} \]
              3. Applied rewrites87.7%

                \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\pi \cdot \frac{1}{\left(b + a\right) \cdot \left(b - a\right)}\right)}{\left(a \cdot b\right) \cdot 2}} \]
              4. Taylor expanded in a around 0

                \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
              5. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
                2. lower-/.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{\color{blue}{a \cdot {b}^{2}}} \]
                3. lift-PI.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\pi}{\color{blue}{a} \cdot {b}^{2}} \]
                4. lower-*.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\pi}{a \cdot \color{blue}{{b}^{2}}} \]
                5. pow2N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\pi}{a \cdot \left(b \cdot \color{blue}{b}\right)} \]
                6. lower-*.f6470.9

                  \[\leadsto 0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot \color{blue}{b}\right)} \]
              6. Applied rewrites70.9%

                \[\leadsto \color{blue}{0.5 \cdot \frac{\pi}{a \cdot \left(b \cdot b\right)}} \]
              7. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{\pi}{a \cdot \left(b \cdot b\right)}} \]
                2. lift-PI.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{\color{blue}{a} \cdot \left(b \cdot b\right)} \]
                3. lift-/.f64N/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{\color{blue}{a \cdot \left(b \cdot b\right)}} \]
                4. associate-*r/N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}{\color{blue}{a \cdot \left(b \cdot b\right)}} \]
                5. lower-/.f64N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}{\color{blue}{a \cdot \left(b \cdot b\right)}} \]
                6. lower-*.f64N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}{\color{blue}{a} \cdot \left(b \cdot b\right)} \]
                7. lift-PI.f6471.0

                  \[\leadsto \frac{0.5 \cdot \pi}{a \cdot \left(b \cdot b\right)} \]
                8. lift-*.f64N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \pi}{a \cdot \color{blue}{\left(b \cdot b\right)}} \]
                9. lift-*.f64N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \pi}{a \cdot \left(b \cdot \color{blue}{b}\right)} \]
                10. associate-*r*N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \pi}{\left(a \cdot b\right) \cdot \color{blue}{b}} \]
                11. lower-*.f64N/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \pi}{\left(a \cdot b\right) \cdot \color{blue}{b}} \]
                12. *-commutativeN/A

                  \[\leadsto \frac{\frac{1}{2} \cdot \pi}{\left(b \cdot a\right) \cdot b} \]
                13. lower-*.f6482.3

                  \[\leadsto \frac{0.5 \cdot \pi}{\left(b \cdot a\right) \cdot b} \]
              8. Applied rewrites82.3%

                \[\leadsto \frac{0.5 \cdot \pi}{\color{blue}{\left(b \cdot a\right) \cdot b}} \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 7: 81.1% accurate, 1.5× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\ \mathbf{if}\;a \leq -2 \cdot 10^{+16}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 1.85 \cdot 10^{-10}:\\ \;\;\;\;\frac{\pi}{\left(b \cdot b\right) \cdot a} \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (a b)
             :precision binary64
             (let* ((t_0 (* (/ PI (* a (* a b))) 0.5)))
               (if (<= a -2e+16)
                 t_0
                 (if (<= a 1.85e-10) (* (/ PI (* (* b b) a)) 0.5) t_0))))
            double code(double a, double b) {
            	double t_0 = (((double) M_PI) / (a * (a * b))) * 0.5;
            	double tmp;
            	if (a <= -2e+16) {
            		tmp = t_0;
            	} else if (a <= 1.85e-10) {
            		tmp = (((double) M_PI) / ((b * b) * a)) * 0.5;
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            public static double code(double a, double b) {
            	double t_0 = (Math.PI / (a * (a * b))) * 0.5;
            	double tmp;
            	if (a <= -2e+16) {
            		tmp = t_0;
            	} else if (a <= 1.85e-10) {
            		tmp = (Math.PI / ((b * b) * a)) * 0.5;
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            def code(a, b):
            	t_0 = (math.pi / (a * (a * b))) * 0.5
            	tmp = 0
            	if a <= -2e+16:
            		tmp = t_0
            	elif a <= 1.85e-10:
            		tmp = (math.pi / ((b * b) * a)) * 0.5
            	else:
            		tmp = t_0
            	return tmp
            
            function code(a, b)
            	t_0 = Float64(Float64(pi / Float64(a * Float64(a * b))) * 0.5)
            	tmp = 0.0
            	if (a <= -2e+16)
            		tmp = t_0;
            	elseif (a <= 1.85e-10)
            		tmp = Float64(Float64(pi / Float64(Float64(b * b) * a)) * 0.5);
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(a, b)
            	t_0 = (pi / (a * (a * b))) * 0.5;
            	tmp = 0.0;
            	if (a <= -2e+16)
            		tmp = t_0;
            	elseif (a <= 1.85e-10)
            		tmp = (pi / ((b * b) * a)) * 0.5;
            	else
            		tmp = t_0;
            	end
            	tmp_2 = tmp;
            end
            
            code[a_, b_] := Block[{t$95$0 = N[(N[(Pi / N[(a * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[a, -2e+16], t$95$0, If[LessEqual[a, 1.85e-10], N[(N[(Pi / N[(N[(b * b), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], t$95$0]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\
            \mathbf{if}\;a \leq -2 \cdot 10^{+16}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;a \leq 1.85 \cdot 10^{-10}:\\
            \;\;\;\;\frac{\pi}{\left(b \cdot b\right) \cdot a} \cdot 0.5\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < -2e16 or 1.85000000000000007e-10 < a

              1. Initial program 74.9%

                \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              2. Taylor expanded in a around inf

                \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \color{blue}{\frac{1}{2}} \]
                2. lower-*.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \color{blue}{\frac{1}{2}} \]
                3. lower-/.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
                4. lift-PI.f64N/A

                  \[\leadsto \frac{\pi}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
                5. lower-*.f64N/A

                  \[\leadsto \frac{\pi}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
                6. pow2N/A

                  \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
                7. lift-*.f6480.3

                  \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot 0.5 \]
              4. Applied rewrites80.3%

                \[\leadsto \color{blue}{\frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot 0.5} \]
              5. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
                2. lift-*.f64N/A

                  \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
                3. associate-*l*N/A

                  \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot \frac{1}{2} \]
                4. lower-*.f64N/A

                  \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot \frac{1}{2} \]
                5. lift-*.f6491.6

                  \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]
              6. Applied rewrites91.6%

                \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]

              if -2e16 < a < 1.85000000000000007e-10

              1. Initial program 82.1%

                \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              2. Taylor expanded in a around 0

                \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}} \cdot \color{blue}{\frac{1}{2}} \]
                2. lower-*.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}} \cdot \color{blue}{\frac{1}{2}} \]
                3. lower-/.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}} \cdot \frac{1}{2} \]
                4. lift-PI.f64N/A

                  \[\leadsto \frac{\pi}{a \cdot {b}^{2}} \cdot \frac{1}{2} \]
                5. *-commutativeN/A

                  \[\leadsto \frac{\pi}{{b}^{2} \cdot a} \cdot \frac{1}{2} \]
                6. lower-*.f64N/A

                  \[\leadsto \frac{\pi}{{b}^{2} \cdot a} \cdot \frac{1}{2} \]
                7. pow2N/A

                  \[\leadsto \frac{\pi}{\left(b \cdot b\right) \cdot a} \cdot \frac{1}{2} \]
                8. lift-*.f6470.9

                  \[\leadsto \frac{\pi}{\left(b \cdot b\right) \cdot a} \cdot 0.5 \]
              4. Applied rewrites70.9%

                \[\leadsto \color{blue}{\frac{\pi}{\left(b \cdot b\right) \cdot a} \cdot 0.5} \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 8: 63.0% accurate, 2.4× speedup?

            \[\begin{array}{l} \\ \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \end{array} \]
            (FPCore (a b) :precision binary64 (* (/ PI (* a (* a b))) 0.5))
            double code(double a, double b) {
            	return (((double) M_PI) / (a * (a * b))) * 0.5;
            }
            
            public static double code(double a, double b) {
            	return (Math.PI / (a * (a * b))) * 0.5;
            }
            
            def code(a, b):
            	return (math.pi / (a * (a * b))) * 0.5
            
            function code(a, b)
            	return Float64(Float64(pi / Float64(a * Float64(a * b))) * 0.5)
            end
            
            function tmp = code(a, b)
            	tmp = (pi / (a * (a * b))) * 0.5;
            end
            
            code[a_, b_] := N[(N[(Pi / N[(a * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5
            \end{array}
            
            Derivation
            1. Initial program 78.5%

              \[\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
            2. Taylor expanded in a around inf

              \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
            3. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \color{blue}{\frac{1}{2}} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \color{blue}{\frac{1}{2}} \]
              3. lower-/.f64N/A

                \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
              4. lift-PI.f64N/A

                \[\leadsto \frac{\pi}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
              5. lower-*.f64N/A

                \[\leadsto \frac{\pi}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
              6. pow2N/A

                \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
              7. lift-*.f6457.4

                \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot 0.5 \]
            4. Applied rewrites57.4%

              \[\leadsto \color{blue}{\frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot 0.5} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
              2. lift-*.f64N/A

                \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot \frac{1}{2} \]
              3. associate-*l*N/A

                \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot \frac{1}{2} \]
              4. lower-*.f64N/A

                \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot \frac{1}{2} \]
              5. lift-*.f6463.0

                \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]
            6. Applied rewrites63.0%

              \[\leadsto \frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]
            7. Add Preprocessing

            Reproduce

            ?
            herbie shell --seed 2025106 
            (FPCore (a b)
              :name "NMSE Section 6.1 mentioned, B"
              :precision binary64
              (* (* (/ PI 2.0) (/ 1.0 (- (* b b) (* a a)))) (- (/ 1.0 a) (/ 1.0 b))))