NMSE Section 6.1 mentioned, B

Percentage Accurate: 77.9% → 99.7%
Time: 6.3s
Alternatives: 6
Speedup: 2.4×

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 6 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: 77.9% 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.7% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \frac{\frac{\mathsf{PI}\left(\right)}{a + b}}{a \cdot \left(b + b\right)} \end{array} \]
(FPCore (a b) :precision binary64 (/ (/ (PI) (+ a b)) (* a (+ b b))))
\begin{array}{l}

\\
\frac{\frac{\mathsf{PI}\left(\right)}{a + b}}{a \cdot \left(b + b\right)}
\end{array}
Derivation
  1. Initial program 79.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. 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-/.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. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\frac{\mathsf{PI}\left(\right)}{a + b}}{\color{blue}{a \cdot \left(b + b\right)}} \]
  11. Add Preprocessing

Alternative 2: 86.3% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.35 \cdot 10^{+14} \lor \neg \left(b \leq 2.25 \cdot 10^{+17}\right):\\
\;\;\;\;\frac{0.5 \cdot \mathsf{PI}\left(\right)}{b \cdot \left(b \cdot a\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.35e14 or 2.25e17 < b

    1. Initial program 73.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. Taylor expanded in a around 0

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{-0.5 \cdot \left(\frac{\mathsf{PI}\left(\right)}{b} \cdot a - \mathsf{PI}\left(\right)\right)}{b}}{b}}{a}} \]
    5. Step-by-step derivation
      1. Applied rewrites91.6%

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

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

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

        if -1.35e14 < b < 2.25e17

        1. Initial program 84.8%

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{a \cdot a}}{b} \cdot 0.5} \]
        6. Step-by-step derivation
          1. Applied rewrites76.0%

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

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

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

          Alternative 3: 86.2% accurate, 1.8× speedup?

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

            1. Initial program 73.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. Taylor expanded in a around 0

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

              \[\leadsto \color{blue}{\frac{\frac{\frac{-0.5 \cdot \left(\frac{\mathsf{PI}\left(\right)}{b} \cdot a - \mathsf{PI}\left(\right)\right)}{b}}{b}}{a}} \]
            5. Step-by-step derivation
              1. Applied rewrites91.6%

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

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

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

                if -1.35e14 < b < 2.25e17

                1. Initial program 84.8%

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{a \cdot a}}{b} \cdot 0.5} \]
                6. Step-by-step derivation
                  1. Applied rewrites76.0%

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

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

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

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

                    Alternative 4: 99.0% accurate, 2.4× speedup?

                    \[\begin{array}{l} \\ \frac{\mathsf{PI}\left(\right)}{\left(\left(b + a\right) \cdot 2\right) \cdot \left(b \cdot a\right)} \end{array} \]
                    (FPCore (a b) :precision binary64 (/ (PI) (* (* (+ b a) 2.0) (* b a))))
                    \begin{array}{l}
                    
                    \\
                    \frac{\mathsf{PI}\left(\right)}{\left(\left(b + a\right) \cdot 2\right) \cdot \left(b \cdot a\right)}
                    \end{array}
                    
                    Derivation
                    1. Initial program 79.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. 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-/.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. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 5: 62.6% accurate, 2.6× speedup?

                    \[\begin{array}{l} \\ \frac{0.5}{\left(b \cdot a\right) \cdot a} \cdot \mathsf{PI}\left(\right) \end{array} \]
                    (FPCore (a b) :precision binary64 (* (/ 0.5 (* (* b a) a)) (PI)))
                    \begin{array}{l}
                    
                    \\
                    \frac{0.5}{\left(b \cdot a\right) \cdot a} \cdot \mathsf{PI}\left(\right)
                    \end{array}
                    
                    Derivation
                    1. Initial program 79.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 \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
                      2. lower-*.f64N/A

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{a \cdot a}}{b} \cdot 0.5} \]
                    6. Step-by-step derivation
                      1. Applied rewrites59.1%

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

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

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

                          Alternative 6: 56.6% accurate, 2.6× speedup?

                          \[\begin{array}{l} \\ \frac{0.5}{\left(a \cdot a\right) \cdot b} \cdot \mathsf{PI}\left(\right) \end{array} \]
                          (FPCore (a b) :precision binary64 (* (/ 0.5 (* (* a a) b)) (PI)))
                          \begin{array}{l}
                          
                          \\
                          \frac{0.5}{\left(a \cdot a\right) \cdot b} \cdot \mathsf{PI}\left(\right)
                          \end{array}
                          
                          Derivation
                          1. Initial program 79.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 \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
                            2. lower-*.f64N/A

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

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

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

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

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

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

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

                            \[\leadsto \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{a \cdot a}}{b} \cdot 0.5} \]
                          6. Step-by-step derivation
                            1. Applied rewrites59.1%

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

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

                              Reproduce

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