NMSE Section 6.1 mentioned, B

Percentage Accurate: 78.3% → 90.4%
Time: 3.4s
Alternatives: 9
Speedup: 1.8×

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 9 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.3% 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: 90.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.65 \cdot 10^{+70}:\\
\;\;\;\;\frac{\pi \cdot 1}{2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot \left(\frac{1}{a} - \frac{1}{b}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\pi}{b}}{a \cdot \left(b + b\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.65000000000000008e70

    1. Initial program 80.3%

      \[\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-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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      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. frac-timesN/A

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

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

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

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

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

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

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

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

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

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

    if 1.65000000000000008e70 < b

    1. Initial program 69.8%

      \[\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-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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      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. frac-timesN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\pi}{b}}{a \cdot \left(b + b\right)} \]
    7. Applied rewrites98.3%

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

Alternative 2: 90.1% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_0 := a \cdot \left(b + b\right)\\
\mathbf{if}\;b \leq 2.4 \cdot 10^{+94}:\\
\;\;\;\;\frac{\frac{\pi}{\left(b - a\right) \cdot \left(a + b\right)} \cdot \left(b - a\right)}{t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\pi}{b}}{t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 2.39999999999999983e94

    1. Initial program 80.8%

      \[\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-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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      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. frac-timesN/A

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

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

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

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

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

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

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

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

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

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

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

    if 2.39999999999999983e94 < b

    1. Initial program 66.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-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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      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. frac-timesN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\pi}{b}}{a \cdot \left(b + b\right)} \]
    7. Applied rewrites99.7%

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

Alternative 3: 89.2% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_0 := \left(b + b\right) \cdot a\\
\mathbf{if}\;a \leq -2.35 \cdot 10^{+129}:\\
\;\;\;\;\frac{\frac{\frac{\pi}{b} \cdot 0.5}{a}}{a}\\

\mathbf{elif}\;a \leq 2.5 \cdot 10^{+45}:\\
\;\;\;\;\frac{\pi}{\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot t\_0} \cdot \left(b - a\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\pi}{a}}{t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.35000000000000004e129

    1. Initial program 58.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{\frac{-1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a} + \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{b}}{{a}^{2}}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{\pi}{b}, \frac{1}{2}, \frac{-1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a}\right)}{{a}^{2}} \]
      7. *-commutativeN/A

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{\pi}{b}, \frac{1}{2}, \frac{\pi}{a} \cdot \frac{-1}{2}\right)}{{a}^{2}} \]
      11. pow2N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{\pi}{b}, \frac{1}{2}, \frac{\pi}{a} \cdot \frac{-1}{2}\right)}{a \cdot \color{blue}{a}} \]
      12. lift-*.f6480.3

        \[\leadsto \frac{\mathsf{fma}\left(\frac{\pi}{b}, 0.5, \frac{\pi}{a} \cdot -0.5\right)}{a \cdot \color{blue}{a}} \]
    4. Applied rewrites80.3%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{\pi}{b}, 0.5, \frac{\pi}{a} \cdot -0.5\right)}{a \cdot a}} \]
    5. Taylor expanded in a around inf

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

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

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

        \[\leadsto \frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot \frac{1}{2}}{a \cdot a} \]
      4. lift-PI.f6480.3

        \[\leadsto \frac{\frac{\pi}{b} \cdot 0.5}{a \cdot a} \]
    7. Applied rewrites80.3%

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

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

        \[\leadsto \frac{\frac{\pi}{b} \cdot \frac{1}{2}}{\color{blue}{a \cdot a}} \]
      3. associate-/r*N/A

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

        \[\leadsto \frac{\frac{\frac{\pi}{b} \cdot \frac{1}{2}}{a}}{\color{blue}{a}} \]
      5. lower-/.f6499.8

        \[\leadsto \frac{\frac{\frac{\pi}{b} \cdot 0.5}{a}}{a} \]
    9. Applied rewrites99.8%

      \[\leadsto \frac{\frac{\frac{\pi}{b} \cdot 0.5}{a}}{\color{blue}{a}} \]

    if -2.35000000000000004e129 < a < 2.5e45

    1. Initial program 85.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-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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      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. frac-timesN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5e45 < a

    1. Initial program 70.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}{\color{blue}{b \cdot b} - 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}{b \cdot b - \color{blue}{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 rewrites84.5%

      \[\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. lift-/.f64N/A

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

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

      \[\leadsto \frac{\color{blue}{\frac{\pi}{a}}}{\left(a \cdot b\right) \cdot 2} \]
    7. Step-by-step derivation
      1. *-commutative96.5

        \[\leadsto \frac{\frac{\color{blue}{\pi}}{a}}{\left(a \cdot b\right) \cdot 2} \]
      2. difference-of-squares-rev96.5

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      3. associate-*r/96.5

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      4. *-rgt-identity96.5

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      5. difference-of-squares-rev96.5

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      6. +-commutative96.5

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

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      8. *-lft-identity96.5

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      9. *-rgt-identity96.5

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      10. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(\left(a \cdot b\right) \cdot 2\right)\right)} \]
      11. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot b\right)\right) \cdot 2} \]
      12. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(*-commutative, \left(2 \cdot \left(a \cdot b\right)\right)\right)} \]
      13. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(count-2-rev, \left(a \cdot b + a \cdot b\right)\right)} \]
      14. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite<=}\left(distribute-lft-in, \left(a \cdot \left(b + b\right)\right)\right)} \]
      15. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(*-commutative, \left(\left(b + b\right) \cdot a\right)\right)} \]
      16. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(lower-*.f64, \left(\left(b + b\right) \cdot a\right)\right)} \]
      17. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite<=}\left(lift-+.f64, \left(b + b\right)\right) \cdot a} \]
    8. Applied rewrites96.5%

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

