Average Error: 11.0 → 5.3
Time: 11.8s
Precision: 64
Internal Precision: 576
\[\frac{a1 \cdot a2}{b1 \cdot b2}\]
\[\begin{array}{l} \mathbf{if}\;a1 \cdot a2 \le -4.836605524658094 \cdot 10^{+127}:\\ \;\;\;\;\frac{a1}{b2} \cdot \frac{a2}{b1}\\ \mathbf{elif}\;a1 \cdot a2 \le -4.111691167559186 \cdot 10^{-274}:\\ \;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\ \mathbf{elif}\;a1 \cdot a2 \le 5.524363222538348 \cdot 10^{-297}:\\ \;\;\;\;\frac{a1}{\frac{b2}{\frac{a2}{b1}}}\\ \mathbf{elif}\;a1 \cdot a2 \le 3.273019957727645 \cdot 10^{+151}:\\ \;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\ \mathbf{else}:\\ \;\;\;\;\frac{a1}{\frac{b2}{\frac{a2}{b1}}}\\ \end{array}\]

Error

Bits error versus a1

Bits error versus a2

Bits error versus b1

Bits error versus b2

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original11.0
Target11.1
Herbie5.3
\[\frac{a1}{b1} \cdot \frac{a2}{b2}\]

Derivation

  1. Split input into 3 regimes
  2. if (* a1 a2) < -4.836605524658094e+127

    1. Initial program 23.4

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Initial simplification10.8

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

    if -4.836605524658094e+127 < (* a1 a2) < -4.111691167559186e-274 or 5.524363222538348e-297 < (* a1 a2) < 3.273019957727645e+151

    1. Initial program 4.3

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Initial simplification13.2

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

      \[\leadsto \color{blue}{\frac{a1 \cdot \frac{a2}{b1}}{b2}}\]
    5. Using strategy rm
    6. Applied associate-/l*13.5

      \[\leadsto \color{blue}{\frac{a1}{\frac{b2}{\frac{a2}{b1}}}}\]
    7. Taylor expanded around inf 4.3

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

    if -4.111691167559186e-274 < (* a1 a2) < 5.524363222538348e-297 or 3.273019957727645e+151 < (* a1 a2)

    1. Initial program 21.5

      \[\frac{a1 \cdot a2}{b1 \cdot b2}\]
    2. Initial simplification5.7

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

      \[\leadsto \color{blue}{\frac{a1 \cdot \frac{a2}{b1}}{b2}}\]
    5. Using strategy rm
    6. Applied associate-/l*5.6

      \[\leadsto \color{blue}{\frac{a1}{\frac{b2}{\frac{a2}{b1}}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification5.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;a1 \cdot a2 \le -4.836605524658094 \cdot 10^{+127}:\\ \;\;\;\;\frac{a1}{b2} \cdot \frac{a2}{b1}\\ \mathbf{elif}\;a1 \cdot a2 \le -4.111691167559186 \cdot 10^{-274}:\\ \;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\ \mathbf{elif}\;a1 \cdot a2 \le 5.524363222538348 \cdot 10^{-297}:\\ \;\;\;\;\frac{a1}{\frac{b2}{\frac{a2}{b1}}}\\ \mathbf{elif}\;a1 \cdot a2 \le 3.273019957727645 \cdot 10^{+151}:\\ \;\;\;\;\frac{a1 \cdot a2}{b1 \cdot b2}\\ \mathbf{else}:\\ \;\;\;\;\frac{a1}{\frac{b2}{\frac{a2}{b1}}}\\ \end{array}\]

Runtime

Time bar (total: 11.8s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes10.95.30.110.751.7%
herbie shell --seed 2018339 +o rules:numerics
(FPCore (a1 a2 b1 b2)
  :name "Quotient of products"

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

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