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

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\left(1 - x\right) + y \cdot \sqrt{x} \]
  2. Final simplification0.1

    \[\leadsto \left(1 - x\right) + y \cdot \sqrt{x} \]

Alternatives

Alternative 1
Error5.4
Cost7120
\[\begin{array}{l} t_0 := y \cdot \sqrt{x}\\ \mathbf{if}\;y \leq -1.1909481088986603 \cdot 10^{+103}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.0129847952114264 \cdot 10^{+45}:\\ \;\;\;\;1 - x\\ \mathbf{elif}\;y \leq 2.0565636600531313 \cdot 10^{+64}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 2.384083704531881 \cdot 10^{+101}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error5.4
Cost7120
\[\begin{array}{l} t_0 := y \cdot \sqrt{x}\\ \mathbf{if}\;y \leq -1.1909481088986603 \cdot 10^{+103}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.0129847952114264 \cdot 10^{+45}:\\ \;\;\;\;1 - x\\ \mathbf{elif}\;y \leq 2.0565636600531313 \cdot 10^{+64}:\\ \;\;\;\;\sqrt{y \cdot \left(x \cdot y\right)}\\ \mathbf{elif}\;y \leq 2.384083704531881 \cdot 10^{+101}:\\ \;\;\;\;1 - x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error22.2
Cost260
\[\begin{array}{l} \mathbf{if}\;x \leq 0.05125377519440065:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;-x\\ \end{array} \]
Alternative 4
Error21.5
Cost192
\[1 - x \]
Alternative 5
Error42.5
Cost64
\[1 \]

Error

Reproduce

herbie shell --seed 2022291 
(FPCore (x y)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, E"
  :precision binary64
  (+ (- 1.0 x) (* y (sqrt x))))