?

Average Accuracy: 99.9% → 99.9%
Time: 11.4s
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(1 - z\right) + \log 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 (+ (- 1.0 z) (log 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 * ((1.0 - z) + log(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 * ((1.0d0 - z) + log(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 * ((1.0 - z) + Math.log(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 * ((1.0 - z) + math.log(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(1.0 - z) + log(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 * ((1.0 - z) + log(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[(1.0 - z), $MachinePrecision] + N[Log[z], $MachinePrecision]), $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(1 - z\right) + \log z\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original99.9%
Target99.8%
Herbie99.9%
\[\left(y + 0.5 \cdot x\right) - y \cdot \left(z - \log z\right) \]

Derivation?

  1. Initial program 99.9%

    \[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right) \]
  2. Final simplification99.9%

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

Alternatives

Alternative 1
Accuracy82.1%
Cost7890
\[\begin{array}{l} \mathbf{if}\;x \cdot 0.5 \leq -5 \cdot 10^{-20} \lor \neg \left(x \cdot 0.5 \leq 2 \cdot 10^{-153} \lor \neg \left(x \cdot 0.5 \leq 3 \cdot 10^{-85}\right) \land x \cdot 0.5 \leq 5 \cdot 10^{-57}\right):\\ \;\;\;\;x \cdot 0.5 - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(1 + \log z\right) - z\right)\\ \end{array} \]
Alternative 2
Accuracy71.5%
Cost7117
\[\begin{array}{l} \mathbf{if}\;z \leq 3.948 \cdot 10^{-137} \lor \neg \left(z \leq 1.34 \cdot 10^{-92}\right) \land z \leq 1.8 \cdot 10^{-79}:\\ \;\;\;\;y \cdot \left(1 + \log z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 0.5 - y \cdot z\\ \end{array} \]
Alternative 3
Accuracy98.4%
Cost7108
\[\begin{array}{l} \mathbf{if}\;z \leq 5.4 \cdot 10^{-5}:\\ \;\;\;\;x \cdot 0.5 + y \cdot \left(1 + \log z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, 0.5, y\right) - y \cdot z\\ \end{array} \]
Alternative 4
Accuracy55.3%
Cost520
\[\begin{array}{l} \mathbf{if}\;x \leq -5.8 \cdot 10^{-32}:\\ \;\;\;\;x \cdot 0.5\\ \mathbf{elif}\;x \leq 7.4 \cdot 10^{-156}:\\ \;\;\;\;y \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 0.5\\ \end{array} \]
Alternative 5
Accuracy72.0%
Cost448
\[x \cdot 0.5 - y \cdot z \]
Alternative 6
Accuracy45.9%
Cost192
\[x \cdot 0.5 \]
Alternative 7
Accuracy2.1%
Cost64
\[y \]

Error

Reproduce?

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