Average Error: 0.2 → 0.2
Time: 2.5s
Precision: binary64
\[\begin{array}{l} \mathbf{if}\;3.5 \cdot 3.5 - 3 \cdot c \gt 10:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;3.5 \gt 0.0:\\ \;\;\;\;\frac{c \cdot 2}{\left(-3.5\right) - \sqrt{3.5 \cdot 3.5 - \left(3 \cdot c\right) \cdot 4}}\\ \mathbf{elif}\;3.5 \lt 0.0:\\ \;\;\;\;\frac{\left(-3.5\right) + \sqrt{3.5 \cdot 3.5 - \left(3 \cdot c\right) \cdot 4}}{3 \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-3.5\right) + \sqrt{3.5 \cdot 3.5 - \left(3 \cdot c\right) \cdot 4}}{3 \cdot 2}\\ \end{array}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-3.5\right) + \sqrt{3.5 \cdot 3.5 - \left(3 \cdot c\right) \cdot 4}}{3 \cdot 2}\\ \end{array}\]
\[\begin{array}{l} \mathbf{if}\;3.5 \cdot 3.5 - 3 \cdot c \gt 10 \land 3.5 \gt 0.0:\\ \;\;\;\;\frac{c \cdot 2}{\left(-3.5\right) - \sqrt{3.5 \cdot 3.5 - \left(3 \cdot c\right) \cdot 4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-3.5\right) + \sqrt{3.5 \cdot 3.5 - \left(3 \cdot c\right) \cdot 4}}{3 \cdot 2}\\ \end{array}\]

Error

Bits error versus c

Derivation

  1. Initial program 0.2

    \[\begin{array}{l} \mathbf{if}\;3.5 \cdot 3.5 - 3 \cdot c \gt 10:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;3.5 \gt 0.0:\\ \;\;\;\;\frac{c \cdot 2}{\left(-3.5\right) - \sqrt{3.5 \cdot 3.5 - \left(3 \cdot c\right) \cdot 4}}\\ \mathbf{elif}\;3.5 \lt 0.0:\\ \;\;\;\;\frac{\left(-3.5\right) + \sqrt{3.5 \cdot 3.5 - \left(3 \cdot c\right) \cdot 4}}{3 \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-3.5\right) + \sqrt{3.5 \cdot 3.5 - \left(3 \cdot c\right) \cdot 4}}{3 \cdot 2}\\ \end{array}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-3.5\right) + \sqrt{3.5 \cdot 3.5 - \left(3 \cdot c\right) \cdot 4}}{3 \cdot 2}\\ \end{array}\]
  2. Simplified0.2

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;3.5 \cdot 3.5 - 3 \cdot c \gt 10 \land 3.5 \gt 0.0:\\ \;\;\;\;\frac{c \cdot 2}{\left(-3.5\right) - \sqrt{3.5 \cdot 3.5 - \left(3 \cdot c\right) \cdot 4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-3.5\right) + \sqrt{3.5 \cdot 3.5 - \left(3 \cdot c\right) \cdot 4}}{3 \cdot 2}\\ \end{array}}\]
  3. Final simplification0.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;3.5 \cdot 3.5 - 3 \cdot c \gt 10 \land 3.5 \gt 0.0:\\ \;\;\;\;\frac{c \cdot 2}{\left(-3.5\right) - \sqrt{3.5 \cdot 3.5 - \left(3 \cdot c\right) \cdot 4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-3.5\right) + \sqrt{3.5 \cdot 3.5 - \left(3 \cdot c\right) \cdot 4}}{3 \cdot 2}\\ \end{array}\]

Reproduce

herbie shell --seed 2020153 
(FPCore (c)
  :name "(if (> (- (* 7/2 7/2) (* 3 c)) 10) (if (> 7/2 0) (/ (* c 2) (- (- 7/2) (sqrt (- (* 7/2 7/2) (* (* 3 c) 4))))) (if (< 7/2 0) (/ (+ (- 7/2) (sqrt (- (* 7/2 7/2) (* (* 3 c) 4)))) (* 3 2)) (/ (+ (- 7/2) (sqrt (- (* 7/2 7/2) (* (* 3 c) 4)))) (* 3 2)))) (/ (+ (- 7/2) (sqrt (- (* 7/2 7/2) (* (* 3 c) 4)))) (* 3 2)))"
  :precision binary64
  (if (> (- (* 3.5 3.5) (* 3.0 c)) 10.0) (if (> 3.5 0.0) (/ (* c 2.0) (- (neg 3.5) (sqrt (- (* 3.5 3.5) (* (* 3.0 c) 4.0))))) (if (< 3.5 0.0) (/ (+ (neg 3.5) (sqrt (- (* 3.5 3.5) (* (* 3.0 c) 4.0)))) (* 3.0 2.0)) (/ (+ (neg 3.5) (sqrt (- (* 3.5 3.5) (* (* 3.0 c) 4.0)))) (* 3.0 2.0)))) (/ (+ (neg 3.5) (sqrt (- (* 3.5 3.5) (* (* 3.0 c) 4.0)))) (* 3.0 2.0))))