Data.Array.Repa.Algorithms.ColorRamp:rampColorHotToCold from repa-algorithms-3.4.0.1, A

Percentage Accurate: 99.7% → 100.0%
Time: 6.1s
Alternatives: 8
Speedup: 1.2×

Specification

?
\[\begin{array}{l} \\ 1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \end{array} \]
(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);
}
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);
}
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 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]
\begin{array}{l}

\\
1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ 1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \end{array} \]
(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);
}
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);
}
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 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]
\begin{array}{l}

\\
1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y}
\end{array}

Alternative 1: 100.0% accurate, 1.2× speedup?

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

\\
1 + 4 \cdot \left(0.75 + \frac{x - z}{y}\right)
\end{array}
Derivation
  1. Initial program 99.6%

    \[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \]
  2. Step-by-step derivation
    1. associate-/l*99.9%

      \[\leadsto 1 + \color{blue}{4 \cdot \frac{\left(x + y \cdot 0.75\right) - z}{y}} \]
    2. associate--l+99.9%

      \[\leadsto 1 + 4 \cdot \frac{\color{blue}{x + \left(y \cdot 0.75 - z\right)}}{y} \]
  3. Simplified99.9%

    \[\leadsto \color{blue}{1 + 4 \cdot \frac{x + \left(y \cdot 0.75 - z\right)}{y}} \]
  4. Add Preprocessing
  5. Taylor expanded in x around 0 96.9%

    \[\leadsto 1 + 4 \cdot \color{blue}{\left(\left(0.75 + \frac{x}{y}\right) - \frac{z}{y}\right)} \]
  6. Step-by-step derivation
    1. associate--l+96.9%

      \[\leadsto 1 + 4 \cdot \color{blue}{\left(0.75 + \left(\frac{x}{y} - \frac{z}{y}\right)\right)} \]
    2. div-sub100.0%

      \[\leadsto 1 + 4 \cdot \left(0.75 + \color{blue}{\frac{x - z}{y}}\right) \]
  7. Simplified100.0%

    \[\leadsto 1 + 4 \cdot \color{blue}{\left(0.75 + \frac{x - z}{y}\right)} \]
  8. Add Preprocessing

