
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
(FPCore (x y z) :precision binary64 (+ x (* (- y x) (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
return x + ((y - x) * (4.0 + (z * -6.0)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((y - x) * (4.0d0 + (z * (-6.0d0))))
end function
public static double code(double x, double y, double z) {
return x + ((y - x) * (4.0 + (z * -6.0)));
}
def code(x, y, z): return x + ((y - x) * (4.0 + (z * -6.0)))
function code(x, y, z) return Float64(x + Float64(Float64(y - x) * Float64(4.0 + Float64(z * -6.0)))) end
function tmp = code(x, y, z) tmp = x + ((y - x) * (4.0 + (z * -6.0))); end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \left(4 + z \cdot -6\right)
\end{array}
Initial program 98.9%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.8%
Simplified99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -1.05e-7)
t_0
(if (<= z -1.32e-93)
(* y 4.0)
(if (<= z -3.35e-301) (* x -3.0) (if (<= z 950000.0) (* y 4.0) t_0))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -1.05e-7) {
tmp = t_0;
} else if (z <= -1.32e-93) {
tmp = y * 4.0;
} else if (z <= -3.35e-301) {
tmp = x * -3.0;
} else if (z <= 950000.0) {
tmp = y * 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 = (-6.0d0) * (y * z)
if (z <= (-1.05d-7)) then
tmp = t_0
else if (z <= (-1.32d-93)) then
tmp = y * 4.0d0
else if (z <= (-3.35d-301)) then
tmp = x * (-3.0d0)
else if (z <= 950000.0d0) then
tmp = y * 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 = -6.0 * (y * z);
double tmp;
if (z <= -1.05e-7) {
tmp = t_0;
} else if (z <= -1.32e-93) {
tmp = y * 4.0;
} else if (z <= -3.35e-301) {
tmp = x * -3.0;
} else if (z <= 950000.0) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -1.05e-7: tmp = t_0 elif z <= -1.32e-93: tmp = y * 4.0 elif z <= -3.35e-301: tmp = x * -3.0 elif z <= 950000.0: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -1.05e-7) tmp = t_0; elseif (z <= -1.32e-93) tmp = Float64(y * 4.0); elseif (z <= -3.35e-301) tmp = Float64(x * -3.0); elseif (z <= 950000.0) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -1.05e-7) tmp = t_0; elseif (z <= -1.32e-93) tmp = y * 4.0; elseif (z <= -3.35e-301) tmp = x * -3.0; elseif (z <= 950000.0) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e-7], t$95$0, If[LessEqual[z, -1.32e-93], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -3.35e-301], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 950000.0], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.32 \cdot 10^{-93}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -3.35 \cdot 10^{-301}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 950000:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.05e-7 or 9.5e5 < z Initial program 99.7%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6457.7%
Simplified57.7%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6457.7%
Applied egg-rr57.7%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f6457.0%
Simplified57.0%
if -1.05e-7 < z < -1.3200000000000001e-93 or -3.35000000000000011e-301 < z < 9.5e5Initial program 99.5%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6456.2%
Simplified56.2%
Taylor expanded in z around 0
*-commutativeN/A
*-lowering-*.f6455.4%
Simplified55.4%
if -1.3200000000000001e-93 < z < -3.35000000000000011e-301Initial program 95.6%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0
Simplified99.8%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6462.3%
Simplified62.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* y (- 0.6666666666666666 z)))))
(if (<= y -2.2e-81)
t_0
(if (<= y -9.6e-238)
(* x -3.0)
(if (<= y 3.4e-124) (* z (* x 6.0)) t_0)))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double tmp;
if (y <= -2.2e-81) {
tmp = t_0;
} else if (y <= -9.6e-238) {
tmp = x * -3.0;
} else if (y <= 3.4e-124) {
tmp = z * (x * 6.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 = 6.0d0 * (y * (0.6666666666666666d0 - z))
if (y <= (-2.2d-81)) then
tmp = t_0
else if (y <= (-9.6d-238)) then
tmp = x * (-3.0d0)
else if (y <= 3.4d-124) then
tmp = z * (x * 6.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double tmp;
if (y <= -2.2e-81) {
tmp = t_0;
} else if (y <= -9.6e-238) {
tmp = x * -3.0;
} else if (y <= 3.4e-124) {
tmp = z * (x * 6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (y * (0.6666666666666666 - z)) tmp = 0 if y <= -2.2e-81: tmp = t_0 elif y <= -9.6e-238: tmp = x * -3.0 elif y <= 3.4e-124: tmp = z * (x * 6.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))) tmp = 0.0 if (y <= -2.2e-81) tmp = t_0; elseif (y <= -9.6e-238) tmp = Float64(x * -3.0); elseif (y <= 3.4e-124) tmp = Float64(z * Float64(x * 6.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (y * (0.6666666666666666 - z)); tmp = 0.0; if (y <= -2.2e-81) tmp = t_0; elseif (y <= -9.6e-238) tmp = x * -3.0; elseif (y <= 3.4e-124) tmp = z * (x * 6.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e-81], t$95$0, If[LessEqual[y, -9.6e-238], N[(x * -3.0), $MachinePrecision], If[LessEqual[y, 3.4e-124], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{-81}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -9.6 \cdot 10^{-238}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-124}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -2.1999999999999999e-81 or 3.4000000000000001e-124 < y Initial program 99.1%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6474.6%
Simplified74.6%
if -2.1999999999999999e-81 < y < -9.5999999999999994e-238Initial program 97.0%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0
Simplified67.2%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6464.1%
Simplified64.1%
if -9.5999999999999994e-238 < y < 3.4000000000000001e-124Initial program 99.5%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.8%
Simplified99.8%
*-commutativeN/A
flip--N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f6499.5%
Applied egg-rr99.5%
Taylor expanded in y around 0
/-lowering-/.f6489.7%
Simplified89.7%
Taylor expanded in z around inf
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f6456.3%
Simplified56.3%
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
associate-/r/N/A
*-lowering-*.f64N/A
associate-/r/N/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f6456.3%
Applied egg-rr56.3%
Final simplification69.5%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* z (* (- y x) -6.0)))) (if (<= z -0.56) t_0 (if (<= z 0.62) (+ (* y 4.0) (* x -3.0)) t_0))))
double code(double x, double y, double z) {
double t_0 = z * ((y - x) * -6.0);
double tmp;
if (z <= -0.56) {
tmp = t_0;
} else if (z <= 0.62) {
tmp = (y * 4.0) + (x * -3.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 - x) * (-6.0d0))
if (z <= (-0.56d0)) then
tmp = t_0
else if (z <= 0.62d0) then
tmp = (y * 4.0d0) + (x * (-3.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 - x) * -6.0);
double tmp;
if (z <= -0.56) {
tmp = t_0;
} else if (z <= 0.62) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * ((y - x) * -6.0) tmp = 0 if z <= -0.56: tmp = t_0 elif z <= 0.62: tmp = (y * 4.0) + (x * -3.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(y - x) * -6.0)) tmp = 0.0 if (z <= -0.56) tmp = t_0; elseif (z <= 0.62) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((y - x) * -6.0); tmp = 0.0; if (z <= -0.56) tmp = t_0; elseif (z <= 0.62) tmp = (y * 4.0) + (x * -3.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.56], t$95$0, If[LessEqual[z, 0.62], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{if}\;z \leq -0.56:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 0.62:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.56000000000000005 or 0.619999999999999996 < z Initial program 99.7%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6497.3%
Simplified97.3%
if -0.56000000000000005 < z < 0.619999999999999996Initial program 98.1%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.8%
Simplified99.8%
*-commutativeN/A
flip--N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f6499.6%
Applied egg-rr99.6%
Taylor expanded in z around 0
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-lft-inN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f6498.4%
Simplified98.4%
Final simplification97.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* z (* (- y x) -6.0)))) (if (<= z -0.44) t_0 (if (<= z 0.62) (+ x (* (- y x) 4.0)) t_0))))
double code(double x, double y, double z) {
double t_0 = z * ((y - x) * -6.0);
double tmp;
if (z <= -0.44) {
tmp = t_0;
} else if (z <= 0.62) {
tmp = x + ((y - x) * 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 = z * ((y - x) * (-6.0d0))
if (z <= (-0.44d0)) then
tmp = t_0
else if (z <= 0.62d0) then
tmp = x + ((y - x) * 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 = z * ((y - x) * -6.0);
double tmp;
if (z <= -0.44) {
tmp = t_0;
} else if (z <= 0.62) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * ((y - x) * -6.0) tmp = 0 if z <= -0.44: tmp = t_0 elif z <= 0.62: tmp = x + ((y - x) * 4.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(y - x) * -6.0)) tmp = 0.0 if (z <= -0.44) tmp = t_0; elseif (z <= 0.62) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((y - x) * -6.0); tmp = 0.0; if (z <= -0.44) tmp = t_0; elseif (z <= 0.62) tmp = x + ((y - x) * 4.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.44], t$95$0, If[LessEqual[z, 0.62], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{if}\;z \leq -0.44:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 0.62:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.440000000000000002 or 0.619999999999999996 < z Initial program 99.7%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6497.3%
Simplified97.3%
if -0.440000000000000002 < z < 0.619999999999999996Initial program 98.1%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0
Simplified98.4%
Final simplification97.8%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* x (+ -3.0 (* z 6.0))))) (if (<= x -3.5e+26) t_0 (if (<= x 1.4e-7) (* y (+ 4.0 (* z -6.0))) t_0))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -3.5e+26) {
tmp = t_0;
} else if (x <= 1.4e-7) {
tmp = y * (4.0 + (z * -6.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 = x * ((-3.0d0) + (z * 6.0d0))
if (x <= (-3.5d+26)) then
tmp = t_0
else if (x <= 1.4d-7) then
tmp = y * (4.0d0 + (z * (-6.0d0)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -3.5e+26) {
tmp = t_0;
} else if (x <= 1.4e-7) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (z * 6.0)) tmp = 0 if x <= -3.5e+26: tmp = t_0 elif x <= 1.4e-7: tmp = y * (4.0 + (z * -6.0)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) tmp = 0.0 if (x <= -3.5e+26) tmp = t_0; elseif (x <= 1.4e-7) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (-3.0 + (z * 6.0)); tmp = 0.0; if (x <= -3.5e+26) tmp = t_0; elseif (x <= 1.4e-7) tmp = y * (4.0 + (z * -6.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.5e+26], t$95$0, If[LessEqual[x, 1.4e-7], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{+26}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-7}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -3.4999999999999999e26 or 1.4000000000000001e-7 < x Initial program 98.3%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-commutativeN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
associate-+l+N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval83.7%
Simplified83.7%
if -3.4999999999999999e26 < x < 1.4000000000000001e-7Initial program 99.5%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.8%
Simplified99.8%
*-commutativeN/A
flip--N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f6499.6%
Applied egg-rr99.6%
Taylor expanded in x around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6480.7%
Simplified80.7%
Final simplification82.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* z 6.0)))))
(if (<= x -2.65e+26)
t_0
(if (<= x 5.4e-7) (* 6.0 (* y (- 0.6666666666666666 z))) t_0))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -2.65e+26) {
tmp = t_0;
} else if (x <= 5.4e-7) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} 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 = x * ((-3.0d0) + (z * 6.0d0))
if (x <= (-2.65d+26)) then
tmp = t_0
else if (x <= 5.4d-7) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -2.65e+26) {
tmp = t_0;
} else if (x <= 5.4e-7) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (z * 6.0)) tmp = 0 if x <= -2.65e+26: tmp = t_0 elif x <= 5.4e-7: tmp = 6.0 * (y * (0.6666666666666666 - z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) tmp = 0.0 if (x <= -2.65e+26) tmp = t_0; elseif (x <= 5.4e-7) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (-3.0 + (z * 6.0)); tmp = 0.0; if (x <= -2.65e+26) tmp = t_0; elseif (x <= 5.4e-7) tmp = 6.0 * (y * (0.6666666666666666 - z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.65e+26], t$95$0, If[LessEqual[x, 5.4e-7], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{if}\;x \leq -2.65 \cdot 10^{+26}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{-7}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.64999999999999984e26 or 5.40000000000000018e-7 < x Initial program 98.3%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-commutativeN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
associate-+l+N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval83.7%
Simplified83.7%
if -2.64999999999999984e26 < x < 5.40000000000000018e-7Initial program 99.5%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6480.6%
Simplified80.6%
Final simplification82.1%
(FPCore (x y z) :precision binary64 (if (<= x -2.9e+26) (* x -3.0) (if (<= x 8.4e-53) (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.9e+26) {
tmp = x * -3.0;
} else if (x <= 8.4e-53) {
tmp = y * 4.0;
} else {
tmp = x * -3.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 <= (-2.9d+26)) then
tmp = x * (-3.0d0)
else if (x <= 8.4d-53) then
tmp = y * 4.0d0
else
tmp = x * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2.9e+26) {
tmp = x * -3.0;
} else if (x <= 8.4e-53) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.9e+26: tmp = x * -3.0 elif x <= 8.4e-53: tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.9e+26) tmp = Float64(x * -3.0); elseif (x <= 8.4e-53) tmp = Float64(y * 4.0); else tmp = Float64(x * -3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.9e+26) tmp = x * -3.0; elseif (x <= 8.4e-53) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.9e+26], N[(x * -3.0), $MachinePrecision], If[LessEqual[x, 8.4e-53], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+26}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;x \leq 8.4 \cdot 10^{-53}:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if x < -2.9e26 or 8.3999999999999991e-53 < x Initial program 98.3%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0
Simplified50.4%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6440.5%
Simplified40.5%
if -2.9e26 < x < 8.3999999999999991e-53Initial program 99.5%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6480.4%
Simplified80.4%
Taylor expanded in z around 0
*-commutativeN/A
*-lowering-*.f6441.6%
Simplified41.6%
(FPCore (x y z) :precision binary64 (+ x (* (- 0.6666666666666666 z) (* (- y x) 6.0))))
double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((0.6666666666666666d0 - z) * ((y - x) * 6.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.0));
}
def code(x, y, z): return x + ((0.6666666666666666 - z) * ((y - x) * 6.0))
function code(x, y, z) return Float64(x + Float64(Float64(0.6666666666666666 - z) * Float64(Float64(y - x) * 6.0))) end
function tmp = code(x, y, z) tmp = x + ((0.6666666666666666 - z) * ((y - x) * 6.0)); end
code[x_, y_, z_] := N[(x + N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(0.6666666666666666 - z\right) \cdot \left(\left(y - x\right) \cdot 6\right)
\end{array}
Initial program 98.9%
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
*-lowering-*.f64N/A
--lowering--.f6498.9%
Applied egg-rr98.9%
(FPCore (x y z) :precision binary64 (* x -3.0))
double code(double x, double y, double z) {
return x * -3.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -3
\end{array}
Initial program 98.9%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0
Simplified49.9%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6425.3%
Simplified25.3%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 98.9%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0
Simplified49.9%
Taylor expanded in y around inf
*-commutativeN/A
*-lowering-*.f6426.4%
Simplified26.4%
Taylor expanded in x around inf
Simplified2.7%
herbie shell --seed 2024158
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, D"
:precision binary64
(+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))