
(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 7 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.6%
associate-*l/99.6%
+-commutative99.6%
fma-def99.6%
Simplified99.6%
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))))
(if (<= x -3.5e+177)
t_0
(if (<= x -2.45e+81)
4.0
(if (<= x -1050000000000.0)
t_0
(if (<= x -5.3e-223)
4.0
(if (<= x 3.8e-203)
(/ (* z -4.0) y)
(if (<= x 1.2e+70) 4.0 t_0))))))))
double code(double x, double y, double z) {
double t_0 = 4.0 * (x / y);
double tmp;
if (x <= -3.5e+177) {
tmp = t_0;
} else if (x <= -2.45e+81) {
tmp = 4.0;
} else if (x <= -1050000000000.0) {
tmp = t_0;
} else if (x <= -5.3e-223) {
tmp = 4.0;
} else if (x <= 3.8e-203) {
tmp = (z * -4.0) / y;
} else if (x <= 1.2e+70) {
tmp = 4.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 = 4.0d0 * (x / y)
if (x <= (-3.5d+177)) then
tmp = t_0
else if (x <= (-2.45d+81)) then
tmp = 4.0d0
else if (x <= (-1050000000000.0d0)) then
tmp = t_0
else if (x <= (-5.3d-223)) then
tmp = 4.0d0
else if (x <= 3.8d-203) then
tmp = (z * (-4.0d0)) / y
else if (x <= 1.2d+70) then
tmp = 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 4.0 * (x / y);
double tmp;
if (x <= -3.5e+177) {
tmp = t_0;
} else if (x <= -2.45e+81) {
tmp = 4.0;
} else if (x <= -1050000000000.0) {
tmp = t_0;
} else if (x <= -5.3e-223) {
tmp = 4.0;
} else if (x <= 3.8e-203) {
tmp = (z * -4.0) / y;
} else if (x <= 1.2e+70) {
tmp = 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 4.0 * (x / y) tmp = 0 if x <= -3.5e+177: tmp = t_0 elif x <= -2.45e+81: tmp = 4.0 elif x <= -1050000000000.0: tmp = t_0 elif x <= -5.3e-223: tmp = 4.0 elif x <= 3.8e-203: tmp = (z * -4.0) / y elif x <= 1.2e+70: tmp = 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(4.0 * Float64(x / y)) tmp = 0.0 if (x <= -3.5e+177) tmp = t_0; elseif (x <= -2.45e+81) tmp = 4.0; elseif (x <= -1050000000000.0) tmp = t_0; elseif (x <= -5.3e-223) tmp = 4.0; elseif (x <= 3.8e-203) tmp = Float64(Float64(z * -4.0) / y); elseif (x <= 1.2e+70) tmp = 4.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 4.0 * (x / y); tmp = 0.0; if (x <= -3.5e+177) tmp = t_0; elseif (x <= -2.45e+81) tmp = 4.0; elseif (x <= -1050000000000.0) tmp = t_0; elseif (x <= -5.3e-223) tmp = 4.0; elseif (x <= 3.8e-203) tmp = (z * -4.0) / y; elseif (x <= 1.2e+70) tmp = 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.5e+177], t$95$0, If[LessEqual[x, -2.45e+81], 4.0, If[LessEqual[x, -1050000000000.0], t$95$0, If[LessEqual[x, -5.3e-223], 4.0, If[LessEqual[x, 3.8e-203], N[(N[(z * -4.0), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[x, 1.2e+70], 4.0, t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 4 \cdot \frac{x}{y}\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{+177}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -2.45 \cdot 10^{+81}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq -1050000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -5.3 \cdot 10^{-223}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-203}:\\
\;\;\;\;\frac{z \cdot -4}{y}\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+70}:\\
\;\;\;\;4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -3.49999999999999991e177 or -2.45000000000000011e81 < x < -1.05e12 or 1.19999999999999993e70 < x Initial program 100.0%
associate-*l/99.7%
+-commutative99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in y around 0 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around inf 71.7%
if -3.49999999999999991e177 < x < -2.45000000000000011e81 or -1.05e12 < x < -5.30000000000000027e-223 or 3.80000000000000025e-203 < x < 1.19999999999999993e70Initial program 99.1%
associate-*l/99.7%
+-commutative99.7%
fma-def99.6%
Simplified99.6%
Taylor expanded in y around inf 58.0%
if -5.30000000000000027e-223 < x < 3.80000000000000025e-203Initial program 100.0%
associate-*l/99.4%
+-commutative99.4%
fma-def99.4%
Simplified99.4%
Taylor expanded in y around 0 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in z around inf 58.6%
associate-*r/58.6%
Simplified58.6%
Final simplification63.5%
(FPCore (x y z)
:precision binary64
(if (or (<= x -6.5e+177)
(and (not (<= x -3.2e+81))
(or (<= x -120000000000.0) (not (<= x 2.2e+72)))))
(* 4.0 (/ x y))
4.0))
double code(double x, double y, double z) {
double tmp;
if ((x <= -6.5e+177) || (!(x <= -3.2e+81) && ((x <= -120000000000.0) || !(x <= 2.2e+72)))) {
tmp = 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 ((x <= (-6.5d+177)) .or. (.not. (x <= (-3.2d+81))) .and. (x <= (-120000000000.0d0)) .or. (.not. (x <= 2.2d+72))) then
tmp = 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 ((x <= -6.5e+177) || (!(x <= -3.2e+81) && ((x <= -120000000000.0) || !(x <= 2.2e+72)))) {
tmp = 4.0 * (x / y);
} else {
tmp = 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -6.5e+177) or (not (x <= -3.2e+81) and ((x <= -120000000000.0) or not (x <= 2.2e+72))): tmp = 4.0 * (x / y) else: tmp = 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -6.5e+177) || (!(x <= -3.2e+81) && ((x <= -120000000000.0) || !(x <= 2.2e+72)))) tmp = 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 ((x <= -6.5e+177) || (~((x <= -3.2e+81)) && ((x <= -120000000000.0) || ~((x <= 2.2e+72))))) tmp = 4.0 * (x / y); else tmp = 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -6.5e+177], And[N[Not[LessEqual[x, -3.2e+81]], $MachinePrecision], Or[LessEqual[x, -120000000000.0], N[Not[LessEqual[x, 2.2e+72]], $MachinePrecision]]]], N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision], 4.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{+177} \lor \neg \left(x \leq -3.2 \cdot 10^{+81}\right) \land \left(x \leq -120000000000 \lor \neg \left(x \leq 2.2 \cdot 10^{+72}\right)\right):\\
\;\;\;\;4 \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;4\\
\end{array}
\end{array}
if x < -6.5000000000000002e177 or -3.2e81 < x < -1.2e11 or 2.2e72 < x Initial program 100.0%
associate-*l/99.7%
+-commutative99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in y around 0 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around inf 71.7%
if -6.5000000000000002e177 < x < -3.2e81 or -1.2e11 < x < 2.2e72Initial program 99.3%
associate-*l/99.6%
+-commutative99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in y around inf 53.7%
Final simplification60.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.5e+69) (not (<= y 1.4e+61))) (+ 4.0 (* -4.0 (/ z y))) (* (- x z) (/ 4.0 y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.5e+69) || !(y <= 1.4e+61)) {
tmp = 4.0 + (-4.0 * (z / y));
} else {
tmp = (x - 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 ((y <= (-1.5d+69)) .or. (.not. (y <= 1.4d+61))) then
tmp = 4.0d0 + ((-4.0d0) * (z / y))
else
tmp = (x - z) * (4.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.5e+69) || !(y <= 1.4e+61)) {
tmp = 4.0 + (-4.0 * (z / y));
} else {
tmp = (x - z) * (4.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.5e+69) or not (y <= 1.4e+61): tmp = 4.0 + (-4.0 * (z / y)) else: tmp = (x - z) * (4.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.5e+69) || !(y <= 1.4e+61)) tmp = Float64(4.0 + Float64(-4.0 * Float64(z / y))); else tmp = Float64(Float64(x - z) * Float64(4.0 / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.5e+69) || ~((y <= 1.4e+61))) tmp = 4.0 + (-4.0 * (z / y)); else tmp = (x - z) * (4.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.5e+69], N[Not[LessEqual[y, 1.4e+61]], $MachinePrecision]], N[(4.0 + N[(-4.0 * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - z), $MachinePrecision] * N[(4.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+69} \lor \neg \left(y \leq 1.4 \cdot 10^{+61}\right):\\
\;\;\;\;4 + -4 \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(x - z\right) \cdot \frac{4}{y}\\
\end{array}
\end{array}
if y < -1.49999999999999992e69 or 1.4000000000000001e61 < y Initial program 99.0%
associate-*l/99.6%
+-commutative99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in y around 0 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around 0 89.6%
if -1.49999999999999992e69 < y < 1.4000000000000001e61Initial program 100.0%
associate-*l/99.7%
+-commutative99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in y around 0 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 86.4%
div-sub83.1%
sub-neg83.1%
distribute-lft-in83.1%
associate-*r/83.1%
associate-*l/82.9%
distribute-rgt-neg-in82.9%
associate-*r/82.9%
associate-*l/82.8%
distribute-rgt-neg-in82.8%
distribute-lft-out86.2%
sub-neg86.2%
Simplified86.2%
Final simplification87.6%
(FPCore (x y z) :precision binary64 (if (<= y -3.5e+149) 4.0 (if (<= y 7e+109) (* (- x z) (/ 4.0 y)) 4.0)))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.5e+149) {
tmp = 4.0;
} else if (y <= 7e+109) {
tmp = (x - z) * (4.0 / 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.5d+149)) then
tmp = 4.0d0
else if (y <= 7d+109) then
tmp = (x - z) * (4.0d0 / 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.5e+149) {
tmp = 4.0;
} else if (y <= 7e+109) {
tmp = (x - z) * (4.0 / y);
} else {
tmp = 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3.5e+149: tmp = 4.0 elif y <= 7e+109: tmp = (x - z) * (4.0 / y) else: tmp = 4.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3.5e+149) tmp = 4.0; elseif (y <= 7e+109) tmp = Float64(Float64(x - z) * Float64(4.0 / y)); else tmp = 4.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3.5e+149) tmp = 4.0; elseif (y <= 7e+109) tmp = (x - z) * (4.0 / y); else tmp = 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3.5e+149], 4.0, If[LessEqual[y, 7e+109], N[(N[(x - z), $MachinePrecision] * N[(4.0 / y), $MachinePrecision]), $MachinePrecision], 4.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+149}:\\
\;\;\;\;4\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+109}:\\
\;\;\;\;\left(x - z\right) \cdot \frac{4}{y}\\
\mathbf{else}:\\
\;\;\;\;4\\
\end{array}
\end{array}
if y < -3.50000000000000011e149 or 6.99999999999999966e109 < y Initial program 98.8%
associate-*l/99.6%
+-commutative99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in y around inf 82.5%
if -3.50000000000000011e149 < y < 6.99999999999999966e109Initial program 100.0%
associate-*l/99.6%
+-commutative99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in y around 0 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 84.2%
div-sub81.3%
sub-neg81.3%
distribute-lft-in81.3%
associate-*r/81.3%
associate-*l/81.2%
distribute-rgt-neg-in81.2%
associate-*r/81.2%
associate-*l/81.1%
distribute-rgt-neg-in81.1%
distribute-lft-out84.0%
sub-neg84.0%
Simplified84.0%
Final simplification83.5%
(FPCore (x y z) :precision binary64 (if (<= z -2.8e-61) (* (- x z) (/ 4.0 y)) (if (<= z 6.2e+87) (+ 4.0 (* 4.0 (/ x y))) (+ 4.0 (* -4.0 (/ z y))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.8e-61) {
tmp = (x - z) * (4.0 / y);
} else if (z <= 6.2e+87) {
tmp = 4.0 + (4.0 * (x / y));
} else {
tmp = 4.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 (z <= (-2.8d-61)) then
tmp = (x - z) * (4.0d0 / y)
else if (z <= 6.2d+87) then
tmp = 4.0d0 + (4.0d0 * (x / y))
else
tmp = 4.0d0 + ((-4.0d0) * (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.8e-61) {
tmp = (x - z) * (4.0 / y);
} else if (z <= 6.2e+87) {
tmp = 4.0 + (4.0 * (x / y));
} else {
tmp = 4.0 + (-4.0 * (z / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.8e-61: tmp = (x - z) * (4.0 / y) elif z <= 6.2e+87: tmp = 4.0 + (4.0 * (x / y)) else: tmp = 4.0 + (-4.0 * (z / y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.8e-61) tmp = Float64(Float64(x - z) * Float64(4.0 / y)); elseif (z <= 6.2e+87) tmp = Float64(4.0 + Float64(4.0 * Float64(x / y))); else tmp = Float64(4.0 + Float64(-4.0 * Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.8e-61) tmp = (x - z) * (4.0 / y); elseif (z <= 6.2e+87) tmp = 4.0 + (4.0 * (x / y)); else tmp = 4.0 + (-4.0 * (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.8e-61], N[(N[(x - z), $MachinePrecision] * N[(4.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+87], N[(4.0 + N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(4.0 + N[(-4.0 * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-61}:\\
\;\;\;\;\left(x - z\right) \cdot \frac{4}{y}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+87}:\\
\;\;\;\;4 + 4 \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;4 + -4 \cdot \frac{z}{y}\\
\end{array}
\end{array}
if z < -2.8000000000000001e-61Initial program 100.0%
associate-*l/99.7%
+-commutative99.7%
fma-def99.6%
Simplified99.6%
Taylor expanded in y around 0 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 83.3%
div-sub78.4%
sub-neg78.4%
distribute-lft-in78.4%
associate-*r/78.4%
associate-*l/78.3%
distribute-rgt-neg-in78.3%
associate-*r/78.3%
associate-*l/78.2%
distribute-rgt-neg-in78.2%
distribute-lft-out83.0%
sub-neg83.0%
Simplified83.0%
if -2.8000000000000001e-61 < z < 6.1999999999999999e87Initial program 99.9%
associate-*l/99.7%
+-commutative99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in y around 0 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in z around 0 96.2%
if 6.1999999999999999e87 < z Initial program 97.9%
associate-*l/99.6%
+-commutative99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in y around 0 100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around 0 87.8%
Final simplification90.4%
(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.6%
associate-*l/99.6%
+-commutative99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in y around inf 37.9%
Final simplification37.9%
herbie shell --seed 2024010
(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)))