?

Average Accuracy: 99.9% → 99.9%
Time: 6.5s
Precision: binary64
Cost: 832

?

\[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.25\right) - z\right)}{y} \]
\[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.25\right) - z\right)}{y} \]
(FPCore (x y z)
 :precision binary64
 (+ 1.0 (/ (* 4.0 (- (+ x (* y 0.25)) z)) y)))
(FPCore (x y z)
 :precision binary64
 (+ 1.0 (/ (* 4.0 (- (+ x (* y 0.25)) z)) y)))
double code(double x, double y, double z) {
	return 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y);
}
double code(double x, double y, double z) {
	return 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = 1.0d0 + ((4.0d0 * ((x + (y * 0.25d0)) - z)) / y)
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 = 1.0d0 + ((4.0d0 * ((x + (y * 0.25d0)) - z)) / y)
end function
public static double code(double x, double y, double z) {
	return 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y);
}
public static double code(double x, double y, double z) {
	return 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y);
}
def code(x, y, z):
	return 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y)
def code(x, y, z):
	return 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y)
function code(x, y, z)
	return Float64(1.0 + Float64(Float64(4.0 * Float64(Float64(x + Float64(y * 0.25)) - z)) / y))
end
function code(x, y, z)
	return Float64(1.0 + Float64(Float64(4.0 * Float64(Float64(x + Float64(y * 0.25)) - z)) / y))
end
function tmp = code(x, y, z)
	tmp = 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y);
end
function tmp = code(x, y, z)
	tmp = 1.0 + ((4.0 * ((x + (y * 0.25)) - z)) / y);
end
code[x_, y_, z_] := N[(1.0 + N[(N[(4.0 * N[(N[(x + N[(y * 0.25), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := N[(1.0 + N[(N[(4.0 * N[(N[(x + N[(y * 0.25), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
1 + \frac{4 \cdot \left(\left(x + y \cdot 0.25\right) - z\right)}{y}
1 + \frac{4 \cdot \left(\left(x + y \cdot 0.25\right) - z\right)}{y}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 99.9%

    \[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.25\right) - z\right)}{y} \]
  2. Final simplification99.9%

    \[\leadsto 1 + \frac{4 \cdot \left(\left(x + y \cdot 0.25\right) - z\right)}{y} \]

Alternatives

Alternative 1
Accuracy51.0%
Cost1112
\[\begin{array}{l} t_0 := \frac{4 \cdot x}{y}\\ t_1 := -4 \cdot \frac{z}{y}\\ \mathbf{if}\;z \leq -2.8 \cdot 10^{+74}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-170}:\\ \;\;\;\;2\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{-199}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-254}:\\ \;\;\;\;2\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-52}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+51}:\\ \;\;\;\;2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Accuracy99.7%
Cost832
\[1 + \frac{4}{\frac{y}{x + \left(y \cdot 0.25 - z\right)}} \]
Alternative 3
Accuracy81.4%
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -4.2 \lor \neg \left(y \leq 10^{+32}\right):\\ \;\;\;\;2 + -4 \cdot \frac{z}{y}\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \frac{z - x}{y}\\ \end{array} \]
Alternative 4
Accuracy85.0%
Cost713
\[\begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{-142} \lor \neg \left(z \leq 75000000000000\right):\\ \;\;\;\;2 + -4 \cdot \frac{z}{y}\\ \mathbf{else}:\\ \;\;\;\;2 + 4 \cdot \frac{x}{y}\\ \end{array} \]
Alternative 5
Accuracy74.7%
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+146}:\\ \;\;\;\;2\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+137}:\\ \;\;\;\;-4 \cdot \frac{z - x}{y}\\ \mathbf{else}:\\ \;\;\;\;2\\ \end{array} \]
Alternative 6
Accuracy53.7%
Cost585
\[\begin{array}{l} \mathbf{if}\;z \leq -8.8 \cdot 10^{+67} \lor \neg \left(z \leq 1.7 \cdot 10^{+52}\right):\\ \;\;\;\;-4 \cdot \frac{z}{y}\\ \mathbf{else}:\\ \;\;\;\;2\\ \end{array} \]
Alternative 7
Accuracy43.8%
Cost64
\[2 \]

Error

Reproduce?

herbie shell --seed 2023141 
(FPCore (x y z)
  :name "Data.Array.Repa.Algorithms.ColorRamp:rampColorHotToCold from repa-algorithms-3.4.0.1, C"
  :precision binary64
  (+ 1.0 (/ (* 4.0 (- (+ x (* y 0.25)) z)) y)))