Average Error: 10.9 → 11.0
Time: 30.1s
Precision: 64
Internal Precision: 384
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
\[\begin{array}{l} \mathbf{if}\;a2 \le -3.0479637035265785 \cdot 10^{+207}:\\ \;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\ \mathbf{if}\;a2 \le -7.20153105055616 \cdot 10^{+66}:\\ \;\;\;\;\frac{\frac{a1}{b1 \cdot b2}}{\frac{1}{a2}}\\ \mathbf{if}\;a2 \le -1.5416890105866388 \cdot 10^{-97}:\\ \;\;\;\;a1 \cdot \frac{\frac{a2}{b1}}{b2}\\ \mathbf{if}\;a2 \le -2.1538731346239785 \cdot 10^{-256}:\\ \;\;\;\;\frac{\frac{a1 \cdot a2}{b1}}{b2}\\ \mathbf{if}\;a2 \le 5.701154346137465 \cdot 10^{-243}:\\ \;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\ \mathbf{if}\;a2 \le 7.219968817692392 \cdot 10^{-103}:\\ \;\;\;\;\left(a1 \cdot \frac{1}{b1 \cdot b2}\right) \cdot a2\\ \mathbf{if}\;a2 \le 1.7037602706608895 \cdot 10^{+94}:\\ \;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\ \mathbf{if}\;a2 \le 3.2705679617905636 \cdot 10^{+171}:\\ \;\;\;\;\frac{\frac{a1}{b1 \cdot b2}}{\frac{1}{a2}}\\ \mathbf{if}\;a2 \le 9.309401273607693 \cdot 10^{+249}:\\ \;\;\;\;\frac{a1}{b1} \cdot \frac{a2}{b2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{a1}{b1 \cdot b2}}{\frac{1}{a2}}\\ \end{array}\]

Error

Bits error versus a1

Bits error versus a2

Bits error versus b1

Bits error versus b2

Target

Original10.9
Target11.4
Herbie11.0
\[\frac{a1}{b1} \cdot \frac{a2}{b2}\]

Derivation

  1. Split input into 6 regimes
  2. if a2 < -3.0479637035265785e+207 or -2.1538731346239785e-256 < a2 < 5.701154346137465e-243

    1. Initial program 14.0

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied times-frac14.4

      \[\leadsto \color{blue}{\frac{a1}{b1} \cdot \frac{a2}{b2}}\]

    if -3.0479637035265785e+207 < a2 < -7.20153105055616e+66 or 1.7037602706608895e+94 < a2 < 3.2705679617905636e+171 or 9.309401273607693e+249 < a2

    1. Initial program 13.9

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied associate-/l*13.6

      \[\leadsto \color{blue}{\frac{a1}{\frac{b1 \cdot b2}{a2}}}\]
    4. Using strategy rm
    5. Applied div-inv13.7

      \[\leadsto \frac{a1}{\color{blue}{\left(b1 \cdot b2\right) \cdot \frac{1}{a2}}}\]
    6. Applied associate-/r*12.9

      \[\leadsto \color{blue}{\frac{\frac{a1}{b1 \cdot b2}}{\frac{1}{a2}}}\]

    if -7.20153105055616e+66 < a2 < -1.5416890105866388e-97

    1. Initial program 7.8

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied associate-/l*7.5

      \[\leadsto \color{blue}{\frac{a1}{\frac{b1 \cdot b2}{a2}}}\]
    4. Using strategy rm
    5. Applied div-inv7.7

      \[\leadsto \color{blue}{a1 \cdot \frac{1}{\frac{b1 \cdot b2}{a2}}}\]
    6. Applied simplify8.1

      \[\leadsto a1 \cdot \color{blue}{\frac{\frac{a2}{b1}}{b2}}\]

    if -1.5416890105866388e-97 < a2 < -2.1538731346239785e-256

    1. Initial program 9.6

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied associate-/r*9.4

      \[\leadsto \color{blue}{\frac{\frac{a1 \cdot a2}{b1}}{b2}}\]

    if 5.701154346137465e-243 < a2 < 7.219968817692392e-103

    1. Initial program 9.7

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied associate-/l*9.1

      \[\leadsto \color{blue}{\frac{a1}{\frac{b1 \cdot b2}{a2}}}\]
    4. Using strategy rm
    5. Applied associate-/r/10.1

      \[\leadsto \color{blue}{\frac{a1}{b1 \cdot b2} \cdot a2}\]
    6. Using strategy rm
    7. Applied div-inv10.2

      \[\leadsto \color{blue}{\left(a1 \cdot \frac{1}{b1 \cdot b2}\right)} \cdot a2\]

    if 7.219968817692392e-103 < a2 < 1.7037602706608895e+94 or 3.2705679617905636e+171 < a2 < 9.309401273607693e+249

    1. Initial program 9.3

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Using strategy rm
    3. Applied times-frac10.0

      \[\leadsto \color{blue}{\frac{a1}{b1} \cdot \frac{a2}{b2}}\]
  3. Recombined 6 regimes into one program.
  4. Removed slow pow expressions.

Runtime

Time bar (total: 30.1s)Debug logProfile

herbie shell --seed '#(1063154770 1824007522 645063331 41291047 494775821 1237684644)' 
(FPCore (a1 a2 b1 b2)
  :name "Quotient of products"

  :herbie-target
  (* (/ a1 b1) (/ a2 b2))

  (/ (* a1 a2) (* b1 b2)))