Alternative 4: 87.2% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_0 := a \cdot \left(b + b\right)\\
\mathbf{if}\;b \leq 1.65 \cdot 10^{+70}:\\
\;\;\;\;\left(b - a\right) \cdot \frac{\frac{\pi}{\left(b - a\right) \cdot \left(a + b\right)}}{t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\pi}{b}}{t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.65000000000000008e70

    1. Initial program 80.3%

      \[\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-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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      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. frac-timesN/A

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

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

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

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

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

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

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

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

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

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

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

    if 1.65000000000000008e70 < b

    1. Initial program 69.8%

      \[\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-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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      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. frac-timesN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\pi}{b}}{a \cdot \left(b + b\right)} \]
    7. Applied rewrites98.3%

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

Alternative 5: 87.1% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.7 \cdot 10^{-18}:\\
\;\;\;\;\frac{\pi}{b \cdot \left(a \cdot b\right)} \cdot 0.5\\

\mathbf{elif}\;b \leq 0.6:\\
\;\;\;\;\frac{\frac{\pi}{a}}{\left(b + b\right) \cdot a}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\pi}{b}}{a \cdot \left(b + b\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -5.69999999999999971e-18

    1. Initial program 75.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 \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-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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      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. frac-timesN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\pi \cdot 1}{2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}} \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
    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. *-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-*.f6478.3

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

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

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

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

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

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

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

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

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

    if -5.69999999999999971e-18 < b < 0.599999999999999978

    1. Initial program 80.4%

      \[\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}{\color{blue}{b \cdot b} - 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}{b \cdot b - \color{blue}{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 rewrites86.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. lift-/.f64N/A

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

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

      \[\leadsto \frac{\color{blue}{\frac{\pi}{a}}}{\left(a \cdot b\right) \cdot 2} \]
    7. Step-by-step derivation
      1. *-commutative84.0

        \[\leadsto \frac{\frac{\color{blue}{\pi}}{a}}{\left(a \cdot b\right) \cdot 2} \]
      2. difference-of-squares-rev84.0

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      3. associate-*r/84.0

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      4. *-rgt-identity84.0

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      5. difference-of-squares-rev84.0

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      6. +-commutative84.0

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      7. *-commutative84.0

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      8. *-lft-identity84.0

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      9. *-rgt-identity84.0

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      10. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(\left(a \cdot b\right) \cdot 2\right)\right)} \]
      11. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot b\right)\right) \cdot 2} \]
      12. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(*-commutative, \left(2 \cdot \left(a \cdot b\right)\right)\right)} \]
      13. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(count-2-rev, \left(a \cdot b + a \cdot b\right)\right)} \]
      14. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite<=}\left(distribute-lft-in, \left(a \cdot \left(b + b\right)\right)\right)} \]
      15. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(*-commutative, \left(\left(b + b\right) \cdot a\right)\right)} \]
      16. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(lower-*.f64, \left(\left(b + b\right) \cdot a\right)\right)} \]
      17. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite<=}\left(lift-+.f64, \left(b + b\right)\right) \cdot a} \]
    8. Applied rewrites84.0%

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

    if 0.599999999999999978 < b

    1. Initial program 76.8%

      \[\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-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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      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. frac-timesN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\pi}{b}}{a \cdot \left(b + b\right)} \]
    7. Applied rewrites91.2%

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

