
(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 17 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 (fma (- y x) (fma z -6.0 4.0) x))
double code(double x, double y, double z) {
return fma((y - x), fma(z, -6.0, 4.0), x);
}
function code(x, y, z) return fma(Float64(y - x), fma(z, -6.0, 4.0), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(z * -6.0 + 4.0), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, \mathsf{fma}\left(z, -6, 4\right), x\right)
\end{array}
Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
*-commutative99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
(FPCore (x y z) :precision binary64 (fma (- y x) (+ 4.0 (* z -6.0)) x))
double code(double x, double y, double z) {
return fma((y - x), (4.0 + (z * -6.0)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(4.0 + Float64(z * -6.0)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)
\end{array}
Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* z 6.0)))))
(if (<= x -2.4e+53)
t_0
(if (<= x -1.7e-114)
(* -6.0 (* (- y x) z))
(if (<= x 6.5e+25) (* 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 <= -2.4e+53) {
tmp = t_0;
} else if (x <= -1.7e-114) {
tmp = -6.0 * ((y - x) * z);
} else if (x <= 6.5e+25) {
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 <= (-2.4d+53)) then
tmp = t_0
else if (x <= (-1.7d-114)) then
tmp = (-6.0d0) * ((y - x) * z)
else if (x <= 6.5d+25) 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 <= -2.4e+53) {
tmp = t_0;
} else if (x <= -1.7e-114) {
tmp = -6.0 * ((y - x) * z);
} else if (x <= 6.5e+25) {
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 <= -2.4e+53: tmp = t_0 elif x <= -1.7e-114: tmp = -6.0 * ((y - x) * z) elif x <= 6.5e+25: 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 <= -2.4e+53) tmp = t_0; elseif (x <= -1.7e-114) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); elseif (x <= 6.5e+25) 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 <= -2.4e+53) tmp = t_0; elseif (x <= -1.7e-114) tmp = -6.0 * ((y - x) * z); elseif (x <= 6.5e+25) 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, -2.4e+53], t$95$0, If[LessEqual[x, -1.7e-114], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.5e+25], 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 -2.4 \cdot 10^{+53}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-114}:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+25}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.4e53 or 6.50000000000000005e25 < x Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 90.1%
*-lft-identity90.1%
*-commutative90.1%
+-commutative90.1%
*-commutative90.1%
fma-define90.0%
associate-*r*90.0%
fma-define90.1%
distribute-lft-in90.1%
neg-mul-190.1%
distribute-lft-neg-in90.1%
metadata-eval90.1%
metadata-eval90.1%
distribute-rgt-in90.0%
+-commutative90.0%
sub-neg90.0%
distribute-rgt-in90.0%
sub-neg90.0%
distribute-rgt-in90.0%
metadata-eval90.0%
distribute-lft-neg-in90.0%
associate-+r+90.0%
Simplified90.0%
if -2.4e53 < x < -1.69999999999999991e-114Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 81.1%
if -1.69999999999999991e-114 < x < 6.50000000000000005e25Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 74.7%
Final simplification81.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -0.0053)
t_0
(if (<= z 3.1e-242)
(* y 4.0)
(if (<= z 8.5e+18) (* x (+ -3.0 (* z 6.0))) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.0053) {
tmp = t_0;
} else if (z <= 3.1e-242) {
tmp = y * 4.0;
} else if (z <= 8.5e+18) {
tmp = x * (-3.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 = (-6.0d0) * ((y - x) * z)
if (z <= (-0.0053d0)) then
tmp = t_0
else if (z <= 3.1d-242) then
tmp = y * 4.0d0
else if (z <= 8.5d+18) then
tmp = x * ((-3.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 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.0053) {
tmp = t_0;
} else if (z <= 3.1e-242) {
tmp = y * 4.0;
} else if (z <= 8.5e+18) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -0.0053: tmp = t_0 elif z <= 3.1e-242: tmp = y * 4.0 elif z <= 8.5e+18: tmp = x * (-3.0 + (z * 6.0)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -0.0053) tmp = t_0; elseif (z <= 3.1e-242) tmp = Float64(y * 4.0); elseif (z <= 8.5e+18) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -0.0053) tmp = t_0; elseif (z <= 3.1e-242) tmp = y * 4.0; elseif (z <= 8.5e+18) tmp = x * (-3.0 + (z * 6.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.0053], t$95$0, If[LessEqual[z, 3.1e-242], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 8.5e+18], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -0.0053:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-242}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+18}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.00530000000000000002 or 8.5e18 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 99.2%
if -0.00530000000000000002 < z < 3.10000000000000015e-242Initial program 99.0%
+-commutative99.0%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 56.2%
Taylor expanded in z around 0 56.2%
if 3.10000000000000015e-242 < z < 8.5e18Initial program 99.1%
+-commutative99.1%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 60.4%
*-lft-identity60.4%
*-commutative60.4%
+-commutative60.4%
*-commutative60.4%
fma-define60.4%
associate-*r*60.4%
fma-define60.4%
distribute-lft-in60.4%
neg-mul-160.4%
distribute-lft-neg-in60.4%
metadata-eval60.4%
metadata-eval60.4%
distribute-rgt-in60.3%
+-commutative60.3%
sub-neg60.3%
distribute-rgt-in60.3%
sub-neg60.3%
distribute-rgt-in60.4%
metadata-eval60.4%
distribute-lft-neg-in60.4%
associate-+r+60.4%
Simplified60.4%
Final simplification79.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -0.0026)
t_0
(if (<= z 3.3e-244) (* y 4.0) (if (<= z 0.5) (* x -3.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.0026) {
tmp = t_0;
} else if (z <= 3.3e-244) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = 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 = (-6.0d0) * ((y - x) * z)
if (z <= (-0.0026d0)) then
tmp = t_0
else if (z <= 3.3d-244) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = 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 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.0026) {
tmp = t_0;
} else if (z <= 3.3e-244) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -0.0026: tmp = t_0 elif z <= 3.3e-244: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -0.0026) tmp = t_0; elseif (z <= 3.3e-244) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -0.0026) tmp = t_0; elseif (z <= 3.3e-244) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.0026], t$95$0, If[LessEqual[z, 3.3e-244], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -0.0026:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-244}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.0025999999999999999 or 0.5 < z Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 96.9%
if -0.0025999999999999999 < z < 3.30000000000000026e-244Initial program 99.0%
+-commutative99.0%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 56.2%
Taylor expanded in z around 0 56.2%
if 3.30000000000000026e-244 < z < 0.5Initial program 99.1%
+-commutative99.1%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 59.2%
*-lft-identity59.2%
*-commutative59.2%
+-commutative59.2%
*-commutative59.2%
fma-define59.2%
associate-*r*59.2%
fma-define59.2%
distribute-lft-in59.2%
neg-mul-159.2%
distribute-lft-neg-in59.2%
metadata-eval59.2%
metadata-eval59.2%
distribute-rgt-in59.1%
+-commutative59.1%
sub-neg59.1%
distribute-rgt-in59.1%
sub-neg59.1%
distribute-rgt-in59.2%
metadata-eval59.2%
distribute-lft-neg-in59.2%
associate-+r+59.2%
Simplified59.2%
Taylor expanded in z around 0 57.1%
*-commutative57.1%
Simplified57.1%
Final simplification79.1%
(FPCore (x y z)
:precision binary64
(if (<= z -0.66)
(* y (* z -6.0))
(if (<= z 2.5e-248)
(* y 4.0)
(if (<= z 3350.0) (* x -3.0) (* x (* z 6.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = y * (z * -6.0);
} else if (z <= 2.5e-248) {
tmp = y * 4.0;
} else if (z <= 3350.0) {
tmp = x * -3.0;
} else {
tmp = x * (z * 6.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 <= (-0.66d0)) then
tmp = y * (z * (-6.0d0))
else if (z <= 2.5d-248) then
tmp = y * 4.0d0
else if (z <= 3350.0d0) then
tmp = x * (-3.0d0)
else
tmp = x * (z * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = y * (z * -6.0);
} else if (z <= 2.5e-248) {
tmp = y * 4.0;
} else if (z <= 3350.0) {
tmp = x * -3.0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.66: tmp = y * (z * -6.0) elif z <= 2.5e-248: tmp = y * 4.0 elif z <= 3350.0: tmp = x * -3.0 else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.66) tmp = Float64(y * Float64(z * -6.0)); elseif (z <= 2.5e-248) tmp = Float64(y * 4.0); elseif (z <= 3350.0) tmp = Float64(x * -3.0); else tmp = Float64(x * Float64(z * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.66) tmp = y * (z * -6.0); elseif (z <= 2.5e-248) tmp = y * 4.0; elseif (z <= 3350.0) tmp = x * -3.0; else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.66], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e-248], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3350.0], N[(x * -3.0), $MachinePrecision], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-248}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3350:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if z < -0.660000000000000031Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 53.6%
Taylor expanded in z around inf 52.9%
*-commutative52.9%
associate-*l*52.9%
*-commutative52.9%
Simplified52.9%
if -0.660000000000000031 < z < 2.5e-248Initial program 99.0%
+-commutative99.0%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 56.2%
Taylor expanded in z around 0 56.2%
if 2.5e-248 < z < 3350Initial program 99.1%
+-commutative99.1%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 56.3%
*-lft-identity56.3%
*-commutative56.3%
+-commutative56.3%
*-commutative56.3%
fma-define56.3%
associate-*r*56.3%
fma-define56.3%
distribute-lft-in56.3%
neg-mul-156.3%
distribute-lft-neg-in56.3%
metadata-eval56.3%
metadata-eval56.3%
distribute-rgt-in56.2%
+-commutative56.2%
sub-neg56.2%
distribute-rgt-in56.2%
sub-neg56.2%
distribute-rgt-in56.2%
metadata-eval56.2%
distribute-lft-neg-in56.2%
associate-+r+56.2%
Simplified56.2%
Taylor expanded in z around 0 54.3%
*-commutative54.3%
Simplified54.3%
if 3350 < z Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 62.5%
*-lft-identity62.5%
*-commutative62.5%
+-commutative62.5%
*-commutative62.5%
fma-define62.5%
associate-*r*62.5%
fma-define62.5%
distribute-lft-in62.5%
neg-mul-162.5%
distribute-lft-neg-in62.5%
metadata-eval62.5%
metadata-eval62.5%
distribute-rgt-in62.5%
+-commutative62.5%
sub-neg62.5%
distribute-rgt-in62.5%
sub-neg62.5%
distribute-rgt-in62.5%
metadata-eval62.5%
distribute-lft-neg-in62.5%
associate-+r+62.5%
Simplified62.5%
Taylor expanded in z around inf 61.0%
Final simplification56.4%
(FPCore (x y z)
:precision binary64
(if (<= z -0.66)
(* -6.0 (* y z))
(if (<= z 7.1e-242)
(* y 4.0)
(if (<= z 3350.0) (* x -3.0) (* x (* z 6.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = -6.0 * (y * z);
} else if (z <= 7.1e-242) {
tmp = y * 4.0;
} else if (z <= 3350.0) {
tmp = x * -3.0;
} else {
tmp = x * (z * 6.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 <= (-0.66d0)) then
tmp = (-6.0d0) * (y * z)
else if (z <= 7.1d-242) then
tmp = y * 4.0d0
else if (z <= 3350.0d0) then
tmp = x * (-3.0d0)
else
tmp = x * (z * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = -6.0 * (y * z);
} else if (z <= 7.1e-242) {
tmp = y * 4.0;
} else if (z <= 3350.0) {
tmp = x * -3.0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.66: tmp = -6.0 * (y * z) elif z <= 7.1e-242: tmp = y * 4.0 elif z <= 3350.0: tmp = x * -3.0 else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.66) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= 7.1e-242) tmp = Float64(y * 4.0); elseif (z <= 3350.0) tmp = Float64(x * -3.0); else tmp = Float64(x * Float64(z * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.66) tmp = -6.0 * (y * z); elseif (z <= 7.1e-242) tmp = y * 4.0; elseif (z <= 3350.0) tmp = x * -3.0; else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.66], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.1e-242], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3350.0], N[(x * -3.0), $MachinePrecision], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq 7.1 \cdot 10^{-242}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3350:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if z < -0.660000000000000031Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 98.6%
associate-*r*98.6%
*-commutative98.6%
associate-*r*98.4%
Simplified98.4%
Taylor expanded in y around inf 52.9%
if -0.660000000000000031 < z < 7.09999999999999962e-242Initial program 99.0%
+-commutative99.0%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 56.2%
Taylor expanded in z around 0 56.2%
if 7.09999999999999962e-242 < z < 3350Initial program 99.1%
+-commutative99.1%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 56.3%
*-lft-identity56.3%
*-commutative56.3%
+-commutative56.3%
*-commutative56.3%
fma-define56.3%
associate-*r*56.3%
fma-define56.3%
distribute-lft-in56.3%
neg-mul-156.3%
distribute-lft-neg-in56.3%
metadata-eval56.3%
metadata-eval56.3%
distribute-rgt-in56.2%
+-commutative56.2%
sub-neg56.2%
distribute-rgt-in56.2%
sub-neg56.2%
distribute-rgt-in56.2%
metadata-eval56.2%
distribute-lft-neg-in56.2%
associate-+r+56.2%
Simplified56.2%
Taylor expanded in z around 0 54.3%
*-commutative54.3%
Simplified54.3%
if 3350 < z Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 62.5%
*-lft-identity62.5%
*-commutative62.5%
+-commutative62.5%
*-commutative62.5%
fma-define62.5%
associate-*r*62.5%
fma-define62.5%
distribute-lft-in62.5%
neg-mul-162.5%
distribute-lft-neg-in62.5%
metadata-eval62.5%
metadata-eval62.5%
distribute-rgt-in62.5%
+-commutative62.5%
sub-neg62.5%
distribute-rgt-in62.5%
sub-neg62.5%
distribute-rgt-in62.5%
metadata-eval62.5%
distribute-lft-neg-in62.5%
associate-+r+62.5%
Simplified62.5%
Taylor expanded in z around inf 61.0%
Final simplification56.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -0.66)
t_0
(if (<= z 6.4e-234) (* y 4.0) (if (<= z 0.6) (* x -3.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -0.66) {
tmp = t_0;
} else if (z <= 6.4e-234) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = 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 = (-6.0d0) * (y * z)
if (z <= (-0.66d0)) then
tmp = t_0
else if (z <= 6.4d-234) then
tmp = y * 4.0d0
else if (z <= 0.6d0) then
tmp = 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 = -6.0 * (y * z);
double tmp;
if (z <= -0.66) {
tmp = t_0;
} else if (z <= 6.4e-234) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -0.66: tmp = t_0 elif z <= 6.4e-234: tmp = y * 4.0 elif z <= 0.6: tmp = x * -3.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 <= -0.66) tmp = t_0; elseif (z <= 6.4e-234) tmp = Float64(y * 4.0); elseif (z <= 0.6) tmp = Float64(x * -3.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 <= -0.66) tmp = t_0; elseif (z <= 6.4e-234) tmp = y * 4.0; elseif (z <= 0.6) tmp = x * -3.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, -0.66], t$95$0, If[LessEqual[z, 6.4e-234], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(x * -3.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-234}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.660000000000000031 or 0.599999999999999978 < z Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 96.9%
associate-*r*96.9%
*-commutative96.9%
associate-*r*96.8%
Simplified96.8%
Taylor expanded in y around inf 46.2%
if -0.660000000000000031 < z < 6.3999999999999997e-234Initial program 99.0%
+-commutative99.0%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 56.2%
Taylor expanded in z around 0 56.2%
if 6.3999999999999997e-234 < z < 0.599999999999999978Initial program 99.1%
+-commutative99.1%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 59.2%
*-lft-identity59.2%
*-commutative59.2%
+-commutative59.2%
*-commutative59.2%
fma-define59.2%
associate-*r*59.2%
fma-define59.2%
distribute-lft-in59.2%
neg-mul-159.2%
distribute-lft-neg-in59.2%
metadata-eval59.2%
metadata-eval59.2%
distribute-rgt-in59.1%
+-commutative59.1%
sub-neg59.1%
distribute-rgt-in59.1%
sub-neg59.1%
distribute-rgt-in59.2%
metadata-eval59.2%
distribute-lft-neg-in59.2%
associate-+r+59.2%
Simplified59.2%
Taylor expanded in z around 0 57.1%
*-commutative57.1%
Simplified57.1%
(FPCore (x y z) :precision binary64 (if (<= z -0.66) (+ x (* (- y x) (* z -6.0))) (if (<= z 0.6) (+ (* y 4.0) (* x -3.0)) (* z (+ (* y -6.0) (* x 6.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x + ((y - x) * (z * -6.0));
} else if (z <= 0.6) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = z * ((y * -6.0) + (x * 6.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 <= (-0.66d0)) then
tmp = x + ((y - x) * (z * (-6.0d0)))
else if (z <= 0.6d0) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else
tmp = z * ((y * (-6.0d0)) + (x * 6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x + ((y - x) * (z * -6.0));
} else if (z <= 0.6) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = z * ((y * -6.0) + (x * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.66: tmp = x + ((y - x) * (z * -6.0)) elif z <= 0.6: tmp = (y * 4.0) + (x * -3.0) else: tmp = z * ((y * -6.0) + (x * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.66) tmp = Float64(x + Float64(Float64(y - x) * Float64(z * -6.0))); elseif (z <= 0.6) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = Float64(z * Float64(Float64(y * -6.0) + Float64(x * 6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.66) tmp = x + ((y - x) * (z * -6.0)); elseif (z <= 0.6) tmp = (y * 4.0) + (x * -3.0); else tmp = z * ((y * -6.0) + (x * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.66], N[(x + N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.6], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y * -6.0), $MachinePrecision] + N[(x * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;x + \left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot -6 + x \cdot 6\right)\\
\end{array}
\end{array}
if z < -0.660000000000000031Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around inf 98.6%
*-commutative98.6%
*-commutative98.6%
associate-*l*98.6%
*-commutative98.6%
Simplified98.6%
if -0.660000000000000031 < z < 0.599999999999999978Initial program 99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in x around 0 99.5%
Taylor expanded in z around 0 97.8%
if 0.599999999999999978 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 97.3%
Taylor expanded in z around inf 95.6%
Final simplification97.3%
(FPCore (x y z) :precision binary64 (if (<= z -0.6) (* -6.0 (* (- y x) z)) (if (<= z 0.52) (+ (* y 4.0) (* x -3.0)) (* z (+ (* y -6.0) (* x 6.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.6) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.52) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = z * ((y * -6.0) + (x * 6.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 <= (-0.6d0)) then
tmp = (-6.0d0) * ((y - x) * z)
else if (z <= 0.52d0) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else
tmp = z * ((y * (-6.0d0)) + (x * 6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.6) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.52) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = z * ((y * -6.0) + (x * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.6: tmp = -6.0 * ((y - x) * z) elif z <= 0.52: tmp = (y * 4.0) + (x * -3.0) else: tmp = z * ((y * -6.0) + (x * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.6) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); elseif (z <= 0.52) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = Float64(z * Float64(Float64(y * -6.0) + Float64(x * 6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.6) tmp = -6.0 * ((y - x) * z); elseif (z <= 0.52) tmp = (y * 4.0) + (x * -3.0); else tmp = z * ((y * -6.0) + (x * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.6], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.52], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y * -6.0), $MachinePrecision] + N[(x * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.6:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;z \leq 0.52:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot -6 + x \cdot 6\right)\\
\end{array}
\end{array}
if z < -0.599999999999999978Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 98.6%
if -0.599999999999999978 < z < 0.52000000000000002Initial program 99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in x around 0 99.5%
Taylor expanded in z around 0 97.8%
if 0.52000000000000002 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 97.3%
Taylor expanded in z around inf 95.6%
Final simplification97.3%
(FPCore (x y z) :precision binary64 (if (<= z -0.6) (* -6.0 (* (- y x) z)) (if (<= z 0.5) (+ (* y 4.0) (* x -3.0)) (* z (* (- y x) -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.6) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.5) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = z * ((y - x) * -6.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 <= (-0.6d0)) then
tmp = (-6.0d0) * ((y - x) * z)
else if (z <= 0.5d0) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else
tmp = z * ((y - x) * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.6) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.5) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.6: tmp = -6.0 * ((y - x) * z) elif z <= 0.5: tmp = (y * 4.0) + (x * -3.0) else: tmp = z * ((y - x) * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.6) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); elseif (z <= 0.5) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = Float64(z * Float64(Float64(y - x) * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.6) tmp = -6.0 * ((y - x) * z); elseif (z <= 0.5) tmp = (y * 4.0) + (x * -3.0); else tmp = z * ((y - x) * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.6], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.5], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.6:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.599999999999999978Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 98.6%
if -0.599999999999999978 < z < 0.5Initial program 99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in x around 0 99.5%
Taylor expanded in z around 0 97.8%
if 0.5 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 95.5%
associate-*r*95.6%
*-commutative95.6%
associate-*r*95.6%
Simplified95.6%
Final simplification97.3%
(FPCore (x y z) :precision binary64 (if (<= z -0.58) (* -6.0 (* (- y x) z)) (if (<= z 0.54) (+ x (* (- y x) 4.0)) (* z (* (- y x) -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.58) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.54) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * ((y - x) * -6.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 <= (-0.58d0)) then
tmp = (-6.0d0) * ((y - x) * z)
else if (z <= 0.54d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = z * ((y - x) * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.58) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.54) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.58: tmp = -6.0 * ((y - x) * z) elif z <= 0.54: tmp = x + ((y - x) * 4.0) else: tmp = z * ((y - x) * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.58) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); elseif (z <= 0.54) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(z * Float64(Float64(y - x) * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.58) tmp = -6.0 * ((y - x) * z); elseif (z <= 0.54) tmp = x + ((y - x) * 4.0); else tmp = z * ((y - x) * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.58], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.54], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.58:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;z \leq 0.54:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.57999999999999996Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 98.6%
if -0.57999999999999996 < z < 0.54000000000000004Initial program 99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in z around 0 97.8%
if 0.54000000000000004 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 95.5%
associate-*r*95.6%
*-commutative95.6%
associate-*r*95.6%
Simplified95.6%
Final simplification97.3%
(FPCore (x y z) :precision binary64 (+ x (+ (* -6.0 (* (- y x) z)) (* (- y x) 4.0))))
double code(double x, double y, double z) {
return x + ((-6.0 * ((y - x) * z)) + ((y - x) * 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 = x + (((-6.0d0) * ((y - x) * z)) + ((y - x) * 4.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.0));
}
def code(x, y, z): return x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.0))
function code(x, y, z) return Float64(x + Float64(Float64(-6.0 * Float64(Float64(y - x) * z)) + Float64(Float64(y - x) * 4.0))) end
function tmp = code(x, y, z) tmp = x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.0)); end
code[x_, y_, z_] := N[(x + N[(N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(-6 \cdot \left(\left(y - x\right) \cdot z\right) + \left(y - x\right) \cdot 4\right)
\end{array}
Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.7%
Final simplification99.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.8e+90) (not (<= y 9.4e+52))) (* y 4.0) (* x -3.0)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.8e+90) || !(y <= 9.4e+52)) {
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 ((y <= (-2.8d+90)) .or. (.not. (y <= 9.4d+52))) 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 ((y <= -2.8e+90) || !(y <= 9.4e+52)) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.8e+90) or not (y <= 9.4e+52): tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.8e+90) || !(y <= 9.4e+52)) 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 ((y <= -2.8e+90) || ~((y <= 9.4e+52))) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.8e+90], N[Not[LessEqual[y, 9.4e+52]], $MachinePrecision]], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+90} \lor \neg \left(y \leq 9.4 \cdot 10^{+52}\right):\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if y < -2.8e90 or 9.3999999999999999e52 < y Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 82.7%
Taylor expanded in z around 0 41.6%
if -2.8e90 < y < 9.3999999999999999e52Initial program 99.3%
+-commutative99.3%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 73.2%
*-lft-identity73.2%
*-commutative73.2%
+-commutative73.2%
*-commutative73.2%
fma-define73.2%
associate-*r*73.2%
fma-define73.2%
distribute-lft-in73.2%
neg-mul-173.2%
distribute-lft-neg-in73.2%
metadata-eval73.2%
metadata-eval73.2%
distribute-rgt-in73.1%
+-commutative73.1%
sub-neg73.1%
distribute-rgt-in73.1%
sub-neg73.1%
distribute-rgt-in73.1%
metadata-eval73.1%
distribute-lft-neg-in73.1%
associate-+r+73.1%
Simplified73.1%
Taylor expanded in z around 0 32.8%
*-commutative32.8%
Simplified32.8%
Final simplification36.1%
(FPCore (x y z) :precision binary64 (+ x (* (+ (* x -6.0) (* y 6.0)) (- 0.6666666666666666 z))))
double code(double x, double y, double z) {
return x + (((x * -6.0) + (y * 6.0)) * (0.6666666666666666 - 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 + (((x * (-6.0d0)) + (y * 6.0d0)) * (0.6666666666666666d0 - z))
end function
public static double code(double x, double y, double z) {
return x + (((x * -6.0) + (y * 6.0)) * (0.6666666666666666 - z));
}
def code(x, y, z): return x + (((x * -6.0) + (y * 6.0)) * (0.6666666666666666 - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(x * -6.0) + Float64(y * 6.0)) * Float64(0.6666666666666666 - z))) end
function tmp = code(x, y, z) tmp = x + (((x * -6.0) + (y * 6.0)) * (0.6666666666666666 - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(x * -6.0), $MachinePrecision] + N[(y * 6.0), $MachinePrecision]), $MachinePrecision] * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(x \cdot -6 + y \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)
\end{array}
Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 99.4%
Final simplification99.4%
(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 99.4%
metadata-eval99.4%
Simplified99.4%
Final simplification99.4%
(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 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 53.6%
*-lft-identity53.6%
*-commutative53.6%
+-commutative53.6%
*-commutative53.6%
fma-define53.6%
associate-*r*53.6%
fma-define53.6%
distribute-lft-in53.6%
neg-mul-153.6%
distribute-lft-neg-in53.6%
metadata-eval53.6%
metadata-eval53.6%
distribute-rgt-in53.6%
+-commutative53.6%
sub-neg53.6%
distribute-rgt-in53.6%
sub-neg53.6%
distribute-rgt-in53.6%
metadata-eval53.6%
distribute-lft-neg-in53.6%
associate-+r+53.6%
Simplified53.6%
Taylor expanded in z around 0 24.0%
*-commutative24.0%
Simplified24.0%
herbie shell --seed 2024163
(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))))