
(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 9 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 (+ (* 4.0 (/ (- x z) y)) 2.0))
double code(double x, double y, double z) {
return (4.0 * ((x - z) / y)) + 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 * ((x - z) / y)) + 2.0d0
end function
public static double code(double x, double y, double z) {
return (4.0 * ((x - z) / y)) + 2.0;
}
def code(x, y, z): return (4.0 * ((x - z) / y)) + 2.0
function code(x, y, z) return Float64(Float64(4.0 * Float64(Float64(x - z) / y)) + 2.0) end
function tmp = code(x, y, z) tmp = (4.0 * ((x - z) / y)) + 2.0; end
code[x_, y_, z_] := N[(N[(4.0 * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]
\begin{array}{l}
\\
4 \cdot \frac{x - z}{y} + 2
\end{array}
Initial program 100.0%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 1.0 (/ (* 4.0 x) y))) (t_1 (+ (* -4.0 (/ z y)) 1.0)))
(if (<= z -1.45e+152)
t_1
(if (<= z -2.25e+21)
t_0
(if (<= z -9.5e-149)
2.0
(if (<= z -3.4e-182) t_0 (if (<= z 5e+34) 2.0 t_1)))))))
double code(double x, double y, double z) {
double t_0 = 1.0 + ((4.0 * x) / y);
double t_1 = (-4.0 * (z / y)) + 1.0;
double tmp;
if (z <= -1.45e+152) {
tmp = t_1;
} else if (z <= -2.25e+21) {
tmp = t_0;
} else if (z <= -9.5e-149) {
tmp = 2.0;
} else if (z <= -3.4e-182) {
tmp = t_0;
} else if (z <= 5e+34) {
tmp = 2.0;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = 1.0d0 + ((4.0d0 * x) / y)
t_1 = ((-4.0d0) * (z / y)) + 1.0d0
if (z <= (-1.45d+152)) then
tmp = t_1
else if (z <= (-2.25d+21)) then
tmp = t_0
else if (z <= (-9.5d-149)) then
tmp = 2.0d0
else if (z <= (-3.4d-182)) then
tmp = t_0
else if (z <= 5d+34) then
tmp = 2.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 + ((4.0 * x) / y);
double t_1 = (-4.0 * (z / y)) + 1.0;
double tmp;
if (z <= -1.45e+152) {
tmp = t_1;
} else if (z <= -2.25e+21) {
tmp = t_0;
} else if (z <= -9.5e-149) {
tmp = 2.0;
} else if (z <= -3.4e-182) {
tmp = t_0;
} else if (z <= 5e+34) {
tmp = 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 + ((4.0 * x) / y) t_1 = (-4.0 * (z / y)) + 1.0 tmp = 0 if z <= -1.45e+152: tmp = t_1 elif z <= -2.25e+21: tmp = t_0 elif z <= -9.5e-149: tmp = 2.0 elif z <= -3.4e-182: tmp = t_0 elif z <= 5e+34: tmp = 2.0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(1.0 + Float64(Float64(4.0 * x) / y)) t_1 = Float64(Float64(-4.0 * Float64(z / y)) + 1.0) tmp = 0.0 if (z <= -1.45e+152) tmp = t_1; elseif (z <= -2.25e+21) tmp = t_0; elseif (z <= -9.5e-149) tmp = 2.0; elseif (z <= -3.4e-182) tmp = t_0; elseif (z <= 5e+34) tmp = 2.0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 + ((4.0 * x) / y); t_1 = (-4.0 * (z / y)) + 1.0; tmp = 0.0; if (z <= -1.45e+152) tmp = t_1; elseif (z <= -2.25e+21) tmp = t_0; elseif (z <= -9.5e-149) tmp = 2.0; elseif (z <= -3.4e-182) tmp = t_0; elseif (z <= 5e+34) tmp = 2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 + N[(N[(4.0 * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-4.0 * N[(z / y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[z, -1.45e+152], t$95$1, If[LessEqual[z, -2.25e+21], t$95$0, If[LessEqual[z, -9.5e-149], 2.0, If[LessEqual[z, -3.4e-182], t$95$0, If[LessEqual[z, 5e+34], 2.0, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{4 \cdot x}{y}\\
t_1 := -4 \cdot \frac{z}{y} + 1\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+152}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{+21}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-149}:\\
\;\;\;\;2\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-182}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+34}:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.4499999999999999e152 or 4.9999999999999998e34 < z Initial program 99.9%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in z around inf 71.2%
*-commutative71.2%
Simplified71.2%
if -1.4499999999999999e152 < z < -2.25e21 or -9.50000000000000034e-149 < z < -3.39999999999999989e-182Initial program 100.0%
Taylor expanded in x around inf 62.1%
if -2.25e21 < z < -9.50000000000000034e-149 or -3.39999999999999989e-182 < z < 4.9999999999999998e34Initial program 100.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 62.4%
Final simplification65.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -65.0) (not (<= z 7e+38))) (+ (* -4.0 (/ z y)) 1.0) 2.0))
double code(double x, double y, double z) {
double tmp;
if ((z <= -65.0) || !(z <= 7e+38)) {
tmp = (-4.0 * (z / y)) + 1.0;
} 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 ((z <= (-65.0d0)) .or. (.not. (z <= 7d+38))) then
tmp = ((-4.0d0) * (z / y)) + 1.0d0
else
tmp = 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -65.0) || !(z <= 7e+38)) {
tmp = (-4.0 * (z / y)) + 1.0;
} else {
tmp = 2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -65.0) or not (z <= 7e+38): tmp = (-4.0 * (z / y)) + 1.0 else: tmp = 2.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -65.0) || !(z <= 7e+38)) tmp = Float64(Float64(-4.0 * Float64(z / y)) + 1.0); else tmp = 2.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -65.0) || ~((z <= 7e+38))) tmp = (-4.0 * (z / y)) + 1.0; else tmp = 2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -65.0], N[Not[LessEqual[z, 7e+38]], $MachinePrecision]], N[(N[(-4.0 * N[(z / y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], 2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -65 \lor \neg \left(z \leq 7 \cdot 10^{+38}\right):\\
\;\;\;\;-4 \cdot \frac{z}{y} + 1\\
\mathbf{else}:\\
\;\;\;\;2\\
\end{array}
\end{array}
if z < -65 or 7.00000000000000003e38 < z Initial program 99.9%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in z around inf 62.2%
*-commutative62.2%
Simplified62.2%
if -65 < z < 7.00000000000000003e38Initial program 100.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 60.1%
Final simplification61.1%
(FPCore (x y z) :precision binary64 (if (or (<= x -2.55e+163) (not (<= x 1.65e+154))) (+ 1.0 (/ (* 4.0 x) y)) (+ 2.0 (* -4.0 (/ z y)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.55e+163) || !(x <= 1.65e+154)) {
tmp = 1.0 + ((4.0 * x) / y);
} else {
tmp = 2.0 + (-4.0 * (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 ((x <= (-2.55d+163)) .or. (.not. (x <= 1.65d+154))) then
tmp = 1.0d0 + ((4.0d0 * x) / y)
else
tmp = 2.0d0 + ((-4.0d0) * (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -2.55e+163) || !(x <= 1.65e+154)) {
tmp = 1.0 + ((4.0 * x) / y);
} else {
tmp = 2.0 + (-4.0 * (z / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.55e+163) or not (x <= 1.65e+154): tmp = 1.0 + ((4.0 * x) / y) else: tmp = 2.0 + (-4.0 * (z / y)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.55e+163) || !(x <= 1.65e+154)) tmp = Float64(1.0 + Float64(Float64(4.0 * x) / y)); else tmp = Float64(2.0 + Float64(-4.0 * Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -2.55e+163) || ~((x <= 1.65e+154))) tmp = 1.0 + ((4.0 * x) / y); else tmp = 2.0 + (-4.0 * (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.55e+163], N[Not[LessEqual[x, 1.65e+154]], $MachinePrecision]], N[(1.0 + N[(N[(4.0 * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(2.0 + N[(-4.0 * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.55 \cdot 10^{+163} \lor \neg \left(x \leq 1.65 \cdot 10^{+154}\right):\\
\;\;\;\;1 + \frac{4 \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;2 + -4 \cdot \frac{z}{y}\\
\end{array}
\end{array}
if x < -2.5500000000000001e163 or 1.65e154 < x Initial program 100.0%
Taylor expanded in x around inf 80.5%
if -2.5500000000000001e163 < x < 1.65e154Initial program 100.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 83.7%
neg-mul-183.7%
distribute-neg-frac83.7%
Simplified83.7%
Taylor expanded in z around 0 83.7%
Final simplification83.0%
(FPCore (x y z) :precision binary64 (if (or (<= x -14000000000.0) (not (<= x 2.3e+75))) (+ 2.0 (* 4.0 (/ x y))) (+ 2.0 (* -4.0 (/ z y)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -14000000000.0) || !(x <= 2.3e+75)) {
tmp = 2.0 + (4.0 * (x / y));
} else {
tmp = 2.0 + (-4.0 * (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 ((x <= (-14000000000.0d0)) .or. (.not. (x <= 2.3d+75))) then
tmp = 2.0d0 + (4.0d0 * (x / y))
else
tmp = 2.0d0 + ((-4.0d0) * (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -14000000000.0) || !(x <= 2.3e+75)) {
tmp = 2.0 + (4.0 * (x / y));
} else {
tmp = 2.0 + (-4.0 * (z / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -14000000000.0) or not (x <= 2.3e+75): tmp = 2.0 + (4.0 * (x / y)) else: tmp = 2.0 + (-4.0 * (z / y)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -14000000000.0) || !(x <= 2.3e+75)) tmp = Float64(2.0 + Float64(4.0 * Float64(x / y))); else tmp = Float64(2.0 + Float64(-4.0 * Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -14000000000.0) || ~((x <= 2.3e+75))) tmp = 2.0 + (4.0 * (x / y)); else tmp = 2.0 + (-4.0 * (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -14000000000.0], N[Not[LessEqual[x, 2.3e+75]], $MachinePrecision]], N[(2.0 + N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 + N[(-4.0 * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -14000000000 \lor \neg \left(x \leq 2.3 \cdot 10^{+75}\right):\\
\;\;\;\;2 + 4 \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;2 + -4 \cdot \frac{z}{y}\\
\end{array}
\end{array}
if x < -1.4e10 or 2.2999999999999999e75 < x Initial program 100.0%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 86.8%
if -1.4e10 < x < 2.2999999999999999e75Initial program 100.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 91.7%
neg-mul-191.7%
distribute-neg-frac91.7%
Simplified91.7%
Taylor expanded in z around 0 91.7%
Final simplification89.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -95.0) (not (<= z 1.45e+35))) (/ z (/ y -4.0)) 2.0))
double code(double x, double y, double z) {
double tmp;
if ((z <= -95.0) || !(z <= 1.45e+35)) {
tmp = z / (y / -4.0);
} 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 ((z <= (-95.0d0)) .or. (.not. (z <= 1.45d+35))) then
tmp = z / (y / (-4.0d0))
else
tmp = 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -95.0) || !(z <= 1.45e+35)) {
tmp = z / (y / -4.0);
} else {
tmp = 2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -95.0) or not (z <= 1.45e+35): tmp = z / (y / -4.0) else: tmp = 2.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -95.0) || !(z <= 1.45e+35)) tmp = Float64(z / Float64(y / -4.0)); else tmp = 2.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -95.0) || ~((z <= 1.45e+35))) tmp = z / (y / -4.0); else tmp = 2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -95.0], N[Not[LessEqual[z, 1.45e+35]], $MachinePrecision]], N[(z / N[(y / -4.0), $MachinePrecision]), $MachinePrecision], 2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -95 \lor \neg \left(z \leq 1.45 \cdot 10^{+35}\right):\\
\;\;\;\;\frac{z}{\frac{y}{-4}}\\
\mathbf{else}:\\
\;\;\;\;2\\
\end{array}
\end{array}
if z < -95 or 1.44999999999999997e35 < z Initial program 99.9%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 78.4%
neg-mul-178.4%
distribute-neg-frac78.4%
Simplified78.4%
Taylor expanded in z around 0 78.4%
Taylor expanded in z around inf 59.6%
*-commutative59.6%
associate-*l/59.6%
associate-/l*59.6%
Simplified59.6%
if -95 < z < 1.44999999999999997e35Initial program 100.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 60.1%
Final simplification59.8%
(FPCore (x y z) :precision binary64 (+ 2.0 (* (- x z) (/ 4.0 y))))
double code(double x, double y, double z) {
return 2.0 + ((x - z) * (4.0 / y));
}
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 + ((x - z) * (4.0d0 / y))
end function
public static double code(double x, double y, double z) {
return 2.0 + ((x - z) * (4.0 / y));
}
def code(x, y, z): return 2.0 + ((x - z) * (4.0 / y))
function code(x, y, z) return Float64(2.0 + Float64(Float64(x - z) * Float64(4.0 / y))) end
function tmp = code(x, y, z) tmp = 2.0 + ((x - z) * (4.0 / y)); end
code[x_, y_, z_] := N[(2.0 + N[(N[(x - z), $MachinePrecision] * N[(4.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 + \left(x - z\right) \cdot \frac{4}{y}
\end{array}
Initial program 100.0%
associate-*l/99.8%
+-commutative99.8%
associate--l+99.8%
distribute-lft-in99.8%
associate-+r+99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 1.0)
double code(double x, double y, double z) {
return 1.0;
}
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
end function
public static double code(double x, double y, double z) {
return 1.0;
}
def code(x, y, z): return 1.0
function code(x, y, z) return 1.0 end
function tmp = code(x, y, z) tmp = 1.0; end
code[x_, y_, z_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 100.0%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in z around inf 38.3%
*-commutative38.3%
Simplified38.3%
Taylor expanded in z around 0 9.1%
Final simplification9.1%
(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 100.0%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in y around inf 40.4%
Final simplification40.4%
herbie shell --seed 2023293
(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)))