Alternative 6: 87.0% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{\pi}{b \cdot \left(a \cdot b\right)} \cdot 0.5\\
\mathbf{if}\;b \leq -5.7 \cdot 10^{-18}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;b \leq 0.6:\\
\;\;\;\;\frac{\frac{\pi}{a}}{\left(b + b\right) \cdot a}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -5.69999999999999971e-18 or 0.599999999999999978 < b

    1. Initial program 76.4%

      \[\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-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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      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. frac-timesN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\pi \cdot 1}{2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}} \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
    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. *-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-*.f6479.5

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

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

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

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

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

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

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

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

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

    if -5.69999999999999971e-18 < b < 0.599999999999999978

    1. Initial program 80.4%

      \[\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}{\color{blue}{b \cdot b} - 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}{b \cdot b - \color{blue}{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 rewrites86.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. lift-/.f64N/A

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

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

      \[\leadsto \frac{\color{blue}{\frac{\pi}{a}}}{\left(a \cdot b\right) \cdot 2} \]
    7. Step-by-step derivation
      1. *-commutative84.0

        \[\leadsto \frac{\frac{\color{blue}{\pi}}{a}}{\left(a \cdot b\right) \cdot 2} \]
      2. difference-of-squares-rev84.0

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      3. associate-*r/84.0

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      4. *-rgt-identity84.0

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      5. difference-of-squares-rev84.0

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      6. +-commutative84.0

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      7. *-commutative84.0

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      8. *-lft-identity84.0

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      9. *-rgt-identity84.0

        \[\leadsto \frac{\frac{\pi}{a}}{\left(a \cdot b\right) \cdot 2} \]
      10. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(\left(a \cdot b\right) \cdot 2\right)\right)} \]
      11. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(a \cdot b\right)\right) \cdot 2} \]
      12. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(*-commutative, \left(2 \cdot \left(a \cdot b\right)\right)\right)} \]
      13. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(count-2-rev, \left(a \cdot b + a \cdot b\right)\right)} \]
      14. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite<=}\left(distribute-lft-in, \left(a \cdot \left(b + b\right)\right)\right)} \]
      15. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(*-commutative, \left(\left(b + b\right) \cdot a\right)\right)} \]
      16. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite=>}\left(lower-*.f64, \left(\left(b + b\right) \cdot a\right)\right)} \]
      17. *-rgt-identityN/A

        \[\leadsto \frac{\frac{\pi}{a}}{\mathsf{Rewrite<=}\left(lift-+.f64, \left(b + b\right)\right) \cdot a} \]
    8. Applied rewrites84.0%

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

Alternative 7: 85.7% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{\pi}{b \cdot \left(a \cdot b\right)} \cdot 0.5\\
\mathbf{if}\;b \leq -5.7 \cdot 10^{-18}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;b \leq 0.6:\\
\;\;\;\;\frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -5.69999999999999971e-18 or 0.599999999999999978 < b

    1. Initial program 76.4%

      \[\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-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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      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. frac-timesN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\pi \cdot 1}{2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}} \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
    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. *-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-*.f6479.5

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

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

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

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

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

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

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

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

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

    if -5.69999999999999971e-18 < b < 0.599999999999999978

    1. Initial program 80.4%

      \[\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-*.f6471.3

        \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot 0.5 \]
    4. Applied rewrites71.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-*.f6483.7

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

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

Alternative 8: 81.5% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{\pi}{\left(b \cdot b\right) \cdot a} \cdot 0.5\\
\mathbf{if}\;b \leq -5.7 \cdot 10^{-18}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;b \leq 0.6:\\
\;\;\;\;\frac{\pi}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -5.69999999999999971e-18 or 0.599999999999999978 < b

    1. Initial program 76.4%

      \[\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-*.f6479.5

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

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

    if -5.69999999999999971e-18 < b < 0.599999999999999978

    1. Initial program 80.4%

      \[\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-*.f6471.3

        \[\leadsto \frac{\pi}{\left(a \cdot a\right) \cdot b} \cdot 0.5 \]
    4. Applied rewrites71.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-*.f6483.7

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

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

Alternative 9: 62.7% accurate, 2.6× 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.3%

    \[\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-*.f6456.7

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

    \[\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-*.f6462.7

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

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

Reproduce

?
herbie shell --seed 2025101 
(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))))