NMSE Section 6.1 mentioned, B

Percentage Accurate: 78.3% → 99.4%
Time: 4.5s
Alternatives: 9
Speedup: 1.8×

Specification

?
\[\begin{array}{l} \\ \left(\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) \end{array} \]
(FPCore (a b)
 :precision binary64
 (* (* (/ (PI) 2.0) (/ 1.0 (- (* b b) (* a a)))) (- (/ 1.0 a) (/ 1.0 b))))
\begin{array}{l}

\\
\left(\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)
\end{array}

Sampling outcomes in binary64 precision:

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{\mathsf{PI}\left(\right)}{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))))
\begin{array}{l}

\\
\left(\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)
\end{array}

Alternative 1: 99.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.2 \cdot 10^{+57} \lor \neg \left(a \leq 5 \cdot 10^{+15}\right):\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{2 \cdot \left(a + b\right)} \cdot \left({\left(b - a\right)}^{-1} \cdot \frac{\frac{b - a}{a}}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{\left(a + b\right) \cdot 2} \cdot \frac{\frac{b - a}{b}}{a}}{b - a}\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (if (or (<= a -1.2e+57) (not (<= a 5e+15)))
   (* (/ (PI) (* 2.0 (+ a b))) (* (pow (- b a) -1.0) (/ (/ (- b a) a) b)))
   (/ (* (/ (PI) (* (+ a b) 2.0)) (/ (/ (- b a) b) a)) (- b a))))
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.2 \cdot 10^{+57} \lor \neg \left(a \leq 5 \cdot 10^{+15}\right):\\
\;\;\;\;\frac{\mathsf{PI}\left(\right)}{2 \cdot \left(a + b\right)} \cdot \left({\left(b - a\right)}^{-1} \cdot \frac{\frac{b - a}{a}}{b}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{\left(a + b\right) \cdot 2} \cdot \frac{\frac{b - a}{b}}{a}}{b - a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.20000000000000002e57 or 5e15 < a

    1. Initial program 78.1%

      \[\left(\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) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\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) \]
      2. 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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      6. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.20000000000000002e57 < a < 5e15

    1. Initial program 85.4%

      \[\left(\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) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\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) \]
      2. 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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      6. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{\left(a + b\right) \cdot 2} \cdot \frac{\frac{b - a}{b}}{a}}{b - a}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.2 \cdot 10^{+57} \lor \neg \left(a \leq 5 \cdot 10^{+15}\right):\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{2 \cdot \left(a + b\right)} \cdot \left({\left(b - a\right)}^{-1} \cdot \frac{\frac{b - a}{a}}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{\left(a + b\right) \cdot 2} \cdot \frac{\frac{b - a}{b}}{a}}{b - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 99.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -3000000000000 \lor \neg \left(b \leq 2 \cdot 10^{-42}\right):\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{\left(a + b\right) \cdot 2} \cdot \frac{\frac{b - a}{b}}{a}}{b - a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}{a}}{\left(b \cdot \left(\left(b + a\right) \cdot 2\right)\right) \cdot \left(b - a\right)}\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (if (or (<= b -3000000000000.0) (not (<= b 2e-42)))
   (/ (* (/ (PI) (* (+ a b) 2.0)) (/ (/ (- b a) b) a)) (- b a))
   (/ (/ (* (- b a) (PI)) a) (* (* b (* (+ b a) 2.0)) (- b a)))))
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3000000000000 \lor \neg \left(b \leq 2 \cdot 10^{-42}\right):\\
\;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{\left(a + b\right) \cdot 2} \cdot \frac{\frac{b - a}{b}}{a}}{b - a}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}{a}}{\left(b \cdot \left(\left(b + a\right) \cdot 2\right)\right) \cdot \left(b - a\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3e12 or 2.00000000000000008e-42 < b

    1. Initial program 79.1%

      \[\left(\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) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\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) \]
      2. 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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      6. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3e12 < b < 2.00000000000000008e-42

    1. Initial program 86.1%

      \[\left(\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) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\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) \]
      2. 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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      6. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}{a}}{\left(b \cdot \left(\left(b + a\right) \cdot 2\right)\right) \cdot \left(b - a\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3000000000000 \lor \neg \left(b \leq 2 \cdot 10^{-42}\right):\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{\left(a + b\right) \cdot 2} \cdot \frac{\frac{b - a}{b}}{a}}{b - a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}{a}}{\left(b \cdot \left(\left(b + a\right) \cdot 2\right)\right) \cdot \left(b - a\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 93.6% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+123} \lor \neg \left(b \leq 2 \cdot 10^{+107}\right):\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)} \cdot \left(b - a\right)}{a \cdot b}\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (if (or (<= b -1e+123) (not (<= b 2e+107)))
   (/ (* (/ (PI) b) 0.5) (* a b))
   (/ (* (/ (PI) (* (* 2.0 (+ a b)) (- b a))) (- b a)) (* a b))))
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{+123} \lor \neg \left(b \leq 2 \cdot 10^{+107}\right):\\
\;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)} \cdot \left(b - a\right)}{a \cdot b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -9.99999999999999978e122 or 1.9999999999999999e107 < b

    1. Initial program 61.0%

      \[\left(\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) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\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) \]
      2. 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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      6. associate-*r/N/A

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

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

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

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

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

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

        \[\leadsto \left(\frac{\frac{\mathsf{PI}\left(\right)}{2}}{b + a} \cdot \color{blue}{\frac{1}{b - a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
      13. lower--.f6482.6

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b} \]
    8. Applied rewrites99.8%

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

    if -9.99999999999999978e122 < b < 1.9999999999999999e107

    1. Initial program 90.9%

      \[\left(\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) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\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) \]
      2. 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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      6. associate-*r/N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)} \cdot \left(b - a\right)}{a \cdot b}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+123} \lor \neg \left(b \leq 2 \cdot 10^{+107}\right):\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{\left(2 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)} \cdot \left(b - a\right)}{a \cdot b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 98.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -9.8 \cdot 10^{+76}:\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\ \mathbf{elif}\;b \leq 3.1 \cdot 10^{+62}:\\ \;\;\;\;\frac{\frac{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}{a}}{\left(b \cdot \left(\left(b + a\right) \cdot 2\right)\right) \cdot \left(b - a\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot b\right)} \cdot 0.5\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (if (<= b -9.8e+76)
   (/ (* (/ (PI) b) 0.5) (* a b))
   (if (<= b 3.1e+62)
     (/ (/ (* (- b a) (PI)) a) (* (* b (* (+ b a) 2.0)) (- b a)))
     (* (/ (PI) (* b (* a b))) 0.5))))
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.8 \cdot 10^{+76}:\\
\;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\

