
(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);
}
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);
}
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 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]
\begin{array}{l}
\\
1 + \frac{4 \cdot \left(\left(x + y \cdot 0.25\right) - z\right)}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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);
}
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);
}
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 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]
\begin{array}{l}
\\
1 + \frac{4 \cdot \left(\left(x + y \cdot 0.25\right) - z\right)}{y}
\end{array}
(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));
}
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));
}
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(4.0 * Float64(Float64(x + Float64(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
code[x_, y_, z_] := N[(1.0 + N[(4.0 * N[(N[(x + N[(N[(y * 0.25), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + 4 \cdot \frac{x + \left(y \cdot 0.25 - z\right)}{y}
\end{array}
Initial program 99.6%
associate-/l*100.0%
associate--l+100.0%
Simplified100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ z y) -4.0)))
(if (<= z -2.4e+61)
t_0
(if (<= z -1.25e-55) (* 4.0 (/ x y)) (if (<= z 3.15e-46) 2.0 t_0)))))
double code(double x, double y, double z) {
double t_0 = (z / y) * -4.0;
double tmp;
if (z <= -2.4e+61) {
tmp = t_0;
} else if (z <= -1.25e-55) {
tmp = 4.0 * (x / y);
} else if (z <= 3.15e-46) {
tmp = 2.0;
} else {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = (z / y) * (-4.0d0)
if (z <= (-2.4d+61)) then
tmp = t_0
else if (z <= (-1.25d-55)) then
tmp = 4.0d0 * (x / y)
else if (z <= 3.15d-46) then
tmp = 2.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z / y) * -4.0;
double tmp;
if (z <= -2.4e+61) {
tmp = t_0;
} else if (z <= -1.25e-55) {
tmp = 4.0 * (x / y);
} else if (z <= 3.15e-46) {
tmp = 2.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (z / y) * -4.0 tmp = 0 if z <= -2.4e+61: tmp = t_0 elif z <= -1.25e-55: tmp = 4.0 * (x / y) elif z <= 3.15e-46: tmp = 2.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(z / y) * -4.0) tmp = 0.0 if (z <= -2.4e+61) tmp = t_0; elseif (z <= -1.25e-55) tmp = Float64(4.0 * Float64(x / y)); elseif (z <= 3.15e-46) tmp = 2.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z / y) * -4.0; tmp = 0.0; if (z <= -2.4e+61) tmp = t_0; elseif (z <= -1.25e-55) tmp = 4.0 * (x / y); elseif (z <= 3.15e-46) tmp = 2.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z / y), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[z, -2.4e+61], t$95$0, If[LessEqual[z, -1.25e-55], N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.15e-46], 2.0, t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{z}{y} \cdot -4\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+61}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-55}:\\
\;\;\;\;4 \cdot \frac{x}{y}\\
\mathbf{elif}\;z \leq 3.15 \cdot 10^{-46}:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.3999999999999999e61 or 3.15e-46 < z Initial program 99.1%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in z around inf 63.7%
*-commutative63.7%
Simplified63.7%
if -2.3999999999999999e61 < z < -1.25e-55Initial program 100.0%
associate-/l*100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in x around inf 67.9%
if -1.25e-55 < z < 3.15e-46Initial program 100.0%
associate-/l*100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in y around inf 56.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.00033) (not (<= z 2.2e+79))) (* (- z x) (/ -4.0 y)) (+ 2.0 (* 4.0 (/ x y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.00033) || !(z <= 2.2e+79)) {
tmp = (z - x) * (-4.0 / y);
} else {
tmp = 2.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 <= (-0.00033d0)) .or. (.not. (z <= 2.2d+79))) then
tmp = (z - x) * ((-4.0d0) / y)
else
tmp = 2.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 <= -0.00033) || !(z <= 2.2e+79)) {
tmp = (z - x) * (-4.0 / y);
} else {
tmp = 2.0 + (4.0 * (x / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.00033) or not (z <= 2.2e+79): tmp = (z - x) * (-4.0 / y) else: tmp = 2.0 + (4.0 * (x / y)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.00033) || !(z <= 2.2e+79)) tmp = Float64(Float64(z - x) * Float64(-4.0 / y)); else tmp = Float64(2.0 + Float64(4.0 * Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.00033) || ~((z <= 2.2e+79))) tmp = (z - x) * (-4.0 / y); else tmp = 2.0 + (4.0 * (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.00033], N[Not[LessEqual[z, 2.2e+79]], $MachinePrecision]], N[(N[(z - x), $MachinePrecision] * N[(-4.0 / y), $MachinePrecision]), $MachinePrecision], N[(2.0 + N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00033 \lor \neg \left(z \leq 2.2 \cdot 10^{+79}\right):\\
\;\;\;\;\left(z - x\right) \cdot \frac{-4}{y}\\
\mathbf{else}:\\
\;\;\;\;2 + 4 \cdot \frac{x}{y}\\
\end{array}
\end{array}
if z < -3.3e-4 or 2.1999999999999999e79 < z Initial program 99.1%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in y around 0 84.6%
associate-*r/83.8%
associate-*l/84.4%
*-commutative84.4%
metadata-eval84.4%
associate-*r/84.4%
associate-*r*84.4%
*-commutative84.4%
neg-mul-184.4%
sub-neg84.4%
+-commutative84.4%
distribute-neg-in84.4%
remove-double-neg84.4%
sub-neg84.4%
Simplified84.4%
if -3.3e-4 < z < 2.1999999999999999e79Initial program 100.0%
+-commutative100.0%
associate-*l/99.9%
+-commutative99.9%
associate--l+99.9%
+-commutative99.9%
distribute-lft-in99.9%
associate-+l+99.9%
associate-*l/99.9%
*-commutative99.9%
associate-*l*99.9%
metadata-eval99.9%
*-rgt-identity99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 90.8%
Final simplification88.1%
(FPCore (x y z) :precision binary64 (if (<= x -1.45e+40) (+ 2.0 (* 4.0 (/ x y))) (if (<= x 1.5e+36) (+ 2.0 (* (/ z y) -4.0)) (* (- z x) (/ -4.0 y)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.45e+40) {
tmp = 2.0 + (4.0 * (x / y));
} else if (x <= 1.5e+36) {
tmp = 2.0 + ((z / y) * -4.0);
} else {
tmp = (z - x) * (-4.0 / 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 (x <= (-1.45d+40)) then
tmp = 2.0d0 + (4.0d0 * (x / y))
else if (x <= 1.5d+36) then
tmp = 2.0d0 + ((z / y) * (-4.0d0))
else
tmp = (z - x) * ((-4.0d0) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.45e+40) {
tmp = 2.0 + (4.0 * (x / y));
} else if (x <= 1.5e+36) {
tmp = 2.0 + ((z / y) * -4.0);
} else {
tmp = (z - x) * (-4.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.45e+40: tmp = 2.0 + (4.0 * (x / y)) elif x <= 1.5e+36: tmp = 2.0 + ((z / y) * -4.0) else: tmp = (z - x) * (-4.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.45e+40) tmp = Float64(2.0 + Float64(4.0 * Float64(x / y))); elseif (x <= 1.5e+36) tmp = Float64(2.0 + Float64(Float64(z / y) * -4.0)); else tmp = Float64(Float64(z - x) * Float64(-4.0 / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.45e+40) tmp = 2.0 + (4.0 * (x / y)); elseif (x <= 1.5e+36) tmp = 2.0 + ((z / y) * -4.0); else tmp = (z - x) * (-4.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.45e+40], N[(2.0 + N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e+36], N[(2.0 + N[(N[(z / y), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], N[(N[(z - x), $MachinePrecision] * N[(-4.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+40}:\\
\;\;\;\;2 + 4 \cdot \frac{x}{y}\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+36}:\\
\;\;\;\;2 + \frac{z}{y} \cdot -4\\
\mathbf{else}:\\
\;\;\;\;\left(z - x\right) \cdot \frac{-4}{y}\\
\end{array}
\end{array}
if x < -1.45000000000000009e40Initial program 99.9%
+-commutative99.9%
associate-*l/99.8%
+-commutative99.8%
associate--l+99.8%
+-commutative99.8%
distribute-lft-in99.8%
associate-+l+99.9%
associate-*l/99.9%
*-commutative99.9%
associate-*l*99.9%
metadata-eval99.9%
*-rgt-identity99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 84.2%
if -1.45000000000000009e40 < x < 1.5e36Initial program 100.0%
+-commutative100.0%
associate-*l/99.8%
+-commutative99.8%
associate--l+99.8%
+-commutative99.8%
distribute-lft-in99.8%
associate-+l+99.9%
associate-*l/99.9%
*-commutative99.9%
associate-*l*99.9%
metadata-eval99.9%
*-rgt-identity99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 94.4%
*-commutative94.4%
Simplified94.4%
if 1.5e36 < x Initial program 98.3%
associate-/l*100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in y around 0 88.4%
associate-*r/86.7%
associate-*l/88.1%
*-commutative88.1%
metadata-eval88.1%
associate-*r/88.1%
associate-*r*88.1%
*-commutative88.1%
neg-mul-188.1%
sub-neg88.1%
+-commutative88.1%
distribute-neg-in88.1%
remove-double-neg88.1%
sub-neg88.1%
Simplified88.1%
(FPCore (x y z) :precision binary64 (if (<= y -5.2e+170) 2.0 (if (<= y 1.5e+203) (* (- z x) (/ -4.0 y)) 2.0)))
double code(double x, double y, double z) {
double tmp;
if (y <= -5.2e+170) {
tmp = 2.0;
} else if (y <= 1.5e+203) {
tmp = (z - x) * (-4.0 / y);
} else {
tmp = 2.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 <= (-5.2d+170)) then
tmp = 2.0d0
else if (y <= 1.5d+203) then
tmp = (z - x) * ((-4.0d0) / y)
else
tmp = 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -5.2e+170) {
tmp = 2.0;
} else if (y <= 1.5e+203) {
tmp = (z - x) * (-4.0 / y);
} else {
tmp = 2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5.2e+170: tmp = 2.0 elif y <= 1.5e+203: tmp = (z - x) * (-4.0 / y) else: tmp = 2.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5.2e+170) tmp = 2.0; elseif (y <= 1.5e+203) tmp = Float64(Float64(z - x) * Float64(-4.0 / y)); else tmp = 2.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -5.2e+170) tmp = 2.0; elseif (y <= 1.5e+203) tmp = (z - x) * (-4.0 / y); else tmp = 2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5.2e+170], 2.0, If[LessEqual[y, 1.5e+203], N[(N[(z - x), $MachinePrecision] * N[(-4.0 / y), $MachinePrecision]), $MachinePrecision], 2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+170}:\\
\;\;\;\;2\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+203}:\\
\;\;\;\;\left(z - x\right) \cdot \frac{-4}{y}\\
\mathbf{else}:\\
\;\;\;\;2\\
\end{array}
\end{array}
if y < -5.1999999999999996e170 or 1.5e203 < y Initial program 99.9%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in y around inf 83.5%
if -5.1999999999999996e170 < y < 1.5e203Initial program 99.6%
associate-/l*100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in y around 0 77.5%
associate-*r/77.1%
associate-*l/77.3%
*-commutative77.3%
metadata-eval77.3%
associate-*r/77.3%
associate-*r*77.3%
*-commutative77.3%
neg-mul-177.3%
sub-neg77.3%
+-commutative77.3%
distribute-neg-in77.3%
remove-double-neg77.3%
sub-neg77.3%
Simplified77.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -5.3e+81) (not (<= x 1.48e+35))) (* 4.0 (/ x y)) 2.0))
double code(double x, double y, double z) {
double tmp;
if ((x <= -5.3e+81) || !(x <= 1.48e+35)) {
tmp = 4.0 * (x / y);
} else {
tmp = 2.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 ((x <= (-5.3d+81)) .or. (.not. (x <= 1.48d+35))) then
tmp = 4.0d0 * (x / y)
else
tmp = 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -5.3e+81) || !(x <= 1.48e+35)) {
tmp = 4.0 * (x / y);
} else {
tmp = 2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -5.3e+81) or not (x <= 1.48e+35): tmp = 4.0 * (x / y) else: tmp = 2.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -5.3e+81) || !(x <= 1.48e+35)) tmp = Float64(4.0 * Float64(x / y)); else tmp = 2.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -5.3e+81) || ~((x <= 1.48e+35))) tmp = 4.0 * (x / y); else tmp = 2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -5.3e+81], N[Not[LessEqual[x, 1.48e+35]], $MachinePrecision]], N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision], 2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.3 \cdot 10^{+81} \lor \neg \left(x \leq 1.48 \cdot 10^{+35}\right):\\
\;\;\;\;4 \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;2\\
\end{array}
\end{array}
if x < -5.30000000000000028e81 or 1.48000000000000003e35 < x Initial program 99.1%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around inf 67.7%
if -5.30000000000000028e81 < x < 1.48000000000000003e35Initial program 100.0%
associate-/l*100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in y around inf 51.7%
Final simplification58.5%
(FPCore (x y z) :precision binary64 (+ (* (/ 4.0 y) (- x z)) 2.0))
double code(double x, double y, double z) {
return ((4.0 / y) * (x - z)) + 2.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 / y) * (x - z)) + 2.0d0
end function
public static double code(double x, double y, double z) {
return ((4.0 / y) * (x - z)) + 2.0;
}
def code(x, y, z): return ((4.0 / y) * (x - z)) + 2.0
function code(x, y, z) return Float64(Float64(Float64(4.0 / y) * Float64(x - z)) + 2.0) end
function tmp = code(x, y, z) tmp = ((4.0 / y) * (x - z)) + 2.0; end
code[x_, y_, z_] := N[(N[(N[(4.0 / y), $MachinePrecision] * N[(x - z), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{4}{y} \cdot \left(x - z\right) + 2
\end{array}
Initial program 99.6%
+-commutative99.6%
associate-*l/99.8%
+-commutative99.8%
associate--l+99.8%
+-commutative99.8%
distribute-lft-in99.8%
associate-+l+99.8%
associate-*l/99.8%
*-commutative99.8%
associate-*l*99.8%
metadata-eval99.8%
*-rgt-identity99.8%
*-inverses99.8%
metadata-eval99.8%
Simplified99.8%
(FPCore (x y z) :precision binary64 2.0)
double code(double x, double y, double z) {
return 2.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 2.0d0
end function
public static double code(double x, double y, double z) {
return 2.0;
}
def code(x, y, z): return 2.0
function code(x, y, z) return 2.0 end
function tmp = code(x, y, z) tmp = 2.0; end
code[x_, y_, z_] := 2.0
\begin{array}{l}
\\
2
\end{array}
Initial program 99.6%
associate-/l*100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in y around inf 35.9%
herbie shell --seed 2024141
(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)))