Average Error: 9.2 → 5.2
Time: 4.2m
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}\;x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(a - x\right) \le -7.776492608738048 \cdot 10^{-294}:\\ \;\;\;\;x + \left(\left(y - z\right) \cdot \frac{1}{\left(t + 1.0\right) - z}\right) \cdot \left(a - x\right)\\ \mathbf{if}\;x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(a - x\right) \le 2.3203577575291687 \cdot 10^{-266}:\\ \;\;\;\;a - \left(a - x\right) \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(y - z\right) \cdot \frac{1}{\left(t + 1.0\right) - z}\right) \cdot \left(a - x\right)\\ \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 (+ x (* (/ (- y z) (- (+ t 1.0) z)) (- a x))) < -7.776492608738048e-294 or 2.3203577575291687e-266 < (+ x (* (/ (- y z) (- (+ t 1.0) z)) (- a x)))

    1. Initial program 0.9

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

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

    if -7.776492608738048e-294 < (+ x (* (/ (- y z) (- (+ t 1.0) z)) (- a x))) < 2.3203577575291687e-266

    1. Initial program 58.6

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

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

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

Runtime

Time bar (total: 4.2m)Debug logProfile

herbie shell --seed '#(1063313015 2771194459 1594909340 1344785158 2223560818 546365448)' 
(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))))