\mathbf{elif}\;b \leq 3.1 \cdot 10^{+62}:\\
\;\;\;\;\frac{\frac{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}{a}}{\left(b \cdot \left(\left(b + a\right) \cdot 2\right)\right) \cdot \left(b - a\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot b\right)} \cdot 0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -9.80000000000000053e76

    1. Initial program 71.5%

      \[\left(\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) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\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) \]
      2. 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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      6. associate-*r/N/A

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

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

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

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

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

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

        \[\leadsto \left(\frac{\frac{\mathsf{PI}\left(\right)}{2}}{b + a} \cdot \color{blue}{\frac{1}{b - a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
      13. lower--.f6486.3

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b} \]
    8. Applied rewrites99.9%

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

    if -9.80000000000000053e76 < b < 3.10000000000000014e62

    1. Initial program 89.6%

      \[\left(\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) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\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) \]
      2. 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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      6. associate-*r/N/A

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

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

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

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

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

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

        \[\leadsto \left(\frac{\frac{\mathsf{PI}\left(\right)}{2}}{b + a} \cdot \color{blue}{\frac{1}{b - a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
      13. lower--.f6494.6

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

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

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

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

    if 3.10000000000000014e62 < b

    1. Initial program 68.6%

      \[\left(\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) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\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) \]
      2. 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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      6. associate-*r/N/A

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

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

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

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

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

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

        \[\leadsto \left(\frac{\frac{\mathsf{PI}\left(\right)}{2}}{b + a} \cdot \color{blue}{\frac{1}{b - a}}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
      13. lower--.f6486.6

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

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
    6. 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{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}} \cdot \frac{1}{2} \]
      5. *-commutativeN/A

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

        \[\leadsto \frac{\mathsf{PI}\left(\right)}{{b}^{2} \cdot a} \cdot \frac{1}{2} \]
      7. pow2N/A

        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot \frac{1}{2} \]
      8. lift-*.f6486.7

        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5 \]
    7. Applied rewrites86.7%

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot b\right)} \cdot 0.5 \]
    9. Applied rewrites99.7%

      \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot b\right)} \cdot 0.5 \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -9.8 \cdot 10^{+76}:\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\ \mathbf{elif}\;b \leq 3.1 \cdot 10^{+62}:\\ \;\;\;\;\frac{\frac{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}{a}}{\left(b \cdot \left(\left(b + a\right) \cdot 2\right)\right) \cdot \left(b - a\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot b\right)} \cdot 0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 92.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -3.7 \cdot 10^{+85} \lor \neg \left(b \leq 1.55 \cdot 10^{+118}\right):\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{PI}\left(\right) \cdot b}{\left(a \cdot b\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot b\right)\right)}\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (if (or (<= b -3.7e+85) (not (<= b 1.55e+118)))
   (/ (* (/ (PI) b) 0.5) (* a b))
   (/ (* (PI) b) (* (* a b) (* 2.0 (* (+ b a) b))))))
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.7 \cdot 10^{+85} \lor \neg \left(b \leq 1.55 \cdot 10^{+118}\right):\\
\;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.7000000000000002e85 or 1.54999999999999993e118 < b

    1. Initial program 64.9%

      \[\left(\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) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\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) \]
      2. 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) \]
      3. 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) \]
      4. 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) \]
      5. 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) \]
      6. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b} \]
    8. Applied rewrites99.8%

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

    if -3.7000000000000002e85 < b < 1.54999999999999993e118

    1. Initial program 90.4%

      \[\left(\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) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\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)} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\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) \]
      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. frac-timesN/A

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot b}{\left(a \cdot b\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} \]
    7. Applied rewrites65.1%

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

      \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot b}{\left(a \cdot b\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \color{blue}{b}\right)\right)} \]
    9. Step-by-step derivation
      1. Applied rewrites93.1%

        \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot b}{\left(a \cdot b\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot \color{blue}{b}\right)\right)} \]
    10. Recombined 2 regimes into one program.
    11. Final simplification95.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.7 \cdot 10^{+85} \lor \neg \left(b \leq 1.55 \cdot 10^{+118}\right):\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{PI}\left(\right) \cdot b}{\left(a \cdot b\right) \cdot \left(2 \cdot \left(\left(b + a\right) \cdot b\right)\right)}\\ \end{array} \]
    12. Add Preprocessing

    Alternative 6: 86.9% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.8 \cdot 10^{-38} \lor \neg \left(b \leq 1.02 \cdot 10^{-41}\right):\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot b\right)} \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{a} \cdot 0.5}{a \cdot b}\\ \end{array} \end{array} \]
    (FPCore (a b)
     :precision binary64
     (if (or (<= b -1.8e-38) (not (<= b 1.02e-41)))
       (* (/ (PI) (* b (* a b))) 0.5)
       (/ (* (/ (PI) a) 0.5) (* a b))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq -1.8 \cdot 10^{-38} \lor \neg \left(b \leq 1.02 \cdot 10^{-41}\right):\\
    \;\;\;\;\frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot b\right)} \cdot 0.5\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{a} \cdot 0.5}{a \cdot b}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b < -1.8e-38 or 1.02e-41 < b

      1. Initial program 81.2%

        \[\left(\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) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(\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) \]
        2. 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) \]
        3. 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) \]
        4. 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) \]
        5. 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) \]
        6. associate-*r/N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
      6. 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{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}} \cdot \frac{1}{2} \]
        5. *-commutativeN/A

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

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{{b}^{2} \cdot a} \cdot \frac{1}{2} \]
        7. pow2N/A

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot \frac{1}{2} \]
        8. lift-*.f6477.0

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5 \]
      7. Applied rewrites77.0%

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

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

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

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

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

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

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

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

      if -1.8e-38 < b < 1.02e-41

      1. Initial program 84.1%

        \[\left(\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) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(\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) \]
        2. 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) \]
        3. 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) \]
        4. 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) \]
        5. 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) \]
        6. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{a} \cdot 0.5}}{a \cdot b} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification86.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.8 \cdot 10^{-38} \lor \neg \left(b \leq 1.02 \cdot 10^{-41}\right):\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot b\right)} \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{a} \cdot 0.5}{a \cdot b}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 86.7% accurate, 1.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.8 \cdot 10^{-38} \lor \neg \left(b \leq 1.02 \cdot 10^{-41}\right):\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot b\right)} \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\ \end{array} \end{array} \]
    (FPCore (a b)
     :precision binary64
     (if (or (<= b -1.8e-38) (not (<= b 1.02e-41)))
       (* (/ (PI) (* b (* a b))) 0.5)
       (* (/ (PI) (* a (* a b))) 0.5)))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq -1.8 \cdot 10^{-38} \lor \neg \left(b \leq 1.02 \cdot 10^{-41}\right):\\
    \;\;\;\;\frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot b\right)} \cdot 0.5\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\mathsf{PI}\left(\right)}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b < -1.8e-38 or 1.02e-41 < b

      1. Initial program 81.2%

        \[\left(\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) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(\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) \]
        2. 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) \]
        3. 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) \]
        4. 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) \]
        5. 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) \]
        6. associate-*r/N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
      6. 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{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}} \cdot \frac{1}{2} \]
        5. *-commutativeN/A

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

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{{b}^{2} \cdot a} \cdot \frac{1}{2} \]
        7. pow2N/A

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot \frac{1}{2} \]
        8. lift-*.f6477.0

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5 \]
      7. Applied rewrites77.0%

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

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

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

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

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

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

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

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

      if -1.8e-38 < b < 1.02e-41

      1. Initial program 84.1%

        \[\left(\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) \]
      2. Add Preprocessing
      3. Taylor expanded in a around inf

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
      4. 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{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
        5. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
        6. pow2N/A

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]
      7. Applied rewrites88.7%

        \[\leadsto \frac{\mathsf{PI}\left(\right)}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]
    3. Recombined 2 regimes into one program.
    4. Final simplification86.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.8 \cdot 10^{-38} \lor \neg \left(b \leq 1.02 \cdot 10^{-41}\right):\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot b\right)} \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 79.9% accurate, 1.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.8 \cdot 10^{-38} \lor \neg \left(b \leq 1.02 \cdot 10^{-41}\right):\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\ \end{array} \end{array} \]
    (FPCore (a b)
     :precision binary64
     (if (or (<= b -1.8e-38) (not (<= b 1.02e-41)))
       (* (/ (PI) (* (* b b) a)) 0.5)
       (* (/ (PI) (* a (* a b))) 0.5)))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq -1.8 \cdot 10^{-38} \lor \neg \left(b \leq 1.02 \cdot 10^{-41}\right):\\
    \;\;\;\;\frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\mathsf{PI}\left(\right)}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b < -1.8e-38 or 1.02e-41 < b

      1. Initial program 81.2%

        \[\left(\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) \]
      2. Add Preprocessing
      3. Taylor expanded in a around 0

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
      4. 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{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}} \cdot \frac{1}{2} \]
        5. *-commutativeN/A

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

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{{b}^{2} \cdot a} \cdot \frac{1}{2} \]
        7. pow2N/A

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot \frac{1}{2} \]
        8. lift-*.f6477.0

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5 \]
      5. Applied rewrites77.0%

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

      if -1.8e-38 < b < 1.02e-41

      1. Initial program 84.1%

        \[\left(\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) \]
      2. Add Preprocessing
      3. Taylor expanded in a around inf

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
      4. 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{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
        5. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
        6. pow2N/A

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]
      7. Applied rewrites88.7%

        \[\leadsto \frac{\mathsf{PI}\left(\right)}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]
    3. Recombined 2 regimes into one program.
    4. Final simplification81.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.8 \cdot 10^{-38} \lor \neg \left(b \leq 1.02 \cdot 10^{-41}\right):\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{a \cdot \left(a \cdot b\right)} \cdot 0.5\\ \end{array} \]
    5. Add Preprocessing

    Alternative 9: 62.0% accurate, 2.6× speedup?

    \[\begin{array}{l} \\ \frac{\mathsf{PI}\left(\right)}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \end{array} \]
    (FPCore (a b) :precision binary64 (* (/ (PI) (* a (* a b))) 0.5))
    \begin{array}{l}
    
    \\
    \frac{\mathsf{PI}\left(\right)}{a \cdot \left(a \cdot b\right)} \cdot 0.5
    \end{array}
    
    Derivation
    1. Initial program 82.3%

      \[\left(\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) \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
    4. 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{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
      6. pow2N/A

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

        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(a \cdot a\right) \cdot b} \cdot 0.5 \]
    5. Applied rewrites58.5%

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

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

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

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

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

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

      \[\leadsto \frac{\mathsf{PI}\left(\right)}{a \cdot \left(a \cdot b\right)} \cdot 0.5 \]
    8. Add Preprocessing

    Reproduce

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