Average Error: 9.5 → 8.2
Time: 2.4m
Precision: 64
Internal Precision: 1408
\[x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(a - x\right)\]
\[\begin{array}{l} \mathbf{if}\;z \le -3.708647104832794 \cdot 10^{+158}:\\ \;\;\;\;a - \left(a - x\right) \cdot \frac{y}{z}\\ \mathbf{if}\;z \le 1.677085841555351 \cdot 10^{+192}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{a - x}{1.0 + \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;a - \left(a - x\right) \cdot \frac{y}{z}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Derivation

  1. Split input into 2 regimes
  2. if z < -3.708647104832794e+158 or 1.677085841555351e+192 < z

    1. Initial program 23.4

      \[x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(a - x\right)\]
    2. Taylor expanded around inf 26.6

      \[\leadsto \color{blue}{\left(\frac{y \cdot x}{z} + a\right) - \frac{y \cdot a}{z}}\]
    3. Applied simplify16.3

      \[\leadsto \color{blue}{a - \left(a - x\right) \cdot \frac{y}{z}}\]

    if -3.708647104832794e+158 < z < 1.677085841555351e+192

    1. Initial program 5.2

      \[x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(a - x\right)\]
    2. Using strategy rm
    3. Applied div-inv5.2

      \[\leadsto x + \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{\left(t + 1.0\right) - z}\right)} \cdot \left(a - x\right)\]
    4. Applied associate-*l*5.8

      \[\leadsto x + \color{blue}{\left(y - z\right) \cdot \left(\frac{1}{\left(t + 1.0\right) - z} \cdot \left(a - x\right)\right)}\]
    5. Applied simplify5.7

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{a - x}{1.0 + \left(t - z\right)}}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions.

Runtime

Time bar (total: 2.4m)Debug logProfile

herbie shell --seed '#(1063027428 1192549564 1443466578 604016274 3637110559 1698629644)' 
(FPCore (x y z t a)
  :name "Hakyll.Web.Tags:renderTagCloud from hakyll-4.7.2.3"
  (+ x (* (/ (- y z) (- (+ t 1.0) z)) (- a x))))