The quadratic formula (r2)

Percentage Accurate: 51.2% → 84.9%
Time: 13.3s
Alternatives: 7
Speedup: 38.7×

Specification

?
\[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]

Your Program's Arguments

Results

Enter valid numbers for all inputs

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 7 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.

Alternative 1: 84.9% accurate, 1.0× speedup?

\[\begin{array}{l} \mathbf{if}\;b \leq -5.2 \cdot 10^{-83}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+83}:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if b < -5.20000000000000018e-83

    1. Initial program 16.4%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. /-rgt-identity16.4%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2 \cdot a}{1}}} \]
      2. metadata-eval16.4%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{2 \cdot a}{\color{blue}{--1}}} \]
      3. associate-/l*16.5%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2}{\frac{--1}{a}}}} \]
      4. associate-/r/16.5%

        \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \cdot \frac{--1}{a}} \]
      5. *-commutative16.5%

        \[\leadsto \color{blue}{\frac{--1}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2}} \]
      6. metadata-eval16.5%

        \[\leadsto \frac{\color{blue}{1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      7. metadata-eval16.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot -1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      8. associate-*l/16.5%

        \[\leadsto \color{blue}{\left(\frac{-1}{a} \cdot -1\right)} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      9. associate-/r/16.5%

        \[\leadsto \color{blue}{\frac{-1}{\frac{a}{-1}}} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      10. times-frac16.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\frac{a}{-1} \cdot 2}} \]
      11. *-commutative16.4%

        \[\leadsto \frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\color{blue}{2 \cdot \frac{a}{-1}}} \]
      12. times-frac16.4%

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}}} \]
      13. metadata-eval16.4%

        \[\leadsto \color{blue}{-0.5} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}} \]
      14. associate-/r/16.4%

        \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a} \cdot -1\right)} \]
      15. *-commutative16.4%

        \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
      16. div-sub14.0%

        \[\leadsto -0.5 \cdot \left(-1 \cdot \color{blue}{\left(\frac{-b}{a} - \frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)}\right) \]
    3. Simplified16.5%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]
    4. Taylor expanded in b around -inf 85.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    5. Step-by-step derivation
      1. associate-*r/85.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-185.0%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    6. Simplified85.0%

      \[\leadsto \color{blue}{\frac{-c}{b}} \]

    if -5.20000000000000018e-83 < b < 5.00000000000000029e83

    1. Initial program 80.8%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]

    if 5.00000000000000029e83 < b

    1. Initial program 60.5%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. /-rgt-identity60.5%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2 \cdot a}{1}}} \]
      2. metadata-eval60.5%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{2 \cdot a}{\color{blue}{--1}}} \]
      3. associate-/l*60.5%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2}{\frac{--1}{a}}}} \]
      4. associate-/r/60.5%

        \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \cdot \frac{--1}{a}} \]
      5. *-commutative60.5%

        \[\leadsto \color{blue}{\frac{--1}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2}} \]
      6. metadata-eval60.5%

        \[\leadsto \frac{\color{blue}{1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      7. metadata-eval60.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot -1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      8. associate-*l/60.5%

        \[\leadsto \color{blue}{\left(\frac{-1}{a} \cdot -1\right)} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      9. associate-/r/60.5%

        \[\leadsto \color{blue}{\frac{-1}{\frac{a}{-1}}} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      10. times-frac60.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\frac{a}{-1} \cdot 2}} \]
      11. *-commutative60.5%

        \[\leadsto \frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\color{blue}{2 \cdot \frac{a}{-1}}} \]
      12. times-frac60.5%

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}}} \]
      13. metadata-eval60.5%

        \[\leadsto \color{blue}{-0.5} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}} \]
      14. associate-/r/60.5%

        \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a} \cdot -1\right)} \]
      15. *-commutative60.5%

        \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
      16. div-sub60.5%

        \[\leadsto -0.5 \cdot \left(-1 \cdot \color{blue}{\left(\frac{-b}{a} - \frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)}\right) \]
    3. Simplified60.5%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]
    4. Taylor expanded in b around inf 96.8%

      \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg96.8%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      2. unsub-neg96.8%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    6. Simplified96.8%

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification86.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.2 \cdot 10^{-83}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+83}:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]

Alternative 2: 80.2% accurate, 1.0× speedup?

