Average Error: 0.2 → 0.2
Time: 9.3s
Precision: binary64
Cost: 832
\[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \]
\[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \]
(FPCore (x y z)
 :precision binary64
 (+ 1.0 (/ (* 4.0 (- (+ x (* y 0.75)) z)) y)))
(FPCore (x y z)
 :precision binary64
 (+ 1.0 (/ (* 4.0 (- (+ x (* y 0.75)) z)) y)))
double code(double x, double y, double z) {
	return 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y);
}
double code(double x, double y, double z) {
	return 1.0 + ((4.0 * ((x + (y * 0.75)) - 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.75d0)) - 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.75d0)) - z)) / y)
end function
public static double code(double x, double y, double z) {
	return 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y);
}
public static double code(double x, double y, double z) {
	return 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y);
}
def code(x, y, z):
	return 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y)
def code(x, y, z):
	return 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y)
function code(x, y, z)
	return Float64(1.0 + Float64(Float64(4.0 * Float64(Float64(x + Float64(y * 0.75)) - z)) / y))
end
function code(x, y, z)
	return Float64(1.0 + Float64(Float64(4.0 * Float64(Float64(x + Float64(y * 0.75)) - z)) / y))
end
function tmp = code(x, y, z)
	tmp = 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y);
end
function tmp = code(x, y, z)
	tmp = 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y);
end
code[x_, y_, z_] := N[(1.0 + N[(N[(4.0 * N[(N[(x + N[(y * 0.75), $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.75), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y}
1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.2

    \[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \]
  2. Final simplification0.2

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

Alternatives

Alternative 1
Error33.4
Cost1376
\[\begin{array}{l} t_0 := \frac{-4}{\frac{y}{z}}\\ t_1 := \frac{4}{\frac{y}{x}}\\ \mathbf{if}\;z \leq -7.4 \cdot 10^{+170}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -4 \cdot 10^{+127}:\\ \;\;\;\;4\\ \mathbf{elif}\;z \leq -2.935825890659751 \cdot 10^{+73}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.8494208433103216 \cdot 10^{-290}:\\ \;\;\;\;4\\ \mathbf{elif}\;z \leq 9.243418687592905 \cdot 10^{-85}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.47001193948588 \cdot 10^{-30}:\\ \;\;\;\;4\\ \mathbf{elif}\;z \leq 3.537536212202052 \cdot 10^{+105}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.7 \cdot 10^{+164}:\\ \;\;\;\;4\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error33.3
Cost1376
\[\begin{array}{l} t_0 := -4 \cdot \frac{z}{y}\\ t_1 := \frac{4}{\frac{y}{x}}\\ \mathbf{if}\;z \leq -7.4 \cdot 10^{+170}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -4 \cdot 10^{+127}:\\ \;\;\;\;4\\ \mathbf{elif}\;z \leq -2.935825890659751 \cdot 10^{+73}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.8494208433103216 \cdot 10^{-290}:\\ \;\;\;\;4\\ \mathbf{elif}\;z \leq 9.243418687592905 \cdot 10^{-85}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.47001193948588 \cdot 10^{-30}:\\ \;\;\;\;4\\ \mathbf{elif}\;z \leq 3.537536212202052 \cdot 10^{+105}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.7 \cdot 10^{+164}:\\ \;\;\;\;4\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error33.3
Cost1376
\[\begin{array}{l} t_0 := -4 \cdot \frac{z}{y}\\ t_1 := \frac{4 \cdot x}{y}\\ \mathbf{if}\;z \leq -7.4 \cdot 10^{+170}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -4 \cdot 10^{+127}:\\ \;\;\;\;4\\ \mathbf{elif}\;z \leq -2.935825890659751 \cdot 10^{+73}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.8494208433103216 \cdot 10^{-290}:\\ \;\;\;\;4\\ \mathbf{elif}\;z \leq 9.243418687592905 \cdot 10^{-85}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.47001193948588 \cdot 10^{-30}:\\ \;\;\;\;4\\ \mathbf{elif}\;z \leq 3.537536212202052 \cdot 10^{+105}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.7 \cdot 10^{+164}:\\ \;\;\;\;4\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error31.4
Cost1112
\[\begin{array}{l} t_0 := \frac{4}{\frac{y}{x}}\\ \mathbf{if}\;x \leq -6.5 \cdot 10^{+182}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -1.35 \cdot 10^{+149}:\\ \;\;\;\;4\\ \mathbf{elif}\;x \leq -111629239415385.61:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 2.33829122668574 \cdot 10^{-59}:\\ \;\;\;\;4\\ \mathbf{elif}\;x \leq 4.014871664522923 \cdot 10^{+67}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{+153}:\\ \;\;\;\;4\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error18.8
Cost976
\[\begin{array}{l} t_0 := \frac{4}{\frac{y}{x - z}}\\ \mathbf{if}\;y \leq -3.283046730953436 \cdot 10^{+152}:\\ \;\;\;\;4\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-74}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 2.212479608027426 \cdot 10^{-17}:\\ \;\;\;\;4\\ \mathbf{elif}\;y \leq 2.351642821417269 \cdot 10^{+49}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;4\\ \end{array} \]
Alternative 6
Error12.6
Cost976
\[\begin{array}{l} t_0 := 4 + \frac{4 \cdot x}{y}\\ t_1 := \frac{4}{\frac{y}{x - z}}\\ \mathbf{if}\;z \leq -7.4 \cdot 10^{+170}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4 \cdot 10^{+127}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2.935825890659751 \cdot 10^{+73}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.7 \cdot 10^{+164}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error9.1
Cost712
\[\begin{array}{l} t_0 := 4 + \frac{4 \cdot x}{y}\\ \mathbf{if}\;x \leq -6.351392042948091 \cdot 10^{-26}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.8217961743985148 \cdot 10^{-95}:\\ \;\;\;\;4 + -4 \cdot \frac{z}{y}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 8
Error0.2
Cost576
\[4 + \frac{4}{y} \cdot \left(x - z\right) \]
Alternative 9
Error36.6
Cost64
\[4 \]

Error

Reproduce

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