?

Average Error: 0.5 → 0.2
Time: 1.3min
Precision: binary64
Cost: 448

?

\[\frac{x \cdot 100}{x + y} \]
\[\frac{100}{x + y} \cdot x \]
(FPCore (x y) :precision binary64 (/ (* x 100.0) (+ x y)))
(FPCore (x y) :precision binary64 (* (/ 100.0 (+ x y)) x))
double code(double x, double y) {
	return (x * 100.0) / (x + y);
}
double code(double x, double y) {
	return (100.0 / (x + y)) * x;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (x * 100.0d0) / (x + y)
end function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (100.0d0 / (x + y)) * x
end function
public static double code(double x, double y) {
	return (x * 100.0) / (x + y);
}
public static double code(double x, double y) {
	return (100.0 / (x + y)) * x;
}
def code(x, y):
	return (x * 100.0) / (x + y)
def code(x, y):
	return (100.0 / (x + y)) * x
function code(x, y)
	return Float64(Float64(x * 100.0) / Float64(x + y))
end
function code(x, y)
	return Float64(Float64(100.0 / Float64(x + y)) * x)
end
function tmp = code(x, y)
	tmp = (x * 100.0) / (x + y);
end
function tmp = code(x, y)
	tmp = (100.0 / (x + y)) * x;
end
code[x_, y_] := N[(N[(x * 100.0), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(N[(100.0 / N[(x + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\frac{x \cdot 100}{x + y}
\frac{100}{x + y} \cdot x

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation?

  1. Initial program 0.5

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

    \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot 0.01}} \]
    Proof
  3. Applied egg-rr0.2

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

Alternatives

Alternative 1
Error17.2
Cost848
\[\begin{array}{l} t_0 := 100 \cdot \frac{x}{y}\\ \mathbf{if}\;x \leq -1.05 \cdot 10^{-37}:\\ \;\;\;\;100\\ \mathbf{elif}\;x \leq 6 \cdot 10^{-71}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.56 \cdot 10^{+59}:\\ \;\;\;\;100\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{+117}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;100\\ \end{array} \]
Alternative 2
Error17.3
Cost848
\[\begin{array}{l} t_0 := \frac{100}{y} \cdot x\\ \mathbf{if}\;x \leq -4.4 \cdot 10^{-41}:\\ \;\;\;\;100\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{-72}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{+59}:\\ \;\;\;\;100\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{+117}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;100\\ \end{array} \]
Alternative 3
Error17.2
Cost848
\[\begin{array}{l} \mathbf{if}\;x \leq -4.6 \cdot 10^{-38}:\\ \;\;\;\;100\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-72}:\\ \;\;\;\;\frac{x}{0.01 \cdot y}\\ \mathbf{elif}\;x \leq 9.8 \cdot 10^{+58}:\\ \;\;\;\;100\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{+117}:\\ \;\;\;\;\frac{100}{y} \cdot x\\ \mathbf{else}:\\ \;\;\;\;100\\ \end{array} \]
Alternative 4
Error17.3
Cost848
\[\begin{array}{l} \mathbf{if}\;x \leq -9.8 \cdot 10^{-39}:\\ \;\;\;\;100\\ \mathbf{elif}\;x \leq 2.85 \cdot 10^{-74}:\\ \;\;\;\;\frac{x}{0.01 \cdot y}\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{+59}:\\ \;\;\;\;\frac{x \cdot 100}{x}\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{+117}:\\ \;\;\;\;\frac{100}{y} \cdot x\\ \mathbf{else}:\\ \;\;\;\;100\\ \end{array} \]
Alternative 5
Error17.2
Cost848
\[\begin{array}{l} \mathbf{if}\;x \leq -2.45 \cdot 10^{-37}:\\ \;\;\;\;100\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{-73}:\\ \;\;\;\;\frac{x \cdot 100}{y}\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+59}:\\ \;\;\;\;\frac{x \cdot 100}{x}\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{+117}:\\ \;\;\;\;\frac{100}{y} \cdot x\\ \mathbf{else}:\\ \;\;\;\;100\\ \end{array} \]
Alternative 6
Error31.9
Cost64
\[100 \]

Error

Reproduce?

herbie shell --seed 2023033 
(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)))