Average Error: 9.5 → 5.3
Time: 6.3m
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 -2.8881517042369782 \cdot 10^{-300}:\\ \;\;\;\;x + \frac{1}{\frac{\frac{1.0 + \left(t - z\right)}{y - z}}{\left(-x\right) + a}}\\ \mathbf{if}\;x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(a - x\right) \le 0.0:\\ \;\;\;\;a - \left(a - x\right) \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{\frac{\frac{1.0 + \left(t - z\right)}{y - z}}{\left(-x\right) + a}}\\ \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))) < -2.8881517042369782e-300 or 0.0 < (+ x (* (/ (- y z) (- (+ t 1.0) z)) (- a x)))

    1. Initial program 1.0

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

      \[\leadsto x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \color{blue}{\left(a + \left(-x\right)\right)}\]
    4. Applied distribute-lft-in1.0

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

      \[\leadsto \color{blue}{\left(x + \frac{y - z}{\left(t + 1.0\right) - z} \cdot a\right) + \frac{y - z}{\left(t + 1.0\right) - z} \cdot \left(-x\right)}\]
    6. Using strategy rm
    7. Applied associate-+l+1.0

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

      \[\leadsto x + \color{blue}{\frac{\left(-x\right) + a}{\frac{1.0 + \left(t - z\right)}{y - z}}}\]
    9. Using strategy rm
    10. Applied clear-num1.2

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

    if -2.8881517042369782e-300 < (+ x (* (/ (- y z) (- (+ t 1.0) z)) (- a x))) < 0.0

    1. Initial program 61.3

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

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

      \[\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: 6.3m)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))))