Average Error: 0.3 → 0.3
Time: 2.5s
Precision: binary64
Cost: 448
\[\frac{x \cdot 100}{x + y}\]
\[\frac{x \cdot 100}{x + y}\]
\frac{x \cdot 100}{x + y}
\frac{x \cdot 100}{x + y}
(FPCore (x y) :precision binary64 (/ (* x 100.0) (+ x y)))
(FPCore (x y) :precision binary64 (/ (* x 100.0) (+ x y)))
double code(double x, double y) {
	return (x * 100.0) / (x + y);
}
double code(double x, double y) {
	return (x * 100.0) / (x + y);
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.3
Target0.2
Herbie0.3
\[\frac{x}{1} \cdot \frac{100}{x + y}\]

Alternatives

Alternative 1
Error17.5
Cost1604
\[\begin{array}{l} \mathbf{if}\;x \leq -8.040114318717974 \cdot 10^{+124}:\\ \;\;\;\;100\\ \mathbf{elif}\;x \leq -1.2525187792662156 \cdot 10^{+30}:\\ \;\;\;\;x \cdot \frac{100}{y}\\ \mathbf{elif}\;x \leq -3.5130400829940072 \cdot 10^{-31}:\\ \;\;\;\;100\\ \mathbf{elif}\;x \leq 4.975308076804745 \cdot 10^{-81}:\\ \;\;\;\;\frac{x}{y \cdot 0.01}\\ \mathbf{else}:\\ \;\;\;\;100\\ \end{array}\]
Alternative 2
Error17.3
Cost1101
\[\begin{array}{l} \mathbf{if}\;x \leq -8.040114318717974 \cdot 10^{+124}:\\ \;\;\;\;100\\ \mathbf{elif}\;x \leq -1.9817308564656805 \cdot 10^{+26} \lor \neg \left(x \leq -2.1137629137057617 \cdot 10^{-26}\right) \land x \leq 4.975308076804745 \cdot 10^{-81}:\\ \;\;\;\;\frac{x}{y \cdot 0.01}\\ \mathbf{else}:\\ \;\;\;\;100\\ \end{array}\]
Alternative 3
Error27.7
Cost706
\[\begin{array}{l} \mathbf{if}\;y \leq -1.1302920932068166 \cdot 10^{+102}:\\ \;\;\;\;0\\ \mathbf{elif}\;y \leq 3.575509823986864 \cdot 10^{+113}:\\ \;\;\;\;100\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array}\]
Alternative 4
Error51.4
Cost706
\[\begin{array}{l} \mathbf{if}\;y \leq -6.157543015201014 \cdot 10^{+37}:\\ \;\;\;\;0\\ \mathbf{elif}\;y \leq 4.0763155443370693 \cdot 10^{+45}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array}\]
Alternative 5
Error58.1
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.3

    \[\frac{x \cdot 100}{x + y}\]
  2. Simplified0.3

    \[\leadsto \color{blue}{\frac{x \cdot 100}{x + y}}\]
  3. Final simplification0.3

    \[\leadsto \frac{x \cdot 100}{x + y}\]

Reproduce

herbie shell --seed 2021044 
(FPCore (x y)
  :name "Development.Shake.Progress:message from shake-0.15.5"
  :precision binary64

  :herbie-target
  (* (/ x 1.0) (/ 100.0 (+ x y)))

  (/ (* x 100.0) (+ x y)))