\[\begin{array}{l} \mathbf{if}\;b \leq -1.45 \cdot 10^{-82}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 9.8 \cdot 10^{-9}:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{c \cdot \left(a \cdot -4\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if b < -1.44999999999999989e-82

    1. Initial program 16.4%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. /-rgt-identity16.4%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2 \cdot a}{1}}} \]
      2. metadata-eval16.4%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{2 \cdot a}{\color{blue}{--1}}} \]
      3. associate-/l*16.5%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2}{\frac{--1}{a}}}} \]
      4. associate-/r/16.5%

        \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \cdot \frac{--1}{a}} \]
      5. *-commutative16.5%

        \[\leadsto \color{blue}{\frac{--1}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2}} \]
      6. metadata-eval16.5%

        \[\leadsto \frac{\color{blue}{1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      7. metadata-eval16.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot -1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      8. associate-*l/16.5%

        \[\leadsto \color{blue}{\left(\frac{-1}{a} \cdot -1\right)} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      9. associate-/r/16.5%

        \[\leadsto \color{blue}{\frac{-1}{\frac{a}{-1}}} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      10. times-frac16.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\frac{a}{-1} \cdot 2}} \]
      11. *-commutative16.4%

        \[\leadsto \frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\color{blue}{2 \cdot \frac{a}{-1}}} \]
      12. times-frac16.4%

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}}} \]
      13. metadata-eval16.4%

        \[\leadsto \color{blue}{-0.5} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}} \]
      14. associate-/r/16.4%

        \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a} \cdot -1\right)} \]
      15. *-commutative16.4%

        \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
      16. div-sub14.0%

        \[\leadsto -0.5 \cdot \left(-1 \cdot \color{blue}{\left(\frac{-b}{a} - \frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)}\right) \]
    3. Simplified16.5%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]
    4. Taylor expanded in b around -inf 85.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    5. Step-by-step derivation
      1. associate-*r/85.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-185.0%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    6. Simplified85.0%

      \[\leadsto \color{blue}{\frac{-c}{b}} \]

    if -1.44999999999999989e-82 < b < 9.80000000000000007e-9

    1. Initial program 78.6%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. /-rgt-identity78.6%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2 \cdot a}{1}}} \]
      2. metadata-eval78.6%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{2 \cdot a}{\color{blue}{--1}}} \]
      3. associate-/l*78.5%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2}{\frac{--1}{a}}}} \]
      4. associate-/r/78.4%

        \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \cdot \frac{--1}{a}} \]
      5. *-commutative78.4%

        \[\leadsto \color{blue}{\frac{--1}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2}} \]
      6. metadata-eval78.4%

        \[\leadsto \frac{\color{blue}{1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      7. metadata-eval78.4%

        \[\leadsto \frac{\color{blue}{-1 \cdot -1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      8. associate-*l/78.4%

        \[\leadsto \color{blue}{\left(\frac{-1}{a} \cdot -1\right)} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      9. associate-/r/78.4%

        \[\leadsto \color{blue}{\frac{-1}{\frac{a}{-1}}} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      10. times-frac78.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\frac{a}{-1} \cdot 2}} \]
      11. *-commutative78.6%

        \[\leadsto \frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\color{blue}{2 \cdot \frac{a}{-1}}} \]
      12. times-frac78.6%

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}}} \]
      13. metadata-eval78.6%

        \[\leadsto \color{blue}{-0.5} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}} \]
      14. associate-/r/78.6%

        \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a} \cdot -1\right)} \]
      15. *-commutative78.6%

        \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
      16. div-sub78.6%

        \[\leadsto -0.5 \cdot \left(-1 \cdot \color{blue}{\left(\frac{-b}{a} - \frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)}\right) \]
    3. Simplified78.6%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]
    4. Step-by-step derivation
      1. add-cbrt-cube62.8%

        \[\leadsto -0.5 \cdot \frac{b + \color{blue}{\sqrt[3]{\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right) \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}}}{a} \]
      2. pow362.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{\color{blue}{{\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}^{3}}}}{a} \]
      3. pow1/358.8%

        \[\leadsto -0.5 \cdot \frac{b + \color{blue}{{\left({\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}^{3}\right)}^{0.3333333333333333}}}{a} \]
      4. sqrt-pow258.8%

        \[\leadsto -0.5 \cdot \frac{b + {\color{blue}{\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{\left(\frac{3}{2}\right)}\right)}}^{0.3333333333333333}}{a} \]
      5. metadata-eval58.8%

        \[\leadsto -0.5 \cdot \frac{b + {\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{\color{blue}{1.5}}\right)}^{0.3333333333333333}}{a} \]
    5. Applied egg-rr58.8%

      \[\leadsto -0.5 \cdot \frac{b + \color{blue}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{1.5}\right)}^{0.3333333333333333}}}{a} \]
    6. Step-by-step derivation
      1. unpow1/362.7%

        \[\leadsto -0.5 \cdot \frac{b + \color{blue}{\sqrt[3]{{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{1.5}}}}{a} \]
      2. fma-udef62.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + b \cdot b\right)}}^{1.5}}}{a} \]
      3. +-commutative62.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\color{blue}{\left(b \cdot b + a \cdot \left(c \cdot -4\right)\right)}}^{1.5}}}{a} \]
      4. associate-*r*62.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\left(b \cdot b + \color{blue}{\left(a \cdot c\right) \cdot -4}\right)}^{1.5}}}{a} \]
      5. metadata-eval62.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\left(b \cdot b + \left(a \cdot c\right) \cdot \color{blue}{\left(-4\right)}\right)}^{1.5}}}{a} \]
      6. distribute-rgt-neg-in62.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\left(b \cdot b + \color{blue}{\left(-\left(a \cdot c\right) \cdot 4\right)}\right)}^{1.5}}}{a} \]
      7. associate-*r*62.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\left(b \cdot b + \left(-\color{blue}{a \cdot \left(c \cdot 4\right)}\right)\right)}^{1.5}}}{a} \]
      8. *-rgt-identity62.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\left(b \cdot b + \left(-\color{blue}{\left(a \cdot \left(c \cdot 4\right)\right) \cdot 1}\right)\right)}^{1.5}}}{a} \]
      9. fma-udef62.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\color{blue}{\left(\mathsf{fma}\left(b, b, -\left(a \cdot \left(c \cdot 4\right)\right) \cdot 1\right)\right)}}^{1.5}}}{a} \]
      10. *-rgt-identity62.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\color{blue}{a \cdot \left(c \cdot 4\right)}\right)\right)}^{1.5}}}{a} \]
      11. *-commutative62.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\color{blue}{\left(c \cdot 4\right) \cdot a}\right)\right)}^{1.5}}}{a} \]
      12. associate-*r*62.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\color{blue}{c \cdot \left(4 \cdot a\right)}\right)\right)}^{1.5}}}{a} \]
      13. distribute-rgt-neg-in62.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\left(\mathsf{fma}\left(b, b, \color{blue}{c \cdot \left(-4 \cdot a\right)}\right)\right)}^{1.5}}}{a} \]
      14. *-commutative62.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\left(\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 4}\right)\right)\right)}^{1.5}}}{a} \]
      15. distribute-rgt-neg-in62.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\left(\mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot \left(-4\right)\right)}\right)\right)}^{1.5}}}{a} \]
      16. metadata-eval62.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot \color{blue}{-4}\right)\right)\right)}^{1.5}}}{a} \]
    7. Simplified62.8%

      \[\leadsto -0.5 \cdot \frac{b + \color{blue}{\sqrt[3]{{\left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)\right)}^{1.5}}}}{a} \]
    8. Taylor expanded in b around 0 55.0%

      \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\color{blue}{\left(-4 \cdot \left(c \cdot a\right)\right)}}^{1.5}}}{a} \]
    9. Step-by-step derivation
      1. associate-*r*55.0%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\color{blue}{\left(\left(-4 \cdot c\right) \cdot a\right)}}^{1.5}}}{a} \]
      2. *-commutative55.0%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\left(\color{blue}{\left(c \cdot -4\right)} \cdot a\right)}^{1.5}}}{a} \]
    10. Simplified55.0%

      \[\leadsto -0.5 \cdot \frac{b + \sqrt[3]{{\color{blue}{\left(\left(c \cdot -4\right) \cdot a\right)}}^{1.5}}}{a} \]
    11. Step-by-step derivation
      1. pow1/351.6%

        \[\leadsto -0.5 \cdot \frac{b + \color{blue}{{\left({\left(\left(c \cdot -4\right) \cdot a\right)}^{1.5}\right)}^{0.3333333333333333}}}{a} \]
      2. associate-*l*51.6%

        \[\leadsto -0.5 \cdot \frac{b + {\left({\color{blue}{\left(c \cdot \left(-4 \cdot a\right)\right)}}^{1.5}\right)}^{0.3333333333333333}}{a} \]
      3. *-commutative51.6%

        \[\leadsto -0.5 \cdot \frac{b + {\left({\left(c \cdot \color{blue}{\left(a \cdot -4\right)}\right)}^{1.5}\right)}^{0.3333333333333333}}{a} \]
      4. pow-pow68.9%

        \[\leadsto -0.5 \cdot \frac{b + \color{blue}{{\left(c \cdot \left(a \cdot -4\right)\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}}}{a} \]
      5. metadata-eval68.9%

        \[\leadsto -0.5 \cdot \frac{b + {\left(c \cdot \left(a \cdot -4\right)\right)}^{\color{blue}{0.5}}}{a} \]
      6. pow1/268.9%

        \[\leadsto -0.5 \cdot \frac{b + \color{blue}{\sqrt{c \cdot \left(a \cdot -4\right)}}}{a} \]
      7. expm1-log1p-u66.2%

        \[\leadsto -0.5 \cdot \frac{b + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{c \cdot \left(a \cdot -4\right)}\right)\right)}}{a} \]
      8. expm1-udef44.1%

        \[\leadsto -0.5 \cdot \frac{b + \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{c \cdot \left(a \cdot -4\right)}\right)} - 1\right)}}{a} \]
      9. *-commutative44.1%

        \[\leadsto -0.5 \cdot \frac{b + \left(e^{\mathsf{log1p}\left(\sqrt{c \cdot \color{blue}{\left(-4 \cdot a\right)}}\right)} - 1\right)}{a} \]
      10. associate-*l*44.1%

        \[\leadsto -0.5 \cdot \frac{b + \left(e^{\mathsf{log1p}\left(\sqrt{\color{blue}{\left(c \cdot -4\right) \cdot a}}\right)} - 1\right)}{a} \]
      11. *-commutative44.1%

        \[\leadsto -0.5 \cdot \frac{b + \left(e^{\mathsf{log1p}\left(\sqrt{\color{blue}{a \cdot \left(c \cdot -4\right)}}\right)} - 1\right)}{a} \]
    12. Applied egg-rr44.1%

      \[\leadsto -0.5 \cdot \frac{b + \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{a \cdot \left(c \cdot -4\right)}\right)} - 1\right)}}{a} \]
    13. Step-by-step derivation
      1. expm1-def66.2%

        \[\leadsto -0.5 \cdot \frac{b + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{a \cdot \left(c \cdot -4\right)}\right)\right)}}{a} \]
      2. expm1-log1p68.9%

        \[\leadsto -0.5 \cdot \frac{b + \color{blue}{\sqrt{a \cdot \left(c \cdot -4\right)}}}{a} \]
      3. *-commutative68.9%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(c \cdot -4\right) \cdot a}}}{a} \]
      4. associate-*r*68.9%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{c \cdot \left(-4 \cdot a\right)}}}{a} \]
    14. Simplified68.9%

      \[\leadsto -0.5 \cdot \frac{b + \color{blue}{\sqrt{c \cdot \left(-4 \cdot a\right)}}}{a} \]

    if 9.80000000000000007e-9 < b

    1. Initial program 67.4%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. /-rgt-identity67.4%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2 \cdot a}{1}}} \]
      2. metadata-eval67.4%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{2 \cdot a}{\color{blue}{--1}}} \]
      3. associate-/l*67.3%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2}{\frac{--1}{a}}}} \]
      4. associate-/r/67.3%

        \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \cdot \frac{--1}{a}} \]
      5. *-commutative67.3%

        \[\leadsto \color{blue}{\frac{--1}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2}} \]
      6. metadata-eval67.3%

        \[\leadsto \frac{\color{blue}{1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      7. metadata-eval67.3%

        \[\leadsto \frac{\color{blue}{-1 \cdot -1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      8. associate-*l/67.3%

        \[\leadsto \color{blue}{\left(\frac{-1}{a} \cdot -1\right)} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      9. associate-/r/67.3%

        \[\leadsto \color{blue}{\frac{-1}{\frac{a}{-1}}} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      10. times-frac67.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\frac{a}{-1} \cdot 2}} \]
      11. *-commutative67.4%

        \[\leadsto \frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\color{blue}{2 \cdot \frac{a}{-1}}} \]
      12. times-frac67.4%

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}}} \]
      13. metadata-eval67.4%

        \[\leadsto \color{blue}{-0.5} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}} \]
      14. associate-/r/67.4%

        \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a} \cdot -1\right)} \]
      15. *-commutative67.4%

        \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
      16. div-sub67.4%

        \[\leadsto -0.5 \cdot \left(-1 \cdot \color{blue}{\left(\frac{-b}{a} - \frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)}\right) \]
    3. Simplified67.4%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]
    4. Taylor expanded in b around inf 93.6%

      \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg93.6%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      2. unsub-neg93.6%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    6. Simplified93.6%

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.45 \cdot 10^{-82}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 9.8 \cdot 10^{-9}:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{c \cdot \left(a \cdot -4\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]

Alternative 3: 68.4% accurate, 12.8× speedup?

\[\begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if b < -3.999999999999988e-310

    1. Initial program 29.6%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. /-rgt-identity29.6%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2 \cdot a}{1}}} \]
      2. metadata-eval29.6%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{2 \cdot a}{\color{blue}{--1}}} \]
      3. associate-/l*29.6%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2}{\frac{--1}{a}}}} \]
      4. associate-/r/29.6%

        \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \cdot \frac{--1}{a}} \]
      5. *-commutative29.6%

        \[\leadsto \color{blue}{\frac{--1}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2}} \]
      6. metadata-eval29.6%

        \[\leadsto \frac{\color{blue}{1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      7. metadata-eval29.6%

        \[\leadsto \frac{\color{blue}{-1 \cdot -1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      8. associate-*l/29.6%

        \[\leadsto \color{blue}{\left(\frac{-1}{a} \cdot -1\right)} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      9. associate-/r/29.6%

        \[\leadsto \color{blue}{\frac{-1}{\frac{a}{-1}}} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      10. times-frac29.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\frac{a}{-1} \cdot 2}} \]
      11. *-commutative29.6%

        \[\leadsto \frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\color{blue}{2 \cdot \frac{a}{-1}}} \]
      12. times-frac29.6%

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}}} \]
      13. metadata-eval29.6%

        \[\leadsto \color{blue}{-0.5} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}} \]
      14. associate-/r/29.6%

        \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a} \cdot -1\right)} \]
      15. *-commutative29.6%

        \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
      16. div-sub27.8%

        \[\leadsto -0.5 \cdot \left(-1 \cdot \color{blue}{\left(\frac{-b}{a} - \frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)}\right) \]
    3. Simplified29.6%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]
    4. Taylor expanded in b around -inf 68.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    5. Step-by-step derivation
      1. associate-*r/68.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-168.7%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    6. Simplified68.7%

      \[\leadsto \color{blue}{\frac{-c}{b}} \]

    if -3.999999999999988e-310 < b

    1. Initial program 73.9%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. /-rgt-identity73.9%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2 \cdot a}{1}}} \]
      2. metadata-eval73.9%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{2 \cdot a}{\color{blue}{--1}}} \]
      3. associate-/l*73.8%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2}{\frac{--1}{a}}}} \]
      4. associate-/r/73.7%

        \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \cdot \frac{--1}{a}} \]
      5. *-commutative73.7%

        \[\leadsto \color{blue}{\frac{--1}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2}} \]
      6. metadata-eval73.7%

        \[\leadsto \frac{\color{blue}{1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      7. metadata-eval73.7%

        \[\leadsto \frac{\color{blue}{-1 \cdot -1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      8. associate-*l/73.7%

        \[\leadsto \color{blue}{\left(\frac{-1}{a} \cdot -1\right)} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      9. associate-/r/73.7%

        \[\leadsto \color{blue}{\frac{-1}{\frac{a}{-1}}} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      10. times-frac73.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\frac{a}{-1} \cdot 2}} \]
      11. *-commutative73.9%

        \[\leadsto \frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\color{blue}{2 \cdot \frac{a}{-1}}} \]
      12. times-frac73.9%

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}}} \]
      13. metadata-eval73.9%

        \[\leadsto \color{blue}{-0.5} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}} \]
      14. associate-/r/73.9%

        \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a} \cdot -1\right)} \]
      15. *-commutative73.9%

        \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
      16. div-sub73.9%

        \[\leadsto -0.5 \cdot \left(-1 \cdot \color{blue}{\left(\frac{-b}{a} - \frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)}\right) \]
    3. Simplified73.9%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]
    4. Taylor expanded in b around inf 63.6%

      \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
    5. Step-by-step derivation
      1. mul-1-neg63.6%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      2. unsub-neg63.6%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    6. Simplified63.6%

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]

