
(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 14 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 -3.0 x (fma 4.0 y (* z (- (fma 6.0 y (* x -6.0)))))))
double code(double x, double y, double z) {
return fma(-3.0, x, fma(4.0, y, (z * -fma(6.0, y, (x * -6.0)))));
}
function code(x, y, z) return fma(-3.0, x, fma(4.0, y, Float64(z * Float64(-fma(6.0, y, Float64(x * -6.0)))))) end
code[x_, y_, z_] := N[(-3.0 * x + N[(4.0 * y + N[(z * (-N[(6.0 * y + N[(x * -6.0), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-3, x, \mathsf{fma}\left(4, y, z \cdot \left(-\mathsf{fma}\left(6, y, x \cdot -6\right)\right)\right)\right)
\end{array}
Initial program 99.6%
Taylor expanded in x around 0 97.7%
Taylor expanded in z around -inf 99.0%
fma-def99.8%
fma-def99.8%
associate-*r*99.8%
neg-mul-199.8%
fma-def99.8%
Simplified99.8%
Final simplification99.8%
(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.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* z 6.0)))) (t_1 (* -6.0 (* z (- y x)))))
(if (<= z -260000000.0)
t_1
(if (<= z -1.45e-67)
t_0
(if (<= z -2.35e-216)
(* 4.0 y)
(if (<= z -1.06e-256)
(/ x -0.3333333333333333)
(if (<= z 2.8e-103)
(* 4.0 y)
(if (<= z 54000000000.0) t_0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double t_1 = -6.0 * (z * (y - x));
double tmp;
if (z <= -260000000.0) {
tmp = t_1;
} else if (z <= -1.45e-67) {
tmp = t_0;
} else if (z <= -2.35e-216) {
tmp = 4.0 * y;
} else if (z <= -1.06e-256) {
tmp = x / -0.3333333333333333;
} else if (z <= 2.8e-103) {
tmp = 4.0 * y;
} else if (z <= 54000000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x * ((-3.0d0) + (z * 6.0d0))
t_1 = (-6.0d0) * (z * (y - x))
if (z <= (-260000000.0d0)) then
tmp = t_1
else if (z <= (-1.45d-67)) then
tmp = t_0
else if (z <= (-2.35d-216)) then
tmp = 4.0d0 * y
else if (z <= (-1.06d-256)) then
tmp = x / (-0.3333333333333333d0)
else if (z <= 2.8d-103) then
tmp = 4.0d0 * y
else if (z <= 54000000000.0d0) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double t_1 = -6.0 * (z * (y - x));
double tmp;
if (z <= -260000000.0) {
tmp = t_1;
} else if (z <= -1.45e-67) {
tmp = t_0;
} else if (z <= -2.35e-216) {
tmp = 4.0 * y;
} else if (z <= -1.06e-256) {
tmp = x / -0.3333333333333333;
} else if (z <= 2.8e-103) {
tmp = 4.0 * y;
} else if (z <= 54000000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (z * 6.0)) t_1 = -6.0 * (z * (y - x)) tmp = 0 if z <= -260000000.0: tmp = t_1 elif z <= -1.45e-67: tmp = t_0 elif z <= -2.35e-216: tmp = 4.0 * y elif z <= -1.06e-256: tmp = x / -0.3333333333333333 elif z <= 2.8e-103: tmp = 4.0 * y elif z <= 54000000000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) t_1 = Float64(-6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -260000000.0) tmp = t_1; elseif (z <= -1.45e-67) tmp = t_0; elseif (z <= -2.35e-216) tmp = Float64(4.0 * y); elseif (z <= -1.06e-256) tmp = Float64(x / -0.3333333333333333); elseif (z <= 2.8e-103) tmp = Float64(4.0 * y); elseif (z <= 54000000000.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (-3.0 + (z * 6.0)); t_1 = -6.0 * (z * (y - x)); tmp = 0.0; if (z <= -260000000.0) tmp = t_1; elseif (z <= -1.45e-67) tmp = t_0; elseif (z <= -2.35e-216) tmp = 4.0 * y; elseif (z <= -1.06e-256) tmp = x / -0.3333333333333333; elseif (z <= 2.8e-103) tmp = 4.0 * y; elseif (z <= 54000000000.0) tmp = t_0; else tmp = t_1; 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]}, Block[{t$95$1 = N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -260000000.0], t$95$1, If[LessEqual[z, -1.45e-67], t$95$0, If[LessEqual[z, -2.35e-216], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, -1.06e-256], N[(x / -0.3333333333333333), $MachinePrecision], If[LessEqual[z, 2.8e-103], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, 54000000000.0], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
t_1 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -260000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-67}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-216}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq -1.06 \cdot 10^{-256}:\\
\;\;\;\;\frac{x}{-0.3333333333333333}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-103}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq 54000000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.6e8 or 5.4e10 < z Initial program 99.7%
Taylor expanded in z around 0 98.2%
Taylor expanded in z around inf 99.1%
if -2.6e8 < z < -1.45000000000000002e-67 or 2.80000000000000023e-103 < z < 5.4e10Initial program 99.5%
Taylor expanded in x around inf 71.2%
*-commutative71.2%
sub-neg71.2%
distribute-lft-in71.3%
metadata-eval71.3%
metadata-eval71.3%
neg-mul-171.3%
*-commutative71.3%
associate-*l*71.3%
distribute-rgt-in71.3%
distribute-lft-in71.3%
associate-+r+71.3%
metadata-eval71.3%
metadata-eval71.3%
metadata-eval71.3%
distribute-lft-in71.3%
+-commutative71.3%
distribute-rgt-in71.3%
*-commutative71.3%
associate-*l*71.3%
metadata-eval71.3%
metadata-eval71.3%
Simplified71.3%
if -1.45000000000000002e-67 < z < -2.35e-216 or -1.06e-256 < z < 2.80000000000000023e-103Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
neg-mul-199.9%
associate-*r*99.9%
*-commutative99.9%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 60.9%
Taylor expanded in z around 0 60.9%
if -2.35e-216 < z < -1.06e-256Initial program 99.4%
Taylor expanded in x around inf 87.6%
*-commutative87.6%
sub-neg87.6%
distribute-lft-in87.6%
metadata-eval87.6%
metadata-eval87.6%
neg-mul-187.6%
*-commutative87.6%
associate-*l*87.6%
distribute-rgt-in87.6%
distribute-lft-in87.6%
associate-+r+87.6%
metadata-eval87.6%
metadata-eval87.6%
metadata-eval87.6%
distribute-lft-in87.6%
+-commutative87.6%
distribute-rgt-in87.6%
*-commutative87.6%
associate-*l*87.6%
metadata-eval87.6%
metadata-eval87.6%
Simplified87.6%
+-commutative87.6%
flip-+87.6%
metadata-eval87.6%
*-commutative87.6%
*-commutative87.6%
swap-sqr87.6%
metadata-eval87.6%
*-commutative87.6%
Applied egg-rr87.6%
clear-num87.6%
un-div-inv87.8%
clear-num87.8%
metadata-eval87.8%
metadata-eval87.8%
swap-sqr87.8%
flip-+87.8%
add-sqr-sqrt0.0%
sqrt-prod87.8%
sqr-neg87.8%
sqrt-unprod87.8%
add-sqr-sqrt87.8%
distribute-rgt-neg-in87.8%
sub-neg87.8%
sub-neg87.8%
distribute-rgt-neg-in87.8%
add-sqr-sqrt87.8%
sqrt-unprod87.8%
sqr-neg87.8%
sqrt-prod0.0%
Applied egg-rr87.8%
Taylor expanded in z around 0 87.8%
Final simplification82.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* y -6.0))) (t_1 (* x (* z 6.0))))
(if (<= z -1e+147)
t_0
(if (<= z -0.062)
t_1
(if (<= z 1.9e-99)
(* 4.0 y)
(if (<= z 0.5)
(* -3.0 x)
(if (or (<= z 7.5e+132) (not (<= z 1.4e+144))) t_0 t_1)))))))
double code(double x, double y, double z) {
double t_0 = z * (y * -6.0);
double t_1 = x * (z * 6.0);
double tmp;
if (z <= -1e+147) {
tmp = t_0;
} else if (z <= -0.062) {
tmp = t_1;
} else if (z <= 1.9e-99) {
tmp = 4.0 * y;
} else if (z <= 0.5) {
tmp = -3.0 * x;
} else if ((z <= 7.5e+132) || !(z <= 1.4e+144)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = z * (y * (-6.0d0))
t_1 = x * (z * 6.0d0)
if (z <= (-1d+147)) then
tmp = t_0
else if (z <= (-0.062d0)) then
tmp = t_1
else if (z <= 1.9d-99) then
tmp = 4.0d0 * y
else if (z <= 0.5d0) then
tmp = (-3.0d0) * x
else if ((z <= 7.5d+132) .or. (.not. (z <= 1.4d+144))) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (y * -6.0);
double t_1 = x * (z * 6.0);
double tmp;
if (z <= -1e+147) {
tmp = t_0;
} else if (z <= -0.062) {
tmp = t_1;
} else if (z <= 1.9e-99) {
tmp = 4.0 * y;
} else if (z <= 0.5) {
tmp = -3.0 * x;
} else if ((z <= 7.5e+132) || !(z <= 1.4e+144)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = z * (y * -6.0) t_1 = x * (z * 6.0) tmp = 0 if z <= -1e+147: tmp = t_0 elif z <= -0.062: tmp = t_1 elif z <= 1.9e-99: tmp = 4.0 * y elif z <= 0.5: tmp = -3.0 * x elif (z <= 7.5e+132) or not (z <= 1.4e+144): tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(y * -6.0)) t_1 = Float64(x * Float64(z * 6.0)) tmp = 0.0 if (z <= -1e+147) tmp = t_0; elseif (z <= -0.062) tmp = t_1; elseif (z <= 1.9e-99) tmp = Float64(4.0 * y); elseif (z <= 0.5) tmp = Float64(-3.0 * x); elseif ((z <= 7.5e+132) || !(z <= 1.4e+144)) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (y * -6.0); t_1 = x * (z * 6.0); tmp = 0.0; if (z <= -1e+147) tmp = t_0; elseif (z <= -0.062) tmp = t_1; elseif (z <= 1.9e-99) tmp = 4.0 * y; elseif (z <= 0.5) tmp = -3.0 * x; elseif ((z <= 7.5e+132) || ~((z <= 1.4e+144))) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+147], t$95$0, If[LessEqual[z, -0.062], t$95$1, If[LessEqual[z, 1.9e-99], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, 0.5], N[(-3.0 * x), $MachinePrecision], If[Or[LessEqual[z, 7.5e+132], N[Not[LessEqual[z, 1.4e+144]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(y \cdot -6\right)\\
t_1 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -1 \cdot 10^{+147}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -0.062:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-99}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;-3 \cdot x\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+132} \lor \neg \left(z \leq 1.4 \cdot 10^{+144}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -9.9999999999999998e146 or 0.5 < z < 7.50000000000000017e132 or 1.40000000000000003e144 < z Initial program 99.7%
Taylor expanded in x around 0 94.5%
Taylor expanded in z around inf 98.1%
Taylor expanded in x around 0 67.2%
*-commutative67.2%
Simplified67.2%
if -9.9999999999999998e146 < z < -0.062 or 7.50000000000000017e132 < z < 1.40000000000000003e144Initial program 99.5%
Taylor expanded in x around inf 74.1%
*-commutative74.1%
sub-neg74.1%
distribute-lft-in74.1%
metadata-eval74.1%
metadata-eval74.1%
neg-mul-174.1%
*-commutative74.1%
associate-*l*74.1%
distribute-rgt-in74.1%
distribute-lft-in74.1%
associate-+r+74.1%
metadata-eval74.1%
metadata-eval74.1%
metadata-eval74.1%
distribute-lft-in74.1%
+-commutative74.1%
distribute-rgt-in74.1%
*-commutative74.1%
associate-*l*74.1%
metadata-eval74.1%
metadata-eval74.1%
Simplified74.1%
Taylor expanded in z around inf 69.4%
*-commutative69.4%
Simplified69.4%
if -0.062 < z < 1.8999999999999998e-99Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
neg-mul-199.9%
associate-*r*99.9%
*-commutative99.9%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 55.0%
Taylor expanded in z around 0 54.4%
if 1.8999999999999998e-99 < z < 0.5Initial program 99.5%
Taylor expanded in x around inf 66.5%
*-commutative66.5%
sub-neg66.5%
distribute-lft-in66.5%
metadata-eval66.5%
metadata-eval66.5%
neg-mul-166.5%
*-commutative66.5%
associate-*l*66.5%
distribute-rgt-in66.5%
distribute-lft-in66.5%
associate-+r+66.5%
metadata-eval66.5%
metadata-eval66.5%
metadata-eval66.5%
distribute-lft-in66.5%
+-commutative66.5%
distribute-rgt-in66.5%
*-commutative66.5%
associate-*l*66.5%
metadata-eval66.5%
metadata-eval66.5%
Simplified66.5%
Taylor expanded in z around 0 62.4%
*-commutative62.4%
Simplified62.4%
Final simplification62.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* y -6.0))) (t_1 (* x (* z 6.0))))
(if (<= z -1.9e+147)
t_0
(if (<= z -0.085)
t_1
(if (<= z 1.7e-104)
(* 4.0 y)
(if (<= z 0.66)
(* -3.0 x)
(if (<= z 8.5e+127)
(* y (* z -6.0))
(if (<= z 2.8e+144) t_1 t_0))))))))
double code(double x, double y, double z) {
double t_0 = z * (y * -6.0);
double t_1 = x * (z * 6.0);
double tmp;
if (z <= -1.9e+147) {
tmp = t_0;
} else if (z <= -0.085) {
tmp = t_1;
} else if (z <= 1.7e-104) {
tmp = 4.0 * y;
} else if (z <= 0.66) {
tmp = -3.0 * x;
} else if (z <= 8.5e+127) {
tmp = y * (z * -6.0);
} else if (z <= 2.8e+144) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = z * (y * (-6.0d0))
t_1 = x * (z * 6.0d0)
if (z <= (-1.9d+147)) then
tmp = t_0
else if (z <= (-0.085d0)) then
tmp = t_1
else if (z <= 1.7d-104) then
tmp = 4.0d0 * y
else if (z <= 0.66d0) then
tmp = (-3.0d0) * x
else if (z <= 8.5d+127) then
tmp = y * (z * (-6.0d0))
else if (z <= 2.8d+144) then
tmp = t_1
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 * -6.0);
double t_1 = x * (z * 6.0);
double tmp;
if (z <= -1.9e+147) {
tmp = t_0;
} else if (z <= -0.085) {
tmp = t_1;
} else if (z <= 1.7e-104) {
tmp = 4.0 * y;
} else if (z <= 0.66) {
tmp = -3.0 * x;
} else if (z <= 8.5e+127) {
tmp = y * (z * -6.0);
} else if (z <= 2.8e+144) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * (y * -6.0) t_1 = x * (z * 6.0) tmp = 0 if z <= -1.9e+147: tmp = t_0 elif z <= -0.085: tmp = t_1 elif z <= 1.7e-104: tmp = 4.0 * y elif z <= 0.66: tmp = -3.0 * x elif z <= 8.5e+127: tmp = y * (z * -6.0) elif z <= 2.8e+144: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(y * -6.0)) t_1 = Float64(x * Float64(z * 6.0)) tmp = 0.0 if (z <= -1.9e+147) tmp = t_0; elseif (z <= -0.085) tmp = t_1; elseif (z <= 1.7e-104) tmp = Float64(4.0 * y); elseif (z <= 0.66) tmp = Float64(-3.0 * x); elseif (z <= 8.5e+127) tmp = Float64(y * Float64(z * -6.0)); elseif (z <= 2.8e+144) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (y * -6.0); t_1 = x * (z * 6.0); tmp = 0.0; if (z <= -1.9e+147) tmp = t_0; elseif (z <= -0.085) tmp = t_1; elseif (z <= 1.7e-104) tmp = 4.0 * y; elseif (z <= 0.66) tmp = -3.0 * x; elseif (z <= 8.5e+127) tmp = y * (z * -6.0); elseif (z <= 2.8e+144) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e+147], t$95$0, If[LessEqual[z, -0.085], t$95$1, If[LessEqual[z, 1.7e-104], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, 0.66], N[(-3.0 * x), $MachinePrecision], If[LessEqual[z, 8.5e+127], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+144], t$95$1, t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(y \cdot -6\right)\\
t_1 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+147}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -0.085:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-104}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;-3 \cdot x\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+127}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+144}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1.89999999999999985e147 or 2.80000000000000007e144 < z Initial program 99.8%
Taylor expanded in x around 0 92.6%
Taylor expanded in z around inf 99.8%
Taylor expanded in x around 0 69.0%
*-commutative69.0%
Simplified69.0%
if -1.89999999999999985e147 < z < -0.0850000000000000061 or 8.4999999999999997e127 < z < 2.80000000000000007e144Initial program 99.5%
Taylor expanded in x around inf 74.1%
*-commutative74.1%
sub-neg74.1%
distribute-lft-in74.1%
metadata-eval74.1%
metadata-eval74.1%
neg-mul-174.1%
*-commutative74.1%
associate-*l*74.1%
distribute-rgt-in74.1%
distribute-lft-in74.1%
associate-+r+74.1%
metadata-eval74.1%
metadata-eval74.1%
metadata-eval74.1%
distribute-lft-in74.1%
+-commutative74.1%
distribute-rgt-in74.1%
*-commutative74.1%
associate-*l*74.1%
metadata-eval74.1%
metadata-eval74.1%
Simplified74.1%
Taylor expanded in z around inf 69.4%
*-commutative69.4%
Simplified69.4%
if -0.0850000000000000061 < z < 1.70000000000000008e-104Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
neg-mul-199.9%
associate-*r*99.9%
*-commutative99.9%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 55.0%
Taylor expanded in z around 0 54.4%
if 1.70000000000000008e-104 < z < 0.660000000000000031Initial program 99.5%
Taylor expanded in x around inf 66.5%
*-commutative66.5%
sub-neg66.5%
distribute-lft-in66.5%
metadata-eval66.5%
metadata-eval66.5%
neg-mul-166.5%
*-commutative66.5%
associate-*l*66.5%
distribute-rgt-in66.5%
distribute-lft-in66.5%
associate-+r+66.5%
metadata-eval66.5%
metadata-eval66.5%
metadata-eval66.5%
distribute-lft-in66.5%
+-commutative66.5%
distribute-rgt-in66.5%
*-commutative66.5%
associate-*l*66.5%
metadata-eval66.5%
metadata-eval66.5%
Simplified66.5%
Taylor expanded in z around 0 62.4%
*-commutative62.4%
Simplified62.4%
if 0.660000000000000031 < z < 8.4999999999999997e127Initial program 99.5%
+-commutative99.5%
associate-*l*99.6%
fma-def99.6%
sub-neg99.6%
+-commutative99.6%
distribute-lft-in99.7%
neg-mul-199.7%
associate-*r*99.7%
*-commutative99.7%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 62.5%
Taylor expanded in z around inf 62.5%
*-commutative62.5%
Simplified62.5%
Final simplification62.2%
(FPCore (x y z)
:precision binary64
(if (or (<= y -1.75e-22)
(not (or (<= y 7.6e-63) (and (not (<= y 7e-16)) (<= y 2.4e+44)))))
(* y (+ 4.0 (* z -6.0)))
(* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.75e-22) || !((y <= 7.6e-63) || (!(y <= 7e-16) && (y <= 2.4e+44)))) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x * (-3.0 + (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 ((y <= (-1.75d-22)) .or. (.not. (y <= 7.6d-63) .or. (.not. (y <= 7d-16)) .and. (y <= 2.4d+44))) then
tmp = y * (4.0d0 + (z * (-6.0d0)))
else
tmp = x * ((-3.0d0) + (z * 6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.75e-22) || !((y <= 7.6e-63) || (!(y <= 7e-16) && (y <= 2.4e+44)))) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x * (-3.0 + (z * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.75e-22) or not ((y <= 7.6e-63) or (not (y <= 7e-16) and (y <= 2.4e+44))): tmp = y * (4.0 + (z * -6.0)) else: tmp = x * (-3.0 + (z * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.75e-22) || !((y <= 7.6e-63) || (!(y <= 7e-16) && (y <= 2.4e+44)))) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); else tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.75e-22) || ~(((y <= 7.6e-63) || (~((y <= 7e-16)) && (y <= 2.4e+44))))) tmp = y * (4.0 + (z * -6.0)); else tmp = x * (-3.0 + (z * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.75e-22], N[Not[Or[LessEqual[y, 7.6e-63], And[N[Not[LessEqual[y, 7e-16]], $MachinePrecision], LessEqual[y, 2.4e+44]]]], $MachinePrecision]], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{-22} \lor \neg \left(y \leq 7.6 \cdot 10^{-63} \lor \neg \left(y \leq 7 \cdot 10^{-16}\right) \land y \leq 2.4 \cdot 10^{+44}\right):\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\end{array}
\end{array}
if y < -1.75000000000000003e-22 or 7.60000000000000034e-63 < y < 7.00000000000000035e-16 or 2.40000000000000013e44 < y Initial program 99.7%
+-commutative99.7%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 84.4%
if -1.75000000000000003e-22 < y < 7.60000000000000034e-63 or 7.00000000000000035e-16 < y < 2.40000000000000013e44Initial program 99.5%
Taylor expanded in x around inf 84.4%
*-commutative84.4%
sub-neg84.4%
distribute-lft-in84.4%
metadata-eval84.4%
metadata-eval84.4%
neg-mul-184.4%
*-commutative84.4%
associate-*l*84.4%
distribute-rgt-in84.4%
distribute-lft-in84.4%
associate-+r+84.4%
metadata-eval84.4%
metadata-eval84.4%
metadata-eval84.4%
distribute-lft-in84.4%
+-commutative84.4%
distribute-rgt-in84.4%
*-commutative84.4%
associate-*l*84.4%
metadata-eval84.4%
metadata-eval84.4%
Simplified84.4%
Final simplification84.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* z (- y x)))))
(if (<= z -0.0059)
t_0
(if (<= z 7.1e-103) (* 4.0 y) (if (<= z 0.5) (* -3.0 x) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * (y - x));
double tmp;
if (z <= -0.0059) {
tmp = t_0;
} else if (z <= 7.1e-103) {
tmp = 4.0 * y;
} else if (z <= 0.5) {
tmp = -3.0 * x;
} 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) * (z * (y - x))
if (z <= (-0.0059d0)) then
tmp = t_0
else if (z <= 7.1d-103) then
tmp = 4.0d0 * y
else if (z <= 0.5d0) then
tmp = (-3.0d0) * x
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 * (z * (y - x));
double tmp;
if (z <= -0.0059) {
tmp = t_0;
} else if (z <= 7.1e-103) {
tmp = 4.0 * y;
} else if (z <= 0.5) {
tmp = -3.0 * x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * (y - x)) tmp = 0 if z <= -0.0059: tmp = t_0 elif z <= 7.1e-103: tmp = 4.0 * y elif z <= 0.5: tmp = -3.0 * x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -0.0059) tmp = t_0; elseif (z <= 7.1e-103) tmp = Float64(4.0 * y); elseif (z <= 0.5) tmp = Float64(-3.0 * x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (z * (y - x)); tmp = 0.0; if (z <= -0.0059) tmp = t_0; elseif (z <= 7.1e-103) tmp = 4.0 * y; elseif (z <= 0.5) tmp = -3.0 * x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.0059], t$95$0, If[LessEqual[z, 7.1e-103], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, 0.5], N[(-3.0 * x), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -0.0059:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 7.1 \cdot 10^{-103}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;-3 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -0.00589999999999999986 or 0.5 < z Initial program 99.7%
Taylor expanded in z around 0 98.3%
Taylor expanded in z around inf 96.4%
if -0.00589999999999999986 < z < 7.10000000000000045e-103Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
neg-mul-199.9%
associate-*r*99.9%
*-commutative99.9%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 55.0%
Taylor expanded in z around 0 54.4%
if 7.10000000000000045e-103 < z < 0.5Initial program 99.5%
Taylor expanded in x around inf 66.5%
*-commutative66.5%
sub-neg66.5%
distribute-lft-in66.5%
metadata-eval66.5%
metadata-eval66.5%
neg-mul-166.5%
*-commutative66.5%
associate-*l*66.5%
distribute-rgt-in66.5%
distribute-lft-in66.5%
associate-+r+66.5%
metadata-eval66.5%
metadata-eval66.5%
metadata-eval66.5%
distribute-lft-in66.5%
+-commutative66.5%
distribute-rgt-in66.5%
*-commutative66.5%
associate-*l*66.5%
metadata-eval66.5%
metadata-eval66.5%
Simplified66.5%
Taylor expanded in z around 0 62.4%
*-commutative62.4%
Simplified62.4%
Final simplification77.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -0.017)
t_0
(if (<= z 1.85e-99) (* 4.0 y) (if (<= z 0.5) (* -3.0 x) t_0)))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -0.017) {
tmp = t_0;
} else if (z <= 1.85e-99) {
tmp = 4.0 * y;
} else if (z <= 0.5) {
tmp = -3.0 * x;
} 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 * (x * z)
if (z <= (-0.017d0)) then
tmp = t_0
else if (z <= 1.85d-99) then
tmp = 4.0d0 * y
else if (z <= 0.5d0) then
tmp = (-3.0d0) * x
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 * (x * z);
double tmp;
if (z <= -0.017) {
tmp = t_0;
} else if (z <= 1.85e-99) {
tmp = 4.0 * y;
} else if (z <= 0.5) {
tmp = -3.0 * x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) tmp = 0 if z <= -0.017: tmp = t_0 elif z <= 1.85e-99: tmp = 4.0 * y elif z <= 0.5: tmp = -3.0 * x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -0.017) tmp = t_0; elseif (z <= 1.85e-99) tmp = Float64(4.0 * y); elseif (z <= 0.5) tmp = Float64(-3.0 * x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (x * z); tmp = 0.0; if (z <= -0.017) tmp = t_0; elseif (z <= 1.85e-99) tmp = 4.0 * y; elseif (z <= 0.5) tmp = -3.0 * x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.017], t$95$0, If[LessEqual[z, 1.85e-99], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, 0.5], N[(-3.0 * x), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -0.017:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-99}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;-3 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -0.017000000000000001 or 0.5 < z Initial program 99.7%
Taylor expanded in x around inf 54.1%
*-commutative54.1%
sub-neg54.1%
distribute-lft-in54.1%
metadata-eval54.1%
metadata-eval54.1%
neg-mul-154.1%
*-commutative54.1%
associate-*l*54.1%
distribute-rgt-in54.1%
distribute-lft-in54.1%
associate-+r+54.1%
metadata-eval54.1%
metadata-eval54.1%
metadata-eval54.1%
distribute-lft-in54.1%
+-commutative54.1%
distribute-rgt-in54.1%
*-commutative54.1%
associate-*l*54.1%
metadata-eval54.1%
metadata-eval54.1%
Simplified54.1%
Taylor expanded in z around inf 51.5%
if -0.017000000000000001 < z < 1.85e-99Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
neg-mul-199.9%
associate-*r*99.9%
*-commutative99.9%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 55.0%
Taylor expanded in z around 0 54.4%
if 1.85e-99 < z < 0.5Initial program 99.5%
Taylor expanded in x around inf 66.5%
*-commutative66.5%
sub-neg66.5%
distribute-lft-in66.5%
metadata-eval66.5%
metadata-eval66.5%
neg-mul-166.5%
*-commutative66.5%
associate-*l*66.5%
distribute-rgt-in66.5%
distribute-lft-in66.5%
associate-+r+66.5%
metadata-eval66.5%
metadata-eval66.5%
metadata-eval66.5%
distribute-lft-in66.5%
+-commutative66.5%
distribute-rgt-in66.5%
*-commutative66.5%
associate-*l*66.5%
metadata-eval66.5%
metadata-eval66.5%
Simplified66.5%
Taylor expanded in z around 0 62.4%
*-commutative62.4%
Simplified62.4%
Final simplification53.6%
(FPCore (x y z) :precision binary64 (if (<= z -1.35) (* x (* z 6.0)) (if (<= z 1.4e-102) (* 4.0 y) (if (<= z 0.5) (* -3.0 x) (* 6.0 (* x z))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.35) {
tmp = x * (z * 6.0);
} else if (z <= 1.4e-102) {
tmp = 4.0 * y;
} else if (z <= 0.5) {
tmp = -3.0 * x;
} else {
tmp = 6.0 * (x * z);
}
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 <= (-1.35d0)) then
tmp = x * (z * 6.0d0)
else if (z <= 1.4d-102) then
tmp = 4.0d0 * y
else if (z <= 0.5d0) then
tmp = (-3.0d0) * x
else
tmp = 6.0d0 * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.35) {
tmp = x * (z * 6.0);
} else if (z <= 1.4e-102) {
tmp = 4.0 * y;
} else if (z <= 0.5) {
tmp = -3.0 * x;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.35: tmp = x * (z * 6.0) elif z <= 1.4e-102: tmp = 4.0 * y elif z <= 0.5: tmp = -3.0 * x else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.35) tmp = Float64(x * Float64(z * 6.0)); elseif (z <= 1.4e-102) tmp = Float64(4.0 * y); elseif (z <= 0.5) tmp = Float64(-3.0 * x); else tmp = Float64(6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.35) tmp = x * (z * 6.0); elseif (z <= 1.4e-102) tmp = 4.0 * y; elseif (z <= 0.5) tmp = -3.0 * x; else tmp = 6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.35], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-102], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, 0.5], N[(-3.0 * x), $MachinePrecision], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-102}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;-3 \cdot x\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -1.3500000000000001Initial program 99.7%
Taylor expanded in x around inf 61.0%
*-commutative61.0%
sub-neg61.0%
distribute-lft-in61.0%
metadata-eval61.0%
metadata-eval61.0%
neg-mul-161.0%
*-commutative61.0%
associate-*l*61.0%
distribute-rgt-in61.0%
distribute-lft-in61.0%
associate-+r+61.0%
metadata-eval61.0%
metadata-eval61.0%
metadata-eval61.0%
distribute-lft-in61.0%
+-commutative61.0%
distribute-rgt-in61.0%
*-commutative61.0%
associate-*l*61.0%
metadata-eval61.0%
metadata-eval61.0%
Simplified61.0%
Taylor expanded in z around inf 58.3%
*-commutative58.3%
Simplified58.3%
if -1.3500000000000001 < z < 1.40000000000000006e-102Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
neg-mul-199.9%
associate-*r*99.9%
*-commutative99.9%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 55.0%
Taylor expanded in z around 0 54.4%
if 1.40000000000000006e-102 < z < 0.5Initial program 99.5%
Taylor expanded in x around inf 66.5%
*-commutative66.5%
sub-neg66.5%
distribute-lft-in66.5%
metadata-eval66.5%
metadata-eval66.5%
neg-mul-166.5%
*-commutative66.5%
associate-*l*66.5%
distribute-rgt-in66.5%
distribute-lft-in66.5%
associate-+r+66.5%
metadata-eval66.5%
metadata-eval66.5%
metadata-eval66.5%
distribute-lft-in66.5%
+-commutative66.5%
distribute-rgt-in66.5%
*-commutative66.5%
associate-*l*66.5%
metadata-eval66.5%
metadata-eval66.5%
Simplified66.5%
Taylor expanded in z around 0 62.4%
*-commutative62.4%
Simplified62.4%
if 0.5 < z Initial program 99.7%
Taylor expanded in x around inf 46.2%
*-commutative46.2%
sub-neg46.2%
distribute-lft-in46.3%
metadata-eval46.3%
metadata-eval46.3%
neg-mul-146.3%
*-commutative46.3%
associate-*l*46.3%
distribute-rgt-in46.3%
distribute-lft-in46.3%
associate-+r+46.3%
metadata-eval46.3%
metadata-eval46.3%
metadata-eval46.3%
distribute-lft-in46.3%
+-commutative46.3%
distribute-rgt-in46.3%
*-commutative46.3%
associate-*l*46.3%
metadata-eval46.3%
metadata-eval46.3%
Simplified46.3%
Taylor expanded in z around inf 43.9%
Final simplification53.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.6) (not (<= z 0.66))) (* -6.0 (* z (- y x))) (+ (* 4.0 y) (* -3.0 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.6) || !(z <= 0.66)) {
tmp = -6.0 * (z * (y - x));
} else {
tmp = (4.0 * y) + (-3.0 * x);
}
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)) .or. (.not. (z <= 0.66d0))) then
tmp = (-6.0d0) * (z * (y - x))
else
tmp = (4.0d0 * y) + ((-3.0d0) * x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.6) || !(z <= 0.66)) {
tmp = -6.0 * (z * (y - x));
} else {
tmp = (4.0 * y) + (-3.0 * x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.6) or not (z <= 0.66): tmp = -6.0 * (z * (y - x)) else: tmp = (4.0 * y) + (-3.0 * x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.6) || !(z <= 0.66)) tmp = Float64(-6.0 * Float64(z * Float64(y - x))); else tmp = Float64(Float64(4.0 * y) + Float64(-3.0 * x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.6) || ~((z <= 0.66))) tmp = -6.0 * (z * (y - x)); else tmp = (4.0 * y) + (-3.0 * x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.6], N[Not[LessEqual[z, 0.66]], $MachinePrecision]], N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(4.0 * y), $MachinePrecision] + N[(-3.0 * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.6 \lor \neg \left(z \leq 0.66\right):\\
\;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;4 \cdot y + -3 \cdot x\\
\end{array}
\end{array}
if z < -0.599999999999999978 or 0.660000000000000031 < z Initial program 99.7%
Taylor expanded in z around 0 98.3%
Taylor expanded in z around inf 96.4%
if -0.599999999999999978 < z < 0.660000000000000031Initial program 99.5%
Taylor expanded in x around 0 99.5%
Taylor expanded in z around 0 98.6%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (+ x (* (- 0.6666666666666666 z) (* 6.0 (- y x)))))
double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * (6.0 * (y - 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 + ((0.6666666666666666d0 - z) * (6.0d0 * (y - x)))
end function
public static double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * (6.0 * (y - x)));
}
def code(x, y, z): return x + ((0.6666666666666666 - z) * (6.0 * (y - x)))
function code(x, y, z) return Float64(x + Float64(Float64(0.6666666666666666 - z) * Float64(6.0 * Float64(y - x)))) end
function tmp = code(x, y, z) tmp = x + ((0.6666666666666666 - z) * (6.0 * (y - x))); end
code[x_, y_, z_] := N[(x + N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(6.0 * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(0.6666666666666666 - z\right) \cdot \left(6 \cdot \left(y - x\right)\right)
\end{array}
Initial program 99.6%
Taylor expanded in z around 0 99.6%
neg-mul-199.6%
+-commutative99.6%
sub-neg99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z) :precision binary64 (+ x (* (- y x) (* 6.0 (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
return x + ((y - x) * (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 + ((y - x) * (6.0d0 * (0.6666666666666666d0 - z)))
end function
public static double code(double x, double y, double z) {
return x + ((y - x) * (6.0 * (0.6666666666666666 - z)));
}
def code(x, y, z): return x + ((y - x) * (6.0 * (0.6666666666666666 - z)))
function code(x, y, z) return Float64(x + Float64(Float64(y - x) * Float64(6.0 * Float64(0.6666666666666666 - z)))) end
function tmp = code(x, y, z) tmp = x + ((y - x) * (6.0 * (0.6666666666666666 - z))); end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(6.0 * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)
\end{array}
Initial program 99.6%
associate-*l*99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (<= x -9.2e-106) (* -3.0 x) (if (<= x 1.4e+48) (* 4.0 y) (* -3.0 x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -9.2e-106) {
tmp = -3.0 * x;
} else if (x <= 1.4e+48) {
tmp = 4.0 * y;
} else {
tmp = -3.0 * x;
}
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 <= (-9.2d-106)) then
tmp = (-3.0d0) * x
else if (x <= 1.4d+48) then
tmp = 4.0d0 * y
else
tmp = (-3.0d0) * x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -9.2e-106) {
tmp = -3.0 * x;
} else if (x <= 1.4e+48) {
tmp = 4.0 * y;
} else {
tmp = -3.0 * x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -9.2e-106: tmp = -3.0 * x elif x <= 1.4e+48: tmp = 4.0 * y else: tmp = -3.0 * x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -9.2e-106) tmp = Float64(-3.0 * x); elseif (x <= 1.4e+48) tmp = Float64(4.0 * y); else tmp = Float64(-3.0 * x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -9.2e-106) tmp = -3.0 * x; elseif (x <= 1.4e+48) tmp = 4.0 * y; else tmp = -3.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -9.2e-106], N[(-3.0 * x), $MachinePrecision], If[LessEqual[x, 1.4e+48], N[(4.0 * y), $MachinePrecision], N[(-3.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.2 \cdot 10^{-106}:\\
\;\;\;\;-3 \cdot x\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+48}:\\
\;\;\;\;4 \cdot y\\
\mathbf{else}:\\
\;\;\;\;-3 \cdot x\\
\end{array}
\end{array}
if x < -9.2000000000000004e-106 or 1.40000000000000006e48 < x Initial program 99.6%
Taylor expanded in x around inf 78.4%
*-commutative78.4%
sub-neg78.4%
distribute-lft-in78.5%
metadata-eval78.5%
metadata-eval78.5%
neg-mul-178.5%
*-commutative78.5%
associate-*l*78.5%
distribute-rgt-in78.5%
distribute-lft-in78.5%
associate-+r+78.5%
metadata-eval78.5%
metadata-eval78.5%
metadata-eval78.5%
distribute-lft-in78.5%
+-commutative78.5%
distribute-rgt-in78.5%
*-commutative78.5%
associate-*l*78.5%
metadata-eval78.5%
metadata-eval78.5%
Simplified78.5%
Taylor expanded in z around 0 37.5%
*-commutative37.5%
Simplified37.5%
if -9.2000000000000004e-106 < x < 1.40000000000000006e48Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 80.5%
Taylor expanded in z around 0 46.7%
Final simplification41.7%
(FPCore (x y z) :precision binary64 (* 4.0 y))
double code(double x, double y, double z) {
return 4.0 * y;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 4.0d0 * y
end function
public static double code(double x, double y, double z) {
return 4.0 * y;
}
def code(x, y, z): return 4.0 * y
function code(x, y, z) return Float64(4.0 * y) end
function tmp = code(x, y, z) tmp = 4.0 * y; end
code[x_, y_, z_] := N[(4.0 * y), $MachinePrecision]
\begin{array}{l}
\\
4 \cdot y
\end{array}
Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 53.8%
Taylor expanded in z around 0 25.5%
Final simplification25.5%
herbie shell --seed 2023200
(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))))