
(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:
Herbie found 6 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (x y z) :precision binary64 (+ 4.0 (/ (* 4.0 (- x z)) y)))
double code(double x, double y, double z) {
return 4.0 + ((4.0 * (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 = 4.0d0 + ((4.0d0 * (x - z)) / y)
end function
public static double code(double x, double y, double z) {
return 4.0 + ((4.0 * (x - z)) / y);
}
def code(x, y, z): return 4.0 + ((4.0 * (x - z)) / y)
function code(x, y, z) return Float64(4.0 + Float64(Float64(4.0 * Float64(x - z)) / y)) end
function tmp = code(x, y, z) tmp = 4.0 + ((4.0 * (x - z)) / y); end
code[x_, y_, z_] := N[(4.0 + N[(N[(4.0 * N[(x - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
4 + \frac{4 \cdot \left(x - z\right)}{y}
\end{array}
Initial program 99.2%
+-commutative99.2%
associate-*l/99.7%
*-commutative99.7%
fma-def99.7%
+-commutative99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l-99.7%
sub-neg99.7%
remove-double-neg99.7%
distribute-neg-in99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-lft-neg-out99.7%
sub-neg99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
fma-neg99.7%
metadata-eval99.7%
remove-double-neg99.7%
Simplified99.7%
Taylor expanded in y around 0 100.0%
associate-*r/100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (* 4.0 (/ x y)) 1.0)) (t_1 (+ 1.0 (/ (* z -4.0) y))))
(if (<= z -17500000000000.0)
t_1
(if (<= z -1.4e-41)
t_0
(if (<= z -7e-145)
4.0
(if (<= z 1.06e-301)
t_0
(if (<= z 4e-152) 4.0 (if (<= z 1.45e+84) t_0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = (4.0 * (x / y)) + 1.0;
double t_1 = 1.0 + ((z * -4.0) / y);
double tmp;
if (z <= -17500000000000.0) {
tmp = t_1;
} else if (z <= -1.4e-41) {
tmp = t_0;
} else if (z <= -7e-145) {
tmp = 4.0;
} else if (z <= 1.06e-301) {
tmp = t_0;
} else if (z <= 4e-152) {
tmp = 4.0;
} else if (z <= 1.45e+84) {
tmp = t_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 = (4.0d0 * (x / y)) + 1.0d0
t_1 = 1.0d0 + ((z * (-4.0d0)) / y)
if (z <= (-17500000000000.0d0)) then
tmp = t_1
else if (z <= (-1.4d-41)) then
tmp = t_0
else if (z <= (-7d-145)) then
tmp = 4.0d0
else if (z <= 1.06d-301) then
tmp = t_0
else if (z <= 4d-152) then
tmp = 4.0d0
else if (z <= 1.45d+84) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (4.0 * (x / y)) + 1.0;
double t_1 = 1.0 + ((z * -4.0) / y);
double tmp;
if (z <= -17500000000000.0) {
tmp = t_1;
} else if (z <= -1.4e-41) {
tmp = t_0;
} else if (z <= -7e-145) {
tmp = 4.0;
} else if (z <= 1.06e-301) {
tmp = t_0;
} else if (z <= 4e-152) {
tmp = 4.0;
} else if (z <= 1.45e+84) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = (4.0 * (x / y)) + 1.0 t_1 = 1.0 + ((z * -4.0) / y) tmp = 0 if z <= -17500000000000.0: tmp = t_1 elif z <= -1.4e-41: tmp = t_0 elif z <= -7e-145: tmp = 4.0 elif z <= 1.06e-301: tmp = t_0 elif z <= 4e-152: tmp = 4.0 elif z <= 1.45e+84: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(Float64(4.0 * Float64(x / y)) + 1.0) t_1 = Float64(1.0 + Float64(Float64(z * -4.0) / y)) tmp = 0.0 if (z <= -17500000000000.0) tmp = t_1; elseif (z <= -1.4e-41) tmp = t_0; elseif (z <= -7e-145) tmp = 4.0; elseif (z <= 1.06e-301) tmp = t_0; elseif (z <= 4e-152) tmp = 4.0; elseif (z <= 1.45e+84) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (4.0 * (x / y)) + 1.0; t_1 = 1.0 + ((z * -4.0) / y); tmp = 0.0; if (z <= -17500000000000.0) tmp = t_1; elseif (z <= -1.4e-41) tmp = t_0; elseif (z <= -7e-145) tmp = 4.0; elseif (z <= 1.06e-301) tmp = t_0; elseif (z <= 4e-152) tmp = 4.0; elseif (z <= 1.45e+84) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(N[(z * -4.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -17500000000000.0], t$95$1, If[LessEqual[z, -1.4e-41], t$95$0, If[LessEqual[z, -7e-145], 4.0, If[LessEqual[z, 1.06e-301], t$95$0, If[LessEqual[z, 4e-152], 4.0, If[LessEqual[z, 1.45e+84], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 4 \cdot \frac{x}{y} + 1\\
t_1 := 1 + \frac{z \cdot -4}{y}\\
\mathbf{if}\;z \leq -17500000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-41}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-145}:\\
\;\;\;\;4\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{-301}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-152}:\\
\;\;\;\;4\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+84}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.75e13 or 1.44999999999999994e84 < z Initial program 99.1%
associate-*l/99.8%
+-commutative99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in z around inf 67.1%
associate-*r/67.1%
metadata-eval67.1%
associate-*r*67.1%
neg-mul-167.1%
associate-*l/67.0%
*-commutative67.0%
associate-*r/67.1%
neg-mul-167.1%
*-commutative67.1%
associate-*l*67.1%
metadata-eval67.1%
Simplified67.1%
if -1.75e13 < z < -1.4000000000000001e-41 or -6.99999999999999994e-145 < z < 1.06e-301 or 4.00000000000000026e-152 < z < 1.44999999999999994e84Initial program 98.7%
associate-*l/99.6%
+-commutative99.6%
fma-def99.7%
Simplified99.7%
Taylor expanded in x around inf 65.2%
if -1.4000000000000001e-41 < z < -6.99999999999999994e-145 or 1.06e-301 < z < 4.00000000000000026e-152Initial program 100.0%
+-commutative100.0%
associate-*l/99.7%
*-commutative99.7%
fma-def99.6%
+-commutative99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l-99.6%
sub-neg99.6%
remove-double-neg99.6%
distribute-neg-in99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-lft-neg-out99.6%
sub-neg99.6%
distribute-lft-neg-out99.6%
distribute-rgt-neg-in99.6%
fma-neg99.6%
metadata-eval99.6%
remove-double-neg99.6%
Simplified99.6%
Taylor expanded in y around inf 56.8%
Final simplification64.0%
(FPCore (x y z)
:precision binary64
(if (or (<= z -17500000000000.0)
(not (or (<= z 3e+84) (and (not (<= z 1.52e+147)) (<= z 1.18e+210)))))
(+ 1.0 (/ (* z -4.0) y))
(+ 4.0 (* 4.0 (/ x y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -17500000000000.0) || !((z <= 3e+84) || (!(z <= 1.52e+147) && (z <= 1.18e+210)))) {
tmp = 1.0 + ((z * -4.0) / y);
} else {
tmp = 4.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 <= (-17500000000000.0d0)) .or. (.not. (z <= 3d+84) .or. (.not. (z <= 1.52d+147)) .and. (z <= 1.18d+210))) then
tmp = 1.0d0 + ((z * (-4.0d0)) / y)
else
tmp = 4.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 <= -17500000000000.0) || !((z <= 3e+84) || (!(z <= 1.52e+147) && (z <= 1.18e+210)))) {
tmp = 1.0 + ((z * -4.0) / y);
} else {
tmp = 4.0 + (4.0 * (x / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -17500000000000.0) or not ((z <= 3e+84) or (not (z <= 1.52e+147) and (z <= 1.18e+210))): tmp = 1.0 + ((z * -4.0) / y) else: tmp = 4.0 + (4.0 * (x / y)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -17500000000000.0) || !((z <= 3e+84) || (!(z <= 1.52e+147) && (z <= 1.18e+210)))) tmp = Float64(1.0 + Float64(Float64(z * -4.0) / y)); else tmp = Float64(4.0 + Float64(4.0 * Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -17500000000000.0) || ~(((z <= 3e+84) || (~((z <= 1.52e+147)) && (z <= 1.18e+210))))) tmp = 1.0 + ((z * -4.0) / y); else tmp = 4.0 + (4.0 * (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -17500000000000.0], N[Not[Or[LessEqual[z, 3e+84], And[N[Not[LessEqual[z, 1.52e+147]], $MachinePrecision], LessEqual[z, 1.18e+210]]]], $MachinePrecision]], N[(1.0 + N[(N[(z * -4.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(4.0 + N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -17500000000000 \lor \neg \left(z \leq 3 \cdot 10^{+84} \lor \neg \left(z \leq 1.52 \cdot 10^{+147}\right) \land z \leq 1.18 \cdot 10^{+210}\right):\\
\;\;\;\;1 + \frac{z \cdot -4}{y}\\
\mathbf{else}:\\
\;\;\;\;4 + 4 \cdot \frac{x}{y}\\
\end{array}
\end{array}
if z < -1.75e13 or 2.99999999999999996e84 < z < 1.51999999999999992e147 or 1.18e210 < z Initial program 99.0%
associate-*l/99.8%
+-commutative99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in z around inf 71.6%
associate-*r/71.6%
metadata-eval71.6%
associate-*r*71.6%
neg-mul-171.6%
associate-*l/71.6%
*-commutative71.6%
associate-*r/71.6%
neg-mul-171.6%
*-commutative71.6%
associate-*l*71.6%
metadata-eval71.6%
Simplified71.6%
if -1.75e13 < z < 2.99999999999999996e84 or 1.51999999999999992e147 < z < 1.18e210Initial program 99.3%
+-commutative99.3%
associate-*l/99.7%
*-commutative99.7%
fma-def99.7%
+-commutative99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l-99.7%
sub-neg99.7%
remove-double-neg99.7%
distribute-neg-in99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-lft-neg-out99.7%
sub-neg99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
fma-neg99.7%
metadata-eval99.7%
remove-double-neg99.7%
Simplified99.7%
Taylor expanded in y around 0 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around inf 87.9%
Final simplification81.6%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.25e+42) (not (<= x 11800000.0))) (+ (* 4.0 (/ x y)) 1.0) 4.0))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.25e+42) || !(x <= 11800000.0)) {
tmp = (4.0 * (x / y)) + 1.0;
} 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 ((x <= (-1.25d+42)) .or. (.not. (x <= 11800000.0d0))) then
tmp = (4.0d0 * (x / y)) + 1.0d0
else
tmp = 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.25e+42) || !(x <= 11800000.0)) {
tmp = (4.0 * (x / y)) + 1.0;
} else {
tmp = 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.25e+42) or not (x <= 11800000.0): tmp = (4.0 * (x / y)) + 1.0 else: tmp = 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.25e+42) || !(x <= 11800000.0)) tmp = Float64(Float64(4.0 * Float64(x / y)) + 1.0); else tmp = 4.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.25e+42) || ~((x <= 11800000.0))) tmp = (4.0 * (x / y)) + 1.0; else tmp = 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.25e+42], N[Not[LessEqual[x, 11800000.0]], $MachinePrecision]], N[(N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], 4.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+42} \lor \neg \left(x \leq 11800000\right):\\
\;\;\;\;4 \cdot \frac{x}{y} + 1\\
\mathbf{else}:\\
\;\;\;\;4\\
\end{array}
\end{array}
if x < -1.25000000000000002e42 or 1.18e7 < x Initial program 99.2%
associate-*l/99.7%
+-commutative99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in x around inf 71.3%
if -1.25000000000000002e42 < x < 1.18e7Initial program 99.2%
+-commutative99.2%
associate-*l/99.8%
*-commutative99.8%
fma-def99.7%
+-commutative99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l-99.7%
sub-neg99.7%
remove-double-neg99.7%
distribute-neg-in99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-lft-neg-out99.7%
sub-neg99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
fma-neg99.7%
metadata-eval99.7%
remove-double-neg99.7%
Simplified99.7%
Taylor expanded in y around inf 47.2%
Final simplification58.9%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.12e+52) (not (<= x 4.5e+155))) (+ 4.0 (* 4.0 (/ x y))) (+ 4.0 (* z (/ -4.0 y)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.12e+52) || !(x <= 4.5e+155)) {
tmp = 4.0 + (4.0 * (x / y));
} else {
tmp = 4.0 + (z * (-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.12d+52)) .or. (.not. (x <= 4.5d+155))) then
tmp = 4.0d0 + (4.0d0 * (x / y))
else
tmp = 4.0d0 + (z * ((-4.0d0) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.12e+52) || !(x <= 4.5e+155)) {
tmp = 4.0 + (4.0 * (x / y));
} else {
tmp = 4.0 + (z * (-4.0 / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.12e+52) or not (x <= 4.5e+155): tmp = 4.0 + (4.0 * (x / y)) else: tmp = 4.0 + (z * (-4.0 / y)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.12e+52) || !(x <= 4.5e+155)) tmp = Float64(4.0 + Float64(4.0 * Float64(x / y))); else tmp = Float64(4.0 + Float64(z * Float64(-4.0 / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.12e+52) || ~((x <= 4.5e+155))) tmp = 4.0 + (4.0 * (x / y)); else tmp = 4.0 + (z * (-4.0 / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.12e+52], N[Not[LessEqual[x, 4.5e+155]], $MachinePrecision]], N[(4.0 + N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(4.0 + N[(z * N[(-4.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.12 \cdot 10^{+52} \lor \neg \left(x \leq 4.5 \cdot 10^{+155}\right):\\
\;\;\;\;4 + 4 \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;4 + z \cdot \frac{-4}{y}\\
\end{array}
\end{array}
if x < -1.12000000000000002e52 or 4.49999999999999973e155 < x Initial program 100.0%
+-commutative100.0%
associate-*l/99.6%
*-commutative99.6%
fma-def99.6%
+-commutative99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l-99.6%
sub-neg99.6%
remove-double-neg99.6%
distribute-neg-in99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-lft-neg-out99.6%
sub-neg99.6%
distribute-lft-neg-out99.6%
distribute-rgt-neg-in99.6%
fma-neg99.7%
metadata-eval99.7%
remove-double-neg99.7%
Simplified99.7%
Taylor expanded in y around 0 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around inf 92.9%
if -1.12000000000000002e52 < x < 4.49999999999999973e155Initial program 98.8%
+-commutative98.8%
associate-*l/99.8%
*-commutative99.8%
fma-def99.7%
+-commutative99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l-99.7%
sub-neg99.7%
remove-double-neg99.7%
distribute-neg-in99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-lft-neg-out99.7%
sub-neg99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
fma-neg99.7%
metadata-eval99.7%
remove-double-neg99.7%
Simplified99.7%
Taylor expanded in y around 0 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around 0 87.8%
metadata-eval87.8%
distribute-lft-neg-in87.8%
associate-*r/87.8%
associate-*l/87.8%
*-commutative87.8%
distribute-rgt-neg-in87.8%
distribute-neg-frac87.8%
metadata-eval87.8%
Simplified87.8%
Final simplification89.6%
(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}
Initial program 99.2%
+-commutative99.2%
associate-*l/99.7%
*-commutative99.7%
fma-def99.7%
+-commutative99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l-99.7%
sub-neg99.7%
remove-double-neg99.7%
distribute-neg-in99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-lft-neg-out99.7%
sub-neg99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
fma-neg99.7%
metadata-eval99.7%
remove-double-neg99.7%
Simplified99.7%
Taylor expanded in y around inf 32.5%
Final simplification32.5%
herbie shell --seed 2024011
(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)))