Average Error: 0.1 → 0.1
Time: 13.0s
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(\log z + 1\right) - z\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 (- (+ (log z) 1.0) z))))
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 * ((log(z) + 1.0) - z));
}
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 * ((log(z) + 1.0d0) - z))
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 * ((Math.log(z) + 1.0) - z));
}
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 * ((math.log(z) + 1.0) - z))
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(log(z) + 1.0) - z)))
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 * ((log(z) + 1.0) - z));
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[(N[Log[z], $MachinePrecision] + 1.0), $MachinePrecision] - z), $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(\log z + 1\right) - z\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(\left(\log z + 1\right) - z\right)} \]
  3. Final simplification0.1

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

Alternatives

Alternative 1
Error10.4
Cost7112
\[\begin{array}{l} t_0 := y \cdot \left(\left(\log z + 1\right) - z\right)\\ \mathbf{if}\;y \leq -1.5413749430288095 \cdot 10^{+32}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 8927680088631267000:\\ \;\;\;\;x \cdot 0.5 - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error0.9
Cost7108
\[\begin{array}{l} \mathbf{if}\;z \leq 0.004355918065280278:\\ \;\;\;\;x \cdot 0.5 + y \cdot \left(\log z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 0.5 - y \cdot z\\ \end{array} \]
Alternative 3
Error14.3
Cost6984
\[\begin{array}{l} t_0 := y \cdot \left(\log z + 1\right)\\ \mathbf{if}\;y \leq -2.7 \cdot 10^{+161}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 3.55 \cdot 10^{+224}:\\ \;\;\;\;x \cdot 0.5 - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error29.1
Cost652
\[\begin{array}{l} t_0 := y \cdot \left(-z\right)\\ \mathbf{if}\;z \leq 6.2 \cdot 10^{+61}:\\ \;\;\;\;x \cdot 0.5\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+84}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+99}:\\ \;\;\;\;x \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error18.0
Cost448
\[x \cdot 0.5 - y \cdot z \]
Alternative 6
Error35.1
Cost192
\[x \cdot 0.5 \]

Error

Reproduce

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