Average Error: 0.1 → 0.1
Time: 10.5s
Precision: binary64
Cost: 7104
\[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right) \]
\[x \cdot 0.5 - y \cdot \left(\left(z - \log z\right) + -1\right) \]
(FPCore (x y z) :precision binary64 (+ (* x 0.5) (* y (+ (- 1.0 z) (log z)))))
(FPCore (x y z) :precision binary64 (- (* x 0.5) (* y (+ (- z (log z)) -1.0))))
double code(double x, double y, double z) {
	return (x * 0.5) + (y * ((1.0 - z) + log(z)));
}
double code(double x, double y, double z) {
	return (x * 0.5) - (y * ((z - log(z)) + -1.0));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x * 0.5d0) + (y * ((1.0d0 - z) + log(z)))
end function
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x * 0.5d0) - (y * ((z - log(z)) + (-1.0d0)))
end function
public static double code(double x, double y, double z) {
	return (x * 0.5) + (y * ((1.0 - z) + Math.log(z)));
}
public static double code(double x, double y, double z) {
	return (x * 0.5) - (y * ((z - Math.log(z)) + -1.0));
}
def code(x, y, z):
	return (x * 0.5) + (y * ((1.0 - z) + math.log(z)))
def code(x, y, z):
	return (x * 0.5) - (y * ((z - math.log(z)) + -1.0))
function code(x, y, z)
	return Float64(Float64(x * 0.5) + Float64(y * Float64(Float64(1.0 - z) + log(z))))
end
function code(x, y, z)
	return Float64(Float64(x * 0.5) - Float64(y * Float64(Float64(z - log(z)) + -1.0)))
end
function tmp = code(x, y, z)
	tmp = (x * 0.5) + (y * ((1.0 - z) + log(z)));
end
function tmp = code(x, y, z)
	tmp = (x * 0.5) - (y * ((z - log(z)) + -1.0));
end
code[x_, y_, z_] := N[(N[(x * 0.5), $MachinePrecision] + N[(y * N[(N[(1.0 - z), $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := N[(N[(x * 0.5), $MachinePrecision] - N[(y * N[(N[(z - N[Log[z], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
x \cdot 0.5 - y \cdot \left(\left(z - \log z\right) + -1\right)

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0.1
Herbie0.1
\[\left(y + 0.5 \cdot x\right) - y \cdot \left(z - \log z\right) \]

Derivation

  1. Initial program 0.1

    \[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right) \]
  2. Applied egg-rr0.1

    \[\leadsto x \cdot 0.5 + y \cdot \color{blue}{\left(1 - \left(z - \log z\right)\right)} \]
  3. Final simplification0.1

    \[\leadsto x \cdot 0.5 - y \cdot \left(\left(z - \log z\right) + -1\right) \]

Alternatives

Alternative 1
Error18.2
Cost7248
\[\begin{array}{l} t_0 := y + y \cdot \log z\\ t_1 := x \cdot 0.5 - y \cdot z\\ \mathbf{if}\;z \leq 3.447372656530312 \cdot 10^{-186}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 9.512840654730543 \cdot 10^{-164}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 3.8325739678698683 \cdot 10^{-137}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.7911040484514093 \cdot 10^{-123}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error10.9
Cost7112
\[\begin{array}{l} t_0 := y \cdot \left(1 - \left(z - \log z\right)\right)\\ \mathbf{if}\;y \leq -1 \cdot 10^{+76}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.0222823367011279 \cdot 10^{+34}:\\ \;\;\;\;x \cdot 0.5 - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error0.8
Cost7108
\[\begin{array}{l} \mathbf{if}\;z \leq 0.018346947734456505:\\ \;\;\;\;x \cdot 0.5 + y \cdot \left(1 + \log z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 0.5 + y \cdot \left(1 - z\right)\\ \end{array} \]
Alternative 4
Error14.8
Cost6984
\[\begin{array}{l} t_0 := y \cdot \left(1 + \log z\right)\\ \mathbf{if}\;y \leq -3.8 \cdot 10^{+204}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+224}:\\ \;\;\;\;x \cdot 0.5 - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error29.6
Cost652
\[\begin{array}{l} t_0 := y \cdot \left(-z\right)\\ \mathbf{if}\;z \leq 802521.5941995165:\\ \;\;\;\;x \cdot 0.5\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+161}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+194}:\\ \;\;\;\;x \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error29.6
Cost652
\[\begin{array}{l} \mathbf{if}\;z \leq 802521.5941995165:\\ \;\;\;\;x \cdot 0.5\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+161}:\\ \;\;\;\;y - y \cdot z\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+194}:\\ \;\;\;\;x \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-z\right)\\ \end{array} \]
Alternative 7
Error18.3
Cost448
\[x \cdot 0.5 - y \cdot z \]
Alternative 8
Error34.6
Cost192
\[x \cdot 0.5 \]
Alternative 9
Error62.7
Cost64
\[y \]

Error

Reproduce

herbie shell --seed 2022217 
(FPCore (x y z)
  :name "System.Random.MWC.Distributions:gamma from mwc-random-0.13.3.2"
  :precision binary64

  :herbie-target
  (- (+ y (* 0.5 x)) (* y (- z (log z))))

  (+ (* x 0.5) (* y (+ (- 1.0 z) (log z)))))