Alternative 2: 79.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+141} \lor \neg \left(z \leq 9.6 \cdot 10^{-32} \lor \neg \left(z \leq 3.9 \cdot 10^{+18}\right) \land z \leq 3.05 \cdot 10^{+116}\right):\\ \;\;\;\;1 + \frac{z \cdot -4}{y}\\ \mathbf{else}:\\ \;\;\;\;1 + 4 \cdot \left(0.75 + \frac{x}{y}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -7e+141)
         (not (or (<= z 9.6e-32) (and (not (<= z 3.9e+18)) (<= z 3.05e+116)))))
   (+ 1.0 (/ (* z -4.0) y))
   (+ 1.0 (* 4.0 (+ 0.75 (/ x y))))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -7e+141) || !((z <= 9.6e-32) || (!(z <= 3.9e+18) && (z <= 3.05e+116)))) {
		tmp = 1.0 + ((z * -4.0) / y);
	} else {
		tmp = 1.0 + (4.0 * (0.75 + (x / y)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-7d+141)) .or. (.not. (z <= 9.6d-32) .or. (.not. (z <= 3.9d+18)) .and. (z <= 3.05d+116))) then
        tmp = 1.0d0 + ((z * (-4.0d0)) / y)
    else
        tmp = 1.0d0 + (4.0d0 * (0.75d0 + (x / y)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -7e+141) || !((z <= 9.6e-32) || (!(z <= 3.9e+18) && (z <= 3.05e+116)))) {
		tmp = 1.0 + ((z * -4.0) / y);
	} else {
		tmp = 1.0 + (4.0 * (0.75 + (x / y)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -7e+141) or not ((z <= 9.6e-32) or (not (z <= 3.9e+18) and (z <= 3.05e+116))):
		tmp = 1.0 + ((z * -4.0) / y)
	else:
		tmp = 1.0 + (4.0 * (0.75 + (x / y)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -7e+141) || !((z <= 9.6e-32) || (!(z <= 3.9e+18) && (z <= 3.05e+116))))
		tmp = Float64(1.0 + Float64(Float64(z * -4.0) / y));
	else
		tmp = Float64(1.0 + Float64(4.0 * Float64(0.75 + Float64(x / y))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -7e+141) || ~(((z <= 9.6e-32) || (~((z <= 3.9e+18)) && (z <= 3.05e+116)))))
		tmp = 1.0 + ((z * -4.0) / y);
	else
		tmp = 1.0 + (4.0 * (0.75 + (x / y)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -7e+141], N[Not[Or[LessEqual[z, 9.6e-32], And[N[Not[LessEqual[z, 3.9e+18]], $MachinePrecision], LessEqual[z, 3.05e+116]]]], $MachinePrecision]], N[(1.0 + N[(N[(z * -4.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(4.0 * N[(0.75 + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+141} \lor \neg \left(z \leq 9.6 \cdot 10^{-32} \lor \neg \left(z \leq 3.9 \cdot 10^{+18}\right) \land z \leq 3.05 \cdot 10^{+116}\right):\\
\;\;\;\;1 + \frac{z \cdot -4}{y}\\

\mathbf{else}:\\
\;\;\;\;1 + 4 \cdot \left(0.75 + \frac{x}{y}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.9999999999999999e141 or 9.6000000000000005e-32 < z < 3.9e18 or 3.05000000000000009e116 < z

    1. Initial program 100.0%

      \[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-/l*100.0%

        \[\leadsto 1 + \color{blue}{4 \cdot \frac{\left(x + y \cdot 0.75\right) - z}{y}} \]
      2. associate--l+100.0%

        \[\leadsto 1 + 4 \cdot \frac{\color{blue}{x + \left(y \cdot 0.75 - z\right)}}{y} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{1 + 4 \cdot \frac{x + \left(y \cdot 0.75 - z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 79.2%

      \[\leadsto 1 + 4 \cdot \color{blue}{\left(-1 \cdot \frac{z}{y}\right)} \]
    6. Step-by-step derivation
      1. neg-mul-179.2%

        \[\leadsto 1 + 4 \cdot \color{blue}{\left(-\frac{z}{y}\right)} \]
      2. distribute-neg-frac279.2%

        \[\leadsto 1 + 4 \cdot \color{blue}{\frac{z}{-y}} \]
    7. Simplified79.2%

      \[\leadsto 1 + 4 \cdot \color{blue}{\frac{z}{-y}} \]
    8. Taylor expanded in z around 0 79.2%

      \[\leadsto 1 + \color{blue}{-4 \cdot \frac{z}{y}} \]
    9. Step-by-step derivation
      1. associate-*r/79.2%

        \[\leadsto 1 + \color{blue}{\frac{-4 \cdot z}{y}} \]
    10. Simplified79.2%

      \[\leadsto 1 + \color{blue}{\frac{-4 \cdot z}{y}} \]

    if -6.9999999999999999e141 < z < 9.6000000000000005e-32 or 3.9e18 < z < 3.05000000000000009e116

    1. Initial program 99.3%

      \[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

        \[\leadsto 1 + \color{blue}{4 \cdot \frac{\left(x + y \cdot 0.75\right) - z}{y}} \]
      2. associate--l+99.9%

        \[\leadsto 1 + 4 \cdot \frac{\color{blue}{x + \left(y \cdot 0.75 - z\right)}}{y} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{1 + 4 \cdot \frac{x + \left(y \cdot 0.75 - z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 100.0%

      \[\leadsto 1 + 4 \cdot \color{blue}{\left(\left(0.75 + \frac{x}{y}\right) - \frac{z}{y}\right)} \]
    6. Taylor expanded in z around 0 87.2%

      \[\leadsto 1 + 4 \cdot \color{blue}{\left(0.75 + \frac{x}{y}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification84.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+141} \lor \neg \left(z \leq 9.6 \cdot 10^{-32} \lor \neg \left(z \leq 3.9 \cdot 10^{+18}\right) \land z \leq 3.05 \cdot 10^{+116}\right):\\ \;\;\;\;1 + \frac{z \cdot -4}{y}\\ \mathbf{else}:\\ \;\;\;\;1 + 4 \cdot \left(0.75 + \frac{x}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 86.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{+50} \lor \neg \left(y \leq 1.25 \cdot 10^{+87}\right):\\ \;\;\;\;1 + 4 \cdot \left(0.75 + \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;1 + 4 \cdot \frac{x - z}{y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -2.9e+50) (not (<= y 1.25e+87)))
   (+ 1.0 (* 4.0 (+ 0.75 (/ x y))))
   (+ 1.0 (* 4.0 (/ (- x z) y)))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -2.9e+50) || !(y <= 1.25e+87)) {
		tmp = 1.0 + (4.0 * (0.75 + (x / y)));
	} else {
		tmp = 1.0 + (4.0 * ((x - z) / y));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((y <= (-2.9d+50)) .or. (.not. (y <= 1.25d+87))) then
        tmp = 1.0d0 + (4.0d0 * (0.75d0 + (x / y)))
    else
        tmp = 1.0d0 + (4.0d0 * ((x - z) / y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -2.9e+50) || !(y <= 1.25e+87)) {
		tmp = 1.0 + (4.0 * (0.75 + (x / y)));
	} else {
		tmp = 1.0 + (4.0 * ((x - z) / y));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -2.9e+50) or not (y <= 1.25e+87):
		tmp = 1.0 + (4.0 * (0.75 + (x / y)))
	else:
		tmp = 1.0 + (4.0 * ((x - z) / y))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -2.9e+50) || !(y <= 1.25e+87))
		tmp = Float64(1.0 + Float64(4.0 * Float64(0.75 + Float64(x / y))));
	else
		tmp = Float64(1.0 + Float64(4.0 * Float64(Float64(x - z) / y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -2.9e+50) || ~((y <= 1.25e+87)))
		tmp = 1.0 + (4.0 * (0.75 + (x / y)));
	else
		tmp = 1.0 + (4.0 * ((x - z) / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.9e+50], N[Not[LessEqual[y, 1.25e+87]], $MachinePrecision]], N[(1.0 + N[(4.0 * N[(0.75 + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(4.0 * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{+50} \lor \neg \left(y \leq 1.25 \cdot 10^{+87}\right):\\
\;\;\;\;1 + 4 \cdot \left(0.75 + \frac{x}{y}\right)\\

\mathbf{else}:\\
\;\;\;\;1 + 4 \cdot \frac{x - z}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.9e50 or 1.24999999999999995e87 < y

    1. Initial program 98.9%

      \[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

        \[\leadsto 1 + \color{blue}{4 \cdot \frac{\left(x + y \cdot 0.75\right) - z}{y}} \]
      2. associate--l+99.9%

        \[\leadsto 1 + 4 \cdot \frac{\color{blue}{x + \left(y \cdot 0.75 - z\right)}}{y} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{1 + 4 \cdot \frac{x + \left(y \cdot 0.75 - z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 100.0%

      \[\leadsto 1 + 4 \cdot \color{blue}{\left(\left(0.75 + \frac{x}{y}\right) - \frac{z}{y}\right)} \]
    6. Taylor expanded in z around 0 87.3%

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

    if -2.9e50 < y < 1.24999999999999995e87

    1. Initial program 100.0%

      \[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-/l*100.0%

        \[\leadsto 1 + \color{blue}{4 \cdot \frac{\left(x + y \cdot 0.75\right) - z}{y}} \]
      2. associate--l+100.0%

        \[\leadsto 1 + 4 \cdot \frac{\color{blue}{x + \left(y \cdot 0.75 - z\right)}}{y} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{1 + 4 \cdot \frac{x + \left(y \cdot 0.75 - z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 94.0%

      \[\leadsto 1 + 4 \cdot \color{blue}{\frac{x - z}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{+50} \lor \neg \left(y \leq 1.25 \cdot 10^{+87}\right):\\ \;\;\;\;1 + 4 \cdot \left(0.75 + \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;1 + 4 \cdot \frac{x - z}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 85.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4400000000 \lor \neg \left(z \leq 10^{-79}\right):\\ \;\;\;\;1 + 4 \cdot \left(0.75 - \frac{z}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;1 + 4 \cdot \left(0.75 + \frac{x}{y}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -4400000000.0) (not (<= z 1e-79)))
   (+ 1.0 (* 4.0 (- 0.75 (/ z y))))
   (+ 1.0 (* 4.0 (+ 0.75 (/ x y))))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -4400000000.0) || !(z <= 1e-79)) {
		tmp = 1.0 + (4.0 * (0.75 - (z / y)));
	} else {
		tmp = 1.0 + (4.0 * (0.75 + (x / y)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-4400000000.0d0)) .or. (.not. (z <= 1d-79))) then
        tmp = 1.0d0 + (4.0d0 * (0.75d0 - (z / y)))
    else
        tmp = 1.0d0 + (4.0d0 * (0.75d0 + (x / y)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -4400000000.0) || !(z <= 1e-79)) {
		tmp = 1.0 + (4.0 * (0.75 - (z / y)));
	} else {
		tmp = 1.0 + (4.0 * (0.75 + (x / y)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -4400000000.0) or not (z <= 1e-79):
		tmp = 1.0 + (4.0 * (0.75 - (z / y)))
	else:
		tmp = 1.0 + (4.0 * (0.75 + (x / y)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -4400000000.0) || !(z <= 1e-79))
		tmp = Float64(1.0 + Float64(4.0 * Float64(0.75 - Float64(z / y))));
	else
		tmp = Float64(1.0 + Float64(4.0 * Float64(0.75 + Float64(x / y))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -4400000000.0) || ~((z <= 1e-79)))
		tmp = 1.0 + (4.0 * (0.75 - (z / y)));
	else
		tmp = 1.0 + (4.0 * (0.75 + (x / y)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -4400000000.0], N[Not[LessEqual[z, 1e-79]], $MachinePrecision]], N[(1.0 + N[(4.0 * N[(0.75 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(4.0 * N[(0.75 + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4400000000 \lor \neg \left(z \leq 10^{-79}\right):\\
\;\;\;\;1 + 4 \cdot \left(0.75 - \frac{z}{y}\right)\\

\mathbf{else}:\\
\;\;\;\;1 + 4 \cdot \left(0.75 + \frac{x}{y}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.4e9 or 1e-79 < z

    1. Initial program 100.0%

      \[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-/l*100.0%

        \[\leadsto 1 + \color{blue}{4 \cdot \frac{\left(x + y \cdot 0.75\right) - z}{y}} \]
      2. associate--l+100.0%

        \[\leadsto 1 + 4 \cdot \frac{\color{blue}{x + \left(y \cdot 0.75 - z\right)}}{y} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{1 + 4 \cdot \frac{x + \left(y \cdot 0.75 - z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 82.7%

      \[\leadsto 1 + 4 \cdot \color{blue}{\frac{0.75 \cdot y - z}{y}} \]
    6. Step-by-step derivation
      1. div-sub82.7%

        \[\leadsto 1 + 4 \cdot \color{blue}{\left(\frac{0.75 \cdot y}{y} - \frac{z}{y}\right)} \]
      2. associate-/l*82.7%

        \[\leadsto 1 + 4 \cdot \left(\color{blue}{0.75 \cdot \frac{y}{y}} - \frac{z}{y}\right) \]
      3. *-inverses82.7%

        \[\leadsto 1 + 4 \cdot \left(0.75 \cdot \color{blue}{1} - \frac{z}{y}\right) \]
      4. metadata-eval82.7%

        \[\leadsto 1 + 4 \cdot \left(\color{blue}{0.75} - \frac{z}{y}\right) \]
    7. Simplified82.7%

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

    if -4.4e9 < z < 1e-79

    1. Initial program 99.0%

      \[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

        \[\leadsto 1 + \color{blue}{4 \cdot \frac{\left(x + y \cdot 0.75\right) - z}{y}} \]
      2. associate--l+99.9%

        \[\leadsto 1 + 4 \cdot \frac{\color{blue}{x + \left(y \cdot 0.75 - z\right)}}{y} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{1 + 4 \cdot \frac{x + \left(y \cdot 0.75 - z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 100.0%

      \[\leadsto 1 + 4 \cdot \color{blue}{\left(\left(0.75 + \frac{x}{y}\right) - \frac{z}{y}\right)} \]
    6. Taylor expanded in z around 0 98.1%

      \[\leadsto 1 + 4 \cdot \color{blue}{\left(0.75 + \frac{x}{y}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification89.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4400000000 \lor \neg \left(z \leq 10^{-79}\right):\\ \;\;\;\;1 + 4 \cdot \left(0.75 - \frac{z}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;1 + 4 \cdot \left(0.75 + \frac{x}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 57.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -120000000000 \lor \neg \left(z \leq 4 \cdot 10^{-80}\right):\\ \;\;\;\;1 + \frac{z \cdot -4}{y}\\ \mathbf{else}:\\ \;\;\;\;1 + 4 \cdot \frac{x}{y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -120000000000.0) (not (<= z 4e-80)))
   (+ 1.0 (/ (* z -4.0) y))
   (+ 1.0 (* 4.0 (/ x y)))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -120000000000.0) || !(z <= 4e-80)) {
		tmp = 1.0 + ((z * -4.0) / y);
	} else {
		tmp = 1.0 + (4.0 * (x / y));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-120000000000.0d0)) .or. (.not. (z <= 4d-80))) then
        tmp = 1.0d0 + ((z * (-4.0d0)) / y)
    else
        tmp = 1.0d0 + (4.0d0 * (x / y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -120000000000.0) || !(z <= 4e-80)) {
		tmp = 1.0 + ((z * -4.0) / y);
	} else {
		tmp = 1.0 + (4.0 * (x / y));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -120000000000.0) or not (z <= 4e-80):
		tmp = 1.0 + ((z * -4.0) / y)
	else:
		tmp = 1.0 + (4.0 * (x / y))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -120000000000.0) || !(z <= 4e-80))
		tmp = Float64(1.0 + Float64(Float64(z * -4.0) / y));
	else
		tmp = Float64(1.0 + Float64(4.0 * Float64(x / y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -120000000000.0) || ~((z <= 4e-80)))
		tmp = 1.0 + ((z * -4.0) / y);
	else
		tmp = 1.0 + (4.0 * (x / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -120000000000.0], N[Not[LessEqual[z, 4e-80]], $MachinePrecision]], N[(1.0 + N[(N[(z * -4.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -120000000000 \lor \neg \left(z \leq 4 \cdot 10^{-80}\right):\\
\;\;\;\;1 + \frac{z \cdot -4}{y}\\

\mathbf{else}:\\
\;\;\;\;1 + 4 \cdot \frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2e11 or 3.99999999999999985e-80 < z

    1. Initial program 100.0%

      \[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-/l*100.0%

        \[\leadsto 1 + \color{blue}{4 \cdot \frac{\left(x + y \cdot 0.75\right) - z}{y}} \]
      2. associate--l+100.0%

        \[\leadsto 1 + 4 \cdot \frac{\color{blue}{x + \left(y \cdot 0.75 - z\right)}}{y} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{1 + 4 \cdot \frac{x + \left(y \cdot 0.75 - z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 64.4%

      \[\leadsto 1 + 4 \cdot \color{blue}{\left(-1 \cdot \frac{z}{y}\right)} \]
    6. Step-by-step derivation
      1. neg-mul-164.4%

        \[\leadsto 1 + 4 \cdot \color{blue}{\left(-\frac{z}{y}\right)} \]
      2. distribute-neg-frac264.4%

        \[\leadsto 1 + 4 \cdot \color{blue}{\frac{z}{-y}} \]
    7. Simplified64.4%

      \[\leadsto 1 + 4 \cdot \color{blue}{\frac{z}{-y}} \]
    8. Taylor expanded in z around 0 64.4%

      \[\leadsto 1 + \color{blue}{-4 \cdot \frac{z}{y}} \]
    9. Step-by-step derivation
      1. associate-*r/64.4%

        \[\leadsto 1 + \color{blue}{\frac{-4 \cdot z}{y}} \]
    10. Simplified64.4%

      \[\leadsto 1 + \color{blue}{\frac{-4 \cdot z}{y}} \]

    if -1.2e11 < z < 3.99999999999999985e-80

    1. Initial program 99.0%

      \[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

        \[\leadsto 1 + \color{blue}{4 \cdot \frac{\left(x + y \cdot 0.75\right) - z}{y}} \]
      2. associate--l+99.9%

        \[\leadsto 1 + 4 \cdot \frac{\color{blue}{x + \left(y \cdot 0.75 - z\right)}}{y} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{1 + 4 \cdot \frac{x + \left(y \cdot 0.75 - z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 61.5%

      \[\leadsto 1 + 4 \cdot \color{blue}{\frac{x}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification63.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -120000000000 \lor \neg \left(z \leq 4 \cdot 10^{-80}\right):\\ \;\;\;\;1 + \frac{z \cdot -4}{y}\\ \mathbf{else}:\\ \;\;\;\;1 + 4 \cdot \frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 57.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -13500000000000 \lor \neg \left(z \leq 10^{-79}\right):\\ \;\;\;\;1 + z \cdot \frac{-4}{y}\\ \mathbf{else}:\\ \;\;\;\;1 + 4 \cdot \frac{x}{y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -13500000000000.0) (not (<= z 1e-79)))
   (+ 1.0 (* z (/ -4.0 y)))
   (+ 1.0 (* 4.0 (/ x y)))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -13500000000000.0) || !(z <= 1e-79)) {
		tmp = 1.0 + (z * (-4.0 / y));
	} else {
		tmp = 1.0 + (4.0 * (x / y));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-13500000000000.0d0)) .or. (.not. (z <= 1d-79))) then
        tmp = 1.0d0 + (z * ((-4.0d0) / y))
    else
        tmp = 1.0d0 + (4.0d0 * (x / y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -13500000000000.0) || !(z <= 1e-79)) {
		tmp = 1.0 + (z * (-4.0 / y));
	} else {
		tmp = 1.0 + (4.0 * (x / y));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -13500000000000.0) or not (z <= 1e-79):
		tmp = 1.0 + (z * (-4.0 / y))
	else:
		tmp = 1.0 + (4.0 * (x / y))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -13500000000000.0) || !(z <= 1e-79))
		tmp = Float64(1.0 + Float64(z * Float64(-4.0 / y)));
	else
		tmp = Float64(1.0 + Float64(4.0 * Float64(x / y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -13500000000000.0) || ~((z <= 1e-79)))
		tmp = 1.0 + (z * (-4.0 / y));
	else
		tmp = 1.0 + (4.0 * (x / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -13500000000000.0], N[Not[LessEqual[z, 1e-79]], $MachinePrecision]], N[(1.0 + N[(z * N[(-4.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -13500000000000 \lor \neg \left(z \leq 10^{-79}\right):\\
\;\;\;\;1 + z \cdot \frac{-4}{y}\\

\mathbf{else}:\\
\;\;\;\;1 + 4 \cdot \frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.35e13 or 1e-79 < z

    1. Initial program 100.0%

      \[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-/l*100.0%

        \[\leadsto 1 + \color{blue}{4 \cdot \frac{\left(x + y \cdot 0.75\right) - z}{y}} \]
      2. associate--l+100.0%

        \[\leadsto 1 + 4 \cdot \frac{\color{blue}{x + \left(y \cdot 0.75 - z\right)}}{y} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{1 + 4 \cdot \frac{x + \left(y \cdot 0.75 - z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 64.4%

      \[\leadsto 1 + 4 \cdot \color{blue}{\left(-1 \cdot \frac{z}{y}\right)} \]
    6. Step-by-step derivation
      1. neg-mul-164.4%

        \[\leadsto 1 + 4 \cdot \color{blue}{\left(-\frac{z}{y}\right)} \]
      2. distribute-neg-frac264.4%

        \[\leadsto 1 + 4 \cdot \color{blue}{\frac{z}{-y}} \]
    7. Simplified64.4%

      \[\leadsto 1 + 4 \cdot \color{blue}{\frac{z}{-y}} \]
    8. Taylor expanded in z around 0 64.4%

      \[\leadsto 1 + \color{blue}{-4 \cdot \frac{z}{y}} \]
    9. Step-by-step derivation
      1. *-commutative64.4%

        \[\leadsto 1 + \color{blue}{\frac{z}{y} \cdot -4} \]
      2. associate-*l/64.4%

        \[\leadsto 1 + \color{blue}{\frac{z \cdot -4}{y}} \]
      3. associate-/l*64.2%

        \[\leadsto 1 + \color{blue}{z \cdot \frac{-4}{y}} \]
    10. Simplified64.2%

      \[\leadsto 1 + \color{blue}{z \cdot \frac{-4}{y}} \]

    if -1.35e13 < z < 1e-79

    1. Initial program 99.0%

      \[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

        \[\leadsto 1 + \color{blue}{4 \cdot \frac{\left(x + y \cdot 0.75\right) - z}{y}} \]
      2. associate--l+99.9%

        \[\leadsto 1 + 4 \cdot \frac{\color{blue}{x + \left(y \cdot 0.75 - z\right)}}{y} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{1 + 4 \cdot \frac{x + \left(y \cdot 0.75 - z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 61.5%

      \[\leadsto 1 + 4 \cdot \color{blue}{\frac{x}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification63.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -13500000000000 \lor \neg \left(z \leq 10^{-79}\right):\\ \;\;\;\;1 + z \cdot \frac{-4}{y}\\ \mathbf{else}:\\ \;\;\;\;1 + 4 \cdot \frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 55.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+66}:\\ \;\;\;\;4\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{+122}:\\ \;\;\;\;1 + 4 \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;4\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -3.2e+66) 4.0 (if (<= y 3.3e+122) (+ 1.0 (* 4.0 (/ x y))) 4.0)))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -3.2e+66) {
		tmp = 4.0;
	} else if (y <= 3.3e+122) {
		tmp = 1.0 + (4.0 * (x / y));
	} else {
		tmp = 4.0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-3.2d+66)) then
        tmp = 4.0d0
    else if (y <= 3.3d+122) then
        tmp = 1.0d0 + (4.0d0 * (x / y))
    else
        tmp = 4.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -3.2e+66) {
		tmp = 4.0;
	} else if (y <= 3.3e+122) {
		tmp = 1.0 + (4.0 * (x / y));
	} else {
		tmp = 4.0;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -3.2e+66:
		tmp = 4.0
	elif y <= 3.3e+122:
		tmp = 1.0 + (4.0 * (x / y))
	else:
		tmp = 4.0
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -3.2e+66)
		tmp = 4.0;
	elseif (y <= 3.3e+122)
		tmp = Float64(1.0 + Float64(4.0 * Float64(x / y)));
	else
		tmp = 4.0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -3.2e+66)
		tmp = 4.0;
	elseif (y <= 3.3e+122)
		tmp = 1.0 + (4.0 * (x / y));
	else
		tmp = 4.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -3.2e+66], 4.0, If[LessEqual[y, 3.3e+122], N[(1.0 + N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4.0]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{+66}:\\
\;\;\;\;4\\

\mathbf{elif}\;y \leq 3.3 \cdot 10^{+122}:\\
\;\;\;\;1 + 4 \cdot \frac{x}{y}\\

\mathbf{else}:\\
\;\;\;\;4\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.2e66 or 3.2999999999999999e122 < y

    1. Initial program 98.8%

      \[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

        \[\leadsto 1 + \color{blue}{4 \cdot \frac{\left(x + y \cdot 0.75\right) - z}{y}} \]
      2. associate--l+99.9%

        \[\leadsto 1 + 4 \cdot \frac{\color{blue}{x + \left(y \cdot 0.75 - z\right)}}{y} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{1 + 4 \cdot \frac{x + \left(y \cdot 0.75 - z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 72.9%

      \[\leadsto 1 + 4 \cdot \color{blue}{0.75} \]

    if -3.2e66 < y < 3.2999999999999999e122

    1. Initial program 100.0%

      \[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \]
    2. Step-by-step derivation
      1. associate-/l*100.0%

        \[\leadsto 1 + \color{blue}{4 \cdot \frac{\left(x + y \cdot 0.75\right) - z}{y}} \]
      2. associate--l+100.0%

        \[\leadsto 1 + 4 \cdot \frac{\color{blue}{x + \left(y \cdot 0.75 - z\right)}}{y} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{1 + 4 \cdot \frac{x + \left(y \cdot 0.75 - z\right)}{y}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 48.3%

      \[\leadsto 1 + 4 \cdot \color{blue}{\frac{x}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification56.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+66}:\\ \;\;\;\;4\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{+122}:\\ \;\;\;\;1 + 4 \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;4\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 34.0% accurate, 13.0× speedup?

\[\begin{array}{l} \\ 4 \end{array} \]
(FPCore (x y z) :precision binary64 4.0)
double code(double x, double y, double z) {
	return 4.0;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = 4.0d0
end function
public static double code(double x, double y, double z) {
	return 4.0;
}
def code(x, y, z):
	return 4.0
function code(x, y, z)
	return 4.0
end
function tmp = code(x, y, z)
	tmp = 4.0;
end
code[x_, y_, z_] := 4.0
\begin{array}{l}

\\
4
\end{array}
Derivation
  1. Initial program 99.6%

    \[1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y} \]
  2. Step-by-step derivation
    1. associate-/l*99.9%

      \[\leadsto 1 + \color{blue}{4 \cdot \frac{\left(x + y \cdot 0.75\right) - z}{y}} \]
    2. associate--l+99.9%

      \[\leadsto 1 + 4 \cdot \frac{\color{blue}{x + \left(y \cdot 0.75 - z\right)}}{y} \]
  3. Simplified99.9%

    \[\leadsto \color{blue}{1 + 4 \cdot \frac{x + \left(y \cdot 0.75 - z\right)}{y}} \]
  4. Add Preprocessing
  5. Taylor expanded in y around inf 30.9%

    \[\leadsto 1 + 4 \cdot \color{blue}{0.75} \]
  6. Final simplification30.9%

    \[\leadsto 4 \]
  7. Add Preprocessing

Reproduce

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