Alternative 4: 43.8% accurate, 19.1× speedup?

\[\begin{array}{l} \mathbf{if}\;b \leq -2.5 \cdot 10^{+20}:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if b < -2.5e20

    1. Initial program 11.5%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. /-rgt-identity11.5%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2 \cdot a}{1}}} \]
      2. metadata-eval11.5%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{2 \cdot a}{\color{blue}{--1}}} \]
      3. associate-/l*11.5%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2}{\frac{--1}{a}}}} \]
      4. associate-/r/11.5%

        \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \cdot \frac{--1}{a}} \]
      5. *-commutative11.5%

        \[\leadsto \color{blue}{\frac{--1}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2}} \]
      6. metadata-eval11.5%

        \[\leadsto \frac{\color{blue}{1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      7. metadata-eval11.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot -1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      8. associate-*l/11.5%

        \[\leadsto \color{blue}{\left(\frac{-1}{a} \cdot -1\right)} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      9. associate-/r/11.5%

        \[\leadsto \color{blue}{\frac{-1}{\frac{a}{-1}}} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      10. times-frac11.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\frac{a}{-1} \cdot 2}} \]
      11. *-commutative11.5%

        \[\leadsto \frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\color{blue}{2 \cdot \frac{a}{-1}}} \]
      12. times-frac11.5%

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}}} \]
      13. metadata-eval11.5%

        \[\leadsto \color{blue}{-0.5} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}} \]
      14. associate-/r/11.5%

        \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a} \cdot -1\right)} \]
      15. *-commutative11.5%

        \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
      16. div-sub8.3%

        \[\leadsto -0.5 \cdot \left(-1 \cdot \color{blue}{\left(\frac{-b}{a} - \frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)}\right) \]
    3. Simplified11.5%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]
    4. Step-by-step derivation
      1. clear-num11.5%

        \[\leadsto -0.5 \cdot \color{blue}{\frac{1}{\frac{a}{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}}} \]
      2. un-div-inv11.5%

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{a}{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}}} \]
    5. Applied egg-rr11.5%

      \[\leadsto \color{blue}{\frac{-0.5}{\frac{a}{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}}} \]
    6. Taylor expanded in b around inf 2.4%

      \[\leadsto \frac{-0.5}{\frac{a}{\color{blue}{-2 \cdot \frac{c \cdot a}{b} + 2 \cdot b}}} \]
    7. Taylor expanded in a around inf 31.7%

      \[\leadsto \color{blue}{\frac{c}{b}} \]

    if -2.5e20 < b

    1. Initial program 68.3%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. /-rgt-identity68.3%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2 \cdot a}{1}}} \]
      2. metadata-eval68.3%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{2 \cdot a}{\color{blue}{--1}}} \]
      3. associate-/l*68.2%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2}{\frac{--1}{a}}}} \]
      4. associate-/r/68.2%

        \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \cdot \frac{--1}{a}} \]
      5. *-commutative68.2%

        \[\leadsto \color{blue}{\frac{--1}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2}} \]
      6. metadata-eval68.2%

        \[\leadsto \frac{\color{blue}{1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      7. metadata-eval68.2%

        \[\leadsto \frac{\color{blue}{-1 \cdot -1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      8. associate-*l/68.2%

        \[\leadsto \color{blue}{\left(\frac{-1}{a} \cdot -1\right)} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      9. associate-/r/68.2%

        \[\leadsto \color{blue}{\frac{-1}{\frac{a}{-1}}} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      10. times-frac68.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\frac{a}{-1} \cdot 2}} \]
      11. *-commutative68.3%

        \[\leadsto \frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\color{blue}{2 \cdot \frac{a}{-1}}} \]
      12. times-frac68.3%

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}}} \]
      13. metadata-eval68.3%

        \[\leadsto \color{blue}{-0.5} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}} \]
      14. associate-/r/68.3%

        \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a} \cdot -1\right)} \]
      15. *-commutative68.3%

        \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
      16. div-sub68.3%

        \[\leadsto -0.5 \cdot \left(-1 \cdot \color{blue}{\left(\frac{-b}{a} - \frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)}\right) \]
    3. Simplified68.3%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]
    4. Taylor expanded in b around inf 44.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    5. Step-by-step derivation
      1. associate-*r/44.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot b}{a}} \]
      2. mul-1-neg44.9%

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    6. Simplified44.9%

      \[\leadsto \color{blue}{\frac{-b}{a}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification41.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.5 \cdot 10^{+20}:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \]

Alternative 5: 68.2% accurate, 19.1× speedup?

\[\begin{array}{l} \mathbf{if}\;b \leq -2.5 \cdot 10^{-243}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if b < -2.5e-243

    1. Initial program 27.2%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. /-rgt-identity27.2%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2 \cdot a}{1}}} \]
      2. metadata-eval27.2%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{2 \cdot a}{\color{blue}{--1}}} \]
      3. associate-/l*27.2%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2}{\frac{--1}{a}}}} \]
      4. associate-/r/27.2%

        \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \cdot \frac{--1}{a}} \]
      5. *-commutative27.2%

        \[\leadsto \color{blue}{\frac{--1}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2}} \]
      6. metadata-eval27.2%

        \[\leadsto \frac{\color{blue}{1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      7. metadata-eval27.2%

        \[\leadsto \frac{\color{blue}{-1 \cdot -1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      8. associate-*l/27.2%

        \[\leadsto \color{blue}{\left(\frac{-1}{a} \cdot -1\right)} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      9. associate-/r/27.2%

        \[\leadsto \color{blue}{\frac{-1}{\frac{a}{-1}}} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      10. times-frac27.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\frac{a}{-1} \cdot 2}} \]
      11. *-commutative27.2%

        \[\leadsto \frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\color{blue}{2 \cdot \frac{a}{-1}}} \]
      12. times-frac27.2%

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}}} \]
      13. metadata-eval27.2%

        \[\leadsto \color{blue}{-0.5} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}} \]
      14. associate-/r/27.2%

        \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a} \cdot -1\right)} \]
      15. *-commutative27.2%

        \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
      16. div-sub25.2%

        \[\leadsto -0.5 \cdot \left(-1 \cdot \color{blue}{\left(\frac{-b}{a} - \frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)}\right) \]
    3. Simplified27.2%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]
    4. Taylor expanded in b around -inf 72.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    5. Step-by-step derivation
      1. associate-*r/72.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-172.4%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    6. Simplified72.4%

      \[\leadsto \color{blue}{\frac{-c}{b}} \]

    if -2.5e-243 < b

    1. Initial program 73.8%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. /-rgt-identity73.8%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2 \cdot a}{1}}} \]
      2. metadata-eval73.8%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{2 \cdot a}{\color{blue}{--1}}} \]
      3. associate-/l*73.7%

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2}{\frac{--1}{a}}}} \]
      4. associate-/r/73.6%

        \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \cdot \frac{--1}{a}} \]
      5. *-commutative73.6%

        \[\leadsto \color{blue}{\frac{--1}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2}} \]
      6. metadata-eval73.6%

        \[\leadsto \frac{\color{blue}{1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      7. metadata-eval73.6%

        \[\leadsto \frac{\color{blue}{-1 \cdot -1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      8. associate-*l/73.6%

        \[\leadsto \color{blue}{\left(\frac{-1}{a} \cdot -1\right)} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      9. associate-/r/73.6%

        \[\leadsto \color{blue}{\frac{-1}{\frac{a}{-1}}} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
      10. times-frac73.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\frac{a}{-1} \cdot 2}} \]
      11. *-commutative73.8%

        \[\leadsto \frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\color{blue}{2 \cdot \frac{a}{-1}}} \]
      12. times-frac73.8%

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}}} \]
      13. metadata-eval73.8%

        \[\leadsto \color{blue}{-0.5} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}} \]
      14. associate-/r/73.8%

        \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a} \cdot -1\right)} \]
      15. *-commutative73.8%

        \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
      16. div-sub73.8%

        \[\leadsto -0.5 \cdot \left(-1 \cdot \color{blue}{\left(\frac{-b}{a} - \frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)}\right) \]
    3. Simplified73.8%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]
    4. Taylor expanded in b around inf 59.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    5. Step-by-step derivation
      1. associate-*r/59.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot b}{a}} \]
      2. mul-1-neg59.7%

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    6. Simplified59.7%

      \[\leadsto \color{blue}{\frac{-b}{a}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification65.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.5 \cdot 10^{-243}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \]

Alternative 6: 2.5% accurate, 38.7× speedup?

\[\frac{b}{a} \]
Derivation
  1. Initial program 51.4%

    \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
  2. Step-by-step derivation
    1. clear-num51.3%

      \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}} \]
    2. associate-/r/51.3%

      \[\leadsto \color{blue}{\frac{1}{2 \cdot a} \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)} \]
    3. associate-/r*51.3%

      \[\leadsto \color{blue}{\frac{\frac{1}{2}}{a}} \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
    4. metadata-eval51.3%

      \[\leadsto \frac{\color{blue}{0.5}}{a} \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
    5. add-sqr-sqrt13.8%

      \[\leadsto \frac{0.5}{a} \cdot \left(\color{blue}{\sqrt{-b} \cdot \sqrt{-b}} - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
    6. sqrt-unprod29.7%

      \[\leadsto \frac{0.5}{a} \cdot \left(\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}} - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
    7. sqr-neg29.7%

      \[\leadsto \frac{0.5}{a} \cdot \left(\sqrt{\color{blue}{b \cdot b}} - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
    8. sqrt-prod23.9%

      \[\leadsto \frac{0.5}{a} \cdot \left(\color{blue}{\sqrt{b} \cdot \sqrt{b}} - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
    9. add-sqr-sqrt35.6%

      \[\leadsto \frac{0.5}{a} \cdot \left(\color{blue}{b} - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \]
    10. fma-neg35.6%

      \[\leadsto \frac{0.5}{a} \cdot \left(b - \sqrt{\color{blue}{\mathsf{fma}\left(b, b, -4 \cdot \left(a \cdot c\right)\right)}}\right) \]
    11. *-commutative35.6%

      \[\leadsto \frac{0.5}{a} \cdot \left(b - \sqrt{\mathsf{fma}\left(b, b, -\color{blue}{\left(a \cdot c\right) \cdot 4}\right)}\right) \]
    12. distribute-rgt-neg-in35.6%

      \[\leadsto \frac{0.5}{a} \cdot \left(b - \sqrt{\mathsf{fma}\left(b, b, \color{blue}{\left(a \cdot c\right) \cdot \left(-4\right)}\right)}\right) \]
    13. metadata-eval35.6%

      \[\leadsto \frac{0.5}{a} \cdot \left(b - \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot \color{blue}{-4}\right)}\right) \]
    14. associate-*r*35.6%

      \[\leadsto \frac{0.5}{a} \cdot \left(b - \sqrt{\mathsf{fma}\left(b, b, \color{blue}{a \cdot \left(c \cdot -4\right)}\right)}\right) \]
  3. Applied egg-rr35.6%

    \[\leadsto \color{blue}{\frac{0.5}{a} \cdot \left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)} \]
  4. Taylor expanded in b around -inf 2.6%

    \[\leadsto \color{blue}{\frac{b}{a}} \]
  5. Final simplification2.6%

    \[\leadsto \frac{b}{a} \]

Alternative 7: 11.8% accurate, 38.7× speedup?

\[\frac{c}{b} \]
Derivation
  1. Initial program 51.4%

    \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
  2. Step-by-step derivation
    1. /-rgt-identity51.4%

      \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2 \cdot a}{1}}} \]
    2. metadata-eval51.4%

      \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{2 \cdot a}{\color{blue}{--1}}} \]
    3. associate-/l*51.3%

      \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2}{\frac{--1}{a}}}} \]
    4. associate-/r/51.3%

      \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \cdot \frac{--1}{a}} \]
    5. *-commutative51.3%

      \[\leadsto \color{blue}{\frac{--1}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2}} \]
    6. metadata-eval51.3%

      \[\leadsto \frac{\color{blue}{1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
    7. metadata-eval51.3%

      \[\leadsto \frac{\color{blue}{-1 \cdot -1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
    8. associate-*l/51.3%

      \[\leadsto \color{blue}{\left(\frac{-1}{a} \cdot -1\right)} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
    9. associate-/r/51.3%

      \[\leadsto \color{blue}{\frac{-1}{\frac{a}{-1}}} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]
    10. times-frac51.4%

      \[\leadsto \color{blue}{\frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\frac{a}{-1} \cdot 2}} \]
    11. *-commutative51.4%

      \[\leadsto \frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\color{blue}{2 \cdot \frac{a}{-1}}} \]
    12. times-frac51.4%

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}}} \]
    13. metadata-eval51.4%

      \[\leadsto \color{blue}{-0.5} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}} \]
    14. associate-/r/51.4%

      \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a} \cdot -1\right)} \]
    15. *-commutative51.4%

      \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
    16. div-sub50.5%

      \[\leadsto -0.5 \cdot \left(-1 \cdot \color{blue}{\left(\frac{-b}{a} - \frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)}\right) \]
  3. Simplified51.4%

    \[\leadsto \color{blue}{-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]
  4. Step-by-step derivation
    1. clear-num51.3%

      \[\leadsto -0.5 \cdot \color{blue}{\frac{1}{\frac{a}{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}}} \]
    2. un-div-inv51.3%

      \[\leadsto \color{blue}{\frac{-0.5}{\frac{a}{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}}} \]
  5. Applied egg-rr51.3%

    \[\leadsto \color{blue}{\frac{-0.5}{\frac{a}{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}}} \]
  6. Taylor expanded in b around inf 32.1%

    \[\leadsto \frac{-0.5}{\frac{a}{\color{blue}{-2 \cdot \frac{c \cdot a}{b} + 2 \cdot b}}} \]
  7. Taylor expanded in a around inf 11.6%

    \[\leadsto \color{blue}{\frac{c}{b}} \]
  8. Final simplification11.6%

    \[\leadsto \frac{c}{b} \]

Developer target: 70.4% accurate, 1.0× speedup?

\[\begin{array}{l} \mathbf{if}\;b < 0:\\ \;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\\ \end{array} \]

Reproduce

?
herbie shell --seed 2023167 
(FPCore (a b c)
  :name "The quadratic formula (r2)"
  :precision binary64

  :herbie-target
  (if (< b 0.0) (/ c (* a (/ (+ (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))) (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))

  (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))