
(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 (- 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-define99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
distribute-rgt-neg-out99.8%
*-commutative99.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.6%
+-commutative99.6%
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)))) (t_1 (* -6.0 (* (- y x) z))))
(if (<= z -210000000000.0)
t_1
(if (<= z -3.15e-65)
t_0
(if (<= z 6.2e-63) (* y 4.0) (if (<= z 1.25e+26) 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 * ((y - x) * z);
double tmp;
if (z <= -210000000000.0) {
tmp = t_1;
} else if (z <= -3.15e-65) {
tmp = t_0;
} else if (z <= 6.2e-63) {
tmp = y * 4.0;
} else if (z <= 1.25e+26) {
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) * ((y - x) * z)
if (z <= (-210000000000.0d0)) then
tmp = t_1
else if (z <= (-3.15d-65)) then
tmp = t_0
else if (z <= 6.2d-63) then
tmp = y * 4.0d0
else if (z <= 1.25d+26) 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 * ((y - x) * z);
double tmp;
if (z <= -210000000000.0) {
tmp = t_1;
} else if (z <= -3.15e-65) {
tmp = t_0;
} else if (z <= 6.2e-63) {
tmp = y * 4.0;
} else if (z <= 1.25e+26) {
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 * ((y - x) * z) tmp = 0 if z <= -210000000000.0: tmp = t_1 elif z <= -3.15e-65: tmp = t_0 elif z <= 6.2e-63: tmp = y * 4.0 elif z <= 1.25e+26: 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(Float64(y - x) * z)) tmp = 0.0 if (z <= -210000000000.0) tmp = t_1; elseif (z <= -3.15e-65) tmp = t_0; elseif (z <= 6.2e-63) tmp = Float64(y * 4.0); elseif (z <= 1.25e+26) 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 * ((y - x) * z); tmp = 0.0; if (z <= -210000000000.0) tmp = t_1; elseif (z <= -3.15e-65) tmp = t_0; elseif (z <= 6.2e-63) tmp = y * 4.0; elseif (z <= 1.25e+26) 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[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -210000000000.0], t$95$1, If[LessEqual[z, -3.15e-65], t$95$0, If[LessEqual[z, 6.2e-63], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.25e+26], 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(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -210000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.15 \cdot 10^{-65}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-63}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+26}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.1e11 or 1.25e26 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
add-cube-cbrt99.8%
fma-define99.8%
pow299.8%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.7%
if -2.1e11 < z < -3.1499999999999998e-65 or 6.19999999999999968e-63 < z < 1.25e26Initial program 99.4%
+-commutative99.4%
associate-*l*99.4%
fma-define99.4%
sub-neg99.4%
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 75.3%
*-lft-identity75.3%
*-commutative75.3%
+-commutative75.3%
*-commutative75.3%
fma-define75.3%
associate-*r*75.3%
neg-mul-175.3%
fma-define75.3%
distribute-neg-in75.3%
distribute-lft-neg-in75.3%
metadata-eval75.3%
metadata-eval75.3%
distribute-rgt-in75.2%
+-commutative75.2%
sub-neg75.2%
distribute-rgt-in75.2%
sub-neg75.2%
distribute-rgt-in75.4%
metadata-eval75.4%
distribute-lft-neg-in75.4%
associate-+r+75.4%
Simplified75.4%
if -3.1499999999999998e-65 < z < 6.19999999999999968e-63Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 93.4%
Taylor expanded in z around 0 93.4%
distribute-lft1-in93.8%
metadata-eval93.8%
Simplified93.8%
Taylor expanded in x around 0 66.6%
Final simplification83.6%
(FPCore (x y z)
:precision binary64
(if (<= z -210000000000.0)
(* (- y x) (* z -6.0))
(if (<= z -1.22e-65)
(* x (+ -3.0 (* z 6.0)))
(if (<= z 88000.0) (* y (+ 4.0 (* z -6.0))) (* z (* (- y x) -6.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -210000000000.0) {
tmp = (y - x) * (z * -6.0);
} else if (z <= -1.22e-65) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 88000.0) {
tmp = y * (4.0 + (z * -6.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 <= (-210000000000.0d0)) then
tmp = (y - x) * (z * (-6.0d0))
else if (z <= (-1.22d-65)) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else if (z <= 88000.0d0) then
tmp = y * (4.0d0 + (z * (-6.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 <= -210000000000.0) {
tmp = (y - x) * (z * -6.0);
} else if (z <= -1.22e-65) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 88000.0) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -210000000000.0: tmp = (y - x) * (z * -6.0) elif z <= -1.22e-65: tmp = x * (-3.0 + (z * 6.0)) elif z <= 88000.0: tmp = y * (4.0 + (z * -6.0)) else: tmp = z * ((y - x) * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -210000000000.0) tmp = Float64(Float64(y - x) * Float64(z * -6.0)); elseif (z <= -1.22e-65) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); elseif (z <= 88000.0) tmp = Float64(y * Float64(4.0 + Float64(z * -6.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 <= -210000000000.0) tmp = (y - x) * (z * -6.0); elseif (z <= -1.22e-65) tmp = x * (-3.0 + (z * 6.0)); elseif (z <= 88000.0) tmp = y * (4.0 + (z * -6.0)); else tmp = z * ((y - x) * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -210000000000.0], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.22e-65], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 88000.0], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -210000000000:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -1.22 \cdot 10^{-65}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{elif}\;z \leq 88000:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\end{array}
\end{array}
if z < -2.1e11Initial program 99.8%
+-commutative99.8%
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 z around inf 99.8%
+-commutative99.8%
clear-num99.8%
associate-*r/99.8%
frac-add67.1%
*-un-lft-identity67.1%
Applied egg-rr67.1%
Taylor expanded in z around inf 99.7%
associate-*r*99.9%
*-commutative99.9%
*-commutative99.9%
Simplified99.9%
if -2.1e11 < z < -1.21999999999999999e-65Initial program 99.4%
+-commutative99.4%
associate-*l*99.5%
fma-define99.5%
sub-neg99.5%
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 87.6%
*-lft-identity87.6%
*-commutative87.6%
+-commutative87.6%
*-commutative87.6%
fma-define87.6%
associate-*r*87.6%
neg-mul-187.6%
fma-define87.6%
distribute-neg-in87.6%
distribute-lft-neg-in87.6%
metadata-eval87.6%
metadata-eval87.6%
distribute-rgt-in87.5%
+-commutative87.5%
sub-neg87.5%
distribute-rgt-in87.5%
sub-neg87.5%
distribute-rgt-in87.6%
metadata-eval87.6%
distribute-lft-neg-in87.6%
associate-+r+87.6%
Simplified87.6%
if -1.21999999999999999e-65 < z < 88000Initial 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 inf 63.3%
if 88000 < 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 z around inf 99.8%
Taylor expanded in z around inf 98.5%
Final simplification82.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* (- y x) -6.0))))
(if (<= z -210000000000.0)
t_0
(if (<= z -1.6e-65)
(* x (+ -3.0 (* z 6.0)))
(if (<= z 4100000.0) (* y (+ 4.0 (* z -6.0))) t_0)))))
double code(double x, double y, double z) {
double t_0 = z * ((y - x) * -6.0);
double tmp;
if (z <= -210000000000.0) {
tmp = t_0;
} else if (z <= -1.6e-65) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 4100000.0) {
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 = z * ((y - x) * (-6.0d0))
if (z <= (-210000000000.0d0)) then
tmp = t_0
else if (z <= (-1.6d-65)) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else if (z <= 4100000.0d0) 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 = z * ((y - x) * -6.0);
double tmp;
if (z <= -210000000000.0) {
tmp = t_0;
} else if (z <= -1.6e-65) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 4100000.0) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * ((y - x) * -6.0) tmp = 0 if z <= -210000000000.0: tmp = t_0 elif z <= -1.6e-65: tmp = x * (-3.0 + (z * 6.0)) elif z <= 4100000.0: tmp = y * (4.0 + (z * -6.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 <= -210000000000.0) tmp = t_0; elseif (z <= -1.6e-65) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); elseif (z <= 4100000.0) 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 = z * ((y - x) * -6.0); tmp = 0.0; if (z <= -210000000000.0) tmp = t_0; elseif (z <= -1.6e-65) tmp = x * (-3.0 + (z * 6.0)); elseif (z <= 4100000.0) 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[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -210000000000.0], t$95$0, If[LessEqual[z, -1.6e-65], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4100000.0], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $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 -210000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-65}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{elif}\;z \leq 4100000:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.1e11 or 4.1e6 < 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 z around inf 99.8%
Taylor expanded in z around inf 99.2%
if -2.1e11 < z < -1.6e-65Initial program 99.4%
+-commutative99.4%
associate-*l*99.5%
fma-define99.5%
sub-neg99.5%
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 87.6%
*-lft-identity87.6%
*-commutative87.6%
+-commutative87.6%
*-commutative87.6%
fma-define87.6%
associate-*r*87.6%
neg-mul-187.6%
fma-define87.6%
distribute-neg-in87.6%
distribute-lft-neg-in87.6%
metadata-eval87.6%
metadata-eval87.6%
distribute-rgt-in87.5%
+-commutative87.5%
sub-neg87.5%
distribute-rgt-in87.5%
sub-neg87.5%
distribute-rgt-in87.6%
metadata-eval87.6%
distribute-lft-neg-in87.6%
associate-+r+87.6%
Simplified87.6%
if -1.6e-65 < z < 4.1e6Initial 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 inf 63.3%
Final simplification82.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -210000000000.0)
t_0
(if (<= z -8.8e-66)
(* x (+ -3.0 (* z 6.0)))
(if (<= z 1260000.0) (* y (+ 4.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 <= -210000000000.0) {
tmp = t_0;
} else if (z <= -8.8e-66) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 1260000.0) {
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 = (-6.0d0) * ((y - x) * z)
if (z <= (-210000000000.0d0)) then
tmp = t_0
else if (z <= (-8.8d-66)) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else if (z <= 1260000.0d0) 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 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -210000000000.0) {
tmp = t_0;
} else if (z <= -8.8e-66) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 1260000.0) {
tmp = y * (4.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 <= -210000000000.0: tmp = t_0 elif z <= -8.8e-66: tmp = x * (-3.0 + (z * 6.0)) elif z <= 1260000.0: tmp = y * (4.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 <= -210000000000.0) tmp = t_0; elseif (z <= -8.8e-66) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); elseif (z <= 1260000.0) 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 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -210000000000.0) tmp = t_0; elseif (z <= -8.8e-66) tmp = x * (-3.0 + (z * 6.0)); elseif (z <= 1260000.0) 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[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -210000000000.0], t$95$0, If[LessEqual[z, -8.8e-66], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1260000.0], N[(y * N[(4.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 -210000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -8.8 \cdot 10^{-66}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{elif}\;z \leq 1260000:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.1e11 or 1.26e6 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
add-cube-cbrt99.8%
fma-define99.8%
pow299.8%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.1%
if -2.1e11 < z < -8.8000000000000004e-66Initial program 99.4%
+-commutative99.4%
associate-*l*99.5%
fma-define99.5%
sub-neg99.5%
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 87.6%
*-lft-identity87.6%
*-commutative87.6%
+-commutative87.6%
*-commutative87.6%
fma-define87.6%
associate-*r*87.6%
neg-mul-187.6%
fma-define87.6%
distribute-neg-in87.6%
distribute-lft-neg-in87.6%
metadata-eval87.6%
metadata-eval87.6%
distribute-rgt-in87.5%
+-commutative87.5%
sub-neg87.5%
distribute-rgt-in87.5%
sub-neg87.5%
distribute-rgt-in87.6%
metadata-eval87.6%
distribute-lft-neg-in87.6%
associate-+r+87.6%
Simplified87.6%
if -8.8000000000000004e-66 < z < 1.26e6Initial 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 inf 63.3%
Final simplification82.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -0.044)
t_0
(if (<= z -7e-66) (* x -3.0) (if (<= z 0.63) (* y 4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.044) {
tmp = t_0;
} else if (z <= -7e-66) {
tmp = x * -3.0;
} else if (z <= 0.63) {
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 - x) * z)
if (z <= (-0.044d0)) then
tmp = t_0
else if (z <= (-7d-66)) then
tmp = x * (-3.0d0)
else if (z <= 0.63d0) 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 - x) * z);
double tmp;
if (z <= -0.044) {
tmp = t_0;
} else if (z <= -7e-66) {
tmp = x * -3.0;
} else if (z <= 0.63) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -0.044: tmp = t_0 elif z <= -7e-66: tmp = x * -3.0 elif z <= 0.63: tmp = y * 4.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.044) tmp = t_0; elseif (z <= -7e-66) tmp = Float64(x * -3.0); elseif (z <= 0.63) 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 - x) * z); tmp = 0.0; if (z <= -0.044) tmp = t_0; elseif (z <= -7e-66) tmp = x * -3.0; elseif (z <= 0.63) 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[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.044], t$95$0, If[LessEqual[z, -7e-66], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.63], N[(y * 4.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.044:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-66}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.63:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.043999999999999997 or 0.630000000000000004 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
add-cube-cbrt99.8%
fma-define99.8%
pow299.8%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 97.2%
if -0.043999999999999997 < z < -7.0000000000000001e-66Initial program 99.4%
+-commutative99.4%
associate-*l*99.6%
fma-define99.5%
sub-neg99.5%
distribute-rgt-in99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-neg-out99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 85.4%
*-lft-identity85.4%
*-commutative85.4%
+-commutative85.4%
*-commutative85.4%
fma-define85.4%
associate-*r*85.4%
neg-mul-185.4%
fma-define85.4%
distribute-neg-in85.4%
distribute-lft-neg-in85.4%
metadata-eval85.4%
metadata-eval85.4%
distribute-rgt-in85.3%
+-commutative85.3%
sub-neg85.3%
distribute-rgt-in85.2%
sub-neg85.2%
distribute-rgt-in85.3%
metadata-eval85.3%
distribute-lft-neg-in85.3%
associate-+r+85.3%
Simplified85.3%
Taylor expanded in z around 0 82.1%
*-commutative82.1%
Simplified82.1%
if -7.0000000000000001e-66 < z < 0.630000000000000004Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 92.4%
Taylor expanded in z around 0 90.5%
distribute-lft1-in91.0%
metadata-eval91.0%
Simplified91.0%
Taylor expanded in x around 0 62.0%
Final simplification81.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))))
(if (<= z -0.5)
t_0
(if (<= z -4.2e-65) (* x -3.0) (if (<= z 0.54) (* y 4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double tmp;
if (z <= -0.5) {
tmp = t_0;
} else if (z <= -4.2e-65) {
tmp = x * -3.0;
} else if (z <= 0.54) {
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 = x * (z * 6.0d0)
if (z <= (-0.5d0)) then
tmp = t_0
else if (z <= (-4.2d-65)) then
tmp = x * (-3.0d0)
else if (z <= 0.54d0) 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 = x * (z * 6.0);
double tmp;
if (z <= -0.5) {
tmp = t_0;
} else if (z <= -4.2e-65) {
tmp = x * -3.0;
} else if (z <= 0.54) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) tmp = 0 if z <= -0.5: tmp = t_0 elif z <= -4.2e-65: tmp = x * -3.0 elif z <= 0.54: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z * 6.0)) tmp = 0.0 if (z <= -0.5) tmp = t_0; elseif (z <= -4.2e-65) tmp = Float64(x * -3.0); elseif (z <= 0.54) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z * 6.0); tmp = 0.0; if (z <= -0.5) tmp = t_0; elseif (z <= -4.2e-65) tmp = x * -3.0; elseif (z <= 0.54) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.5], t$95$0, If[LessEqual[z, -4.2e-65], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.54], N[(y * 4.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -0.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-65}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.54:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.5 or 0.54000000000000004 < 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 60.0%
*-lft-identity60.0%
*-commutative60.0%
+-commutative60.0%
*-commutative60.0%
fma-define60.0%
associate-*r*60.0%
neg-mul-160.0%
fma-define60.0%
distribute-neg-in60.0%
distribute-lft-neg-in60.0%
metadata-eval60.0%
metadata-eval60.0%
distribute-rgt-in60.0%
+-commutative60.0%
sub-neg60.0%
distribute-rgt-in60.0%
sub-neg60.0%
distribute-rgt-in60.0%
metadata-eval60.0%
distribute-lft-neg-in60.0%
associate-+r+60.0%
Simplified60.0%
Taylor expanded in z around inf 57.9%
associate-*r*57.9%
*-commutative57.9%
associate-*r*57.9%
Simplified57.9%
if -0.5 < z < -4.20000000000000006e-65Initial program 99.4%
+-commutative99.4%
associate-*l*99.6%
fma-define99.5%
sub-neg99.5%
distribute-rgt-in99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-neg-out99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 85.4%
*-lft-identity85.4%
*-commutative85.4%
+-commutative85.4%
*-commutative85.4%
fma-define85.4%
associate-*r*85.4%
neg-mul-185.4%
fma-define85.4%
distribute-neg-in85.4%
distribute-lft-neg-in85.4%
metadata-eval85.4%
metadata-eval85.4%
distribute-rgt-in85.3%
+-commutative85.3%
sub-neg85.3%
distribute-rgt-in85.2%
sub-neg85.2%
distribute-rgt-in85.3%
metadata-eval85.3%
distribute-lft-neg-in85.3%
associate-+r+85.3%
Simplified85.3%
Taylor expanded in z around 0 82.1%
*-commutative82.1%
Simplified82.1%
if -4.20000000000000006e-65 < z < 0.54000000000000004Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 92.4%
Taylor expanded in z around 0 90.5%
distribute-lft1-in91.0%
metadata-eval91.0%
Simplified91.0%
Taylor expanded in x around 0 62.0%
Final simplification61.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -0.5)
t_0
(if (<= z -6.5e-66) (* x -3.0) (if (<= z 0.63) (* y 4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -0.5) {
tmp = t_0;
} else if (z <= -6.5e-66) {
tmp = x * -3.0;
} else if (z <= 0.63) {
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 * (x * z)
if (z <= (-0.5d0)) then
tmp = t_0
else if (z <= (-6.5d-66)) then
tmp = x * (-3.0d0)
else if (z <= 0.63d0) 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 * (x * z);
double tmp;
if (z <= -0.5) {
tmp = t_0;
} else if (z <= -6.5e-66) {
tmp = x * -3.0;
} else if (z <= 0.63) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) tmp = 0 if z <= -0.5: tmp = t_0 elif z <= -6.5e-66: tmp = x * -3.0 elif z <= 0.63: tmp = y * 4.0 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.5) tmp = t_0; elseif (z <= -6.5e-66) tmp = Float64(x * -3.0); elseif (z <= 0.63) tmp = Float64(y * 4.0); 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.5) tmp = t_0; elseif (z <= -6.5e-66) tmp = x * -3.0; elseif (z <= 0.63) 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[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.5], t$95$0, If[LessEqual[z, -6.5e-66], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.63], N[(y * 4.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -0.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-66}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.63:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.5 or 0.630000000000000004 < 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 60.0%
*-lft-identity60.0%
*-commutative60.0%
+-commutative60.0%
*-commutative60.0%
fma-define60.0%
associate-*r*60.0%
neg-mul-160.0%
fma-define60.0%
distribute-neg-in60.0%
distribute-lft-neg-in60.0%
metadata-eval60.0%
metadata-eval60.0%
distribute-rgt-in60.0%
+-commutative60.0%
sub-neg60.0%
distribute-rgt-in60.0%
sub-neg60.0%
distribute-rgt-in60.0%
metadata-eval60.0%
distribute-lft-neg-in60.0%
associate-+r+60.0%
Simplified60.0%
Taylor expanded in z around inf 57.9%
if -0.5 < z < -6.50000000000000024e-66Initial program 99.4%
+-commutative99.4%
associate-*l*99.6%
fma-define99.5%
sub-neg99.5%
distribute-rgt-in99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-neg-out99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 85.4%
*-lft-identity85.4%
*-commutative85.4%
+-commutative85.4%
*-commutative85.4%
fma-define85.4%
associate-*r*85.4%
neg-mul-185.4%
fma-define85.4%
distribute-neg-in85.4%
distribute-lft-neg-in85.4%
metadata-eval85.4%
metadata-eval85.4%
distribute-rgt-in85.3%
+-commutative85.3%
sub-neg85.3%
distribute-rgt-in85.2%
sub-neg85.2%
distribute-rgt-in85.3%
metadata-eval85.3%
distribute-lft-neg-in85.3%
associate-+r+85.3%
Simplified85.3%
Taylor expanded in z around 0 82.1%
*-commutative82.1%
Simplified82.1%
if -6.50000000000000024e-66 < z < 0.630000000000000004Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 92.4%
Taylor expanded in z around 0 90.5%
distribute-lft1-in91.0%
metadata-eval91.0%
Simplified91.0%
Taylor expanded in x around 0 62.0%
(FPCore (x y z) :precision binary64 (if (<= z -0.6) (* (- y x) (* z -6.0)) (if (<= z 0.66) (+ x (* (- y x) 4.0)) (* z (* (- y x) -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.6) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.66) {
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.6d0)) then
tmp = (y - x) * (z * (-6.0d0))
else if (z <= 0.66d0) 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.6) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.66) {
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.6: tmp = (y - x) * (z * -6.0) elif z <= 0.66: 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.6) tmp = Float64(Float64(y - x) * Float64(z * -6.0)); elseif (z <= 0.66) 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.6) tmp = (y - x) * (z * -6.0); elseif (z <= 0.66) 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.6], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.66], 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.6:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;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.599999999999999978Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
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 z around inf 99.8%
+-commutative99.8%
clear-num99.8%
associate-*r/99.8%
frac-add68.6%
*-un-lft-identity68.6%
Applied egg-rr68.6%
Taylor expanded in z around inf 97.7%
associate-*r*97.8%
*-commutative97.8%
*-commutative97.8%
Simplified97.8%
if -0.599999999999999978 < z < 0.660000000000000031Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 97.2%
if 0.660000000000000031 < z Initial program 99.8%
+-commutative99.8%
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 z around inf 99.8%
Taylor expanded in z around inf 96.8%
Final simplification97.2%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.05e-82) (not (<= x 5.6e+17))) (* x -3.0) (* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.05e-82) || !(x <= 5.6e+17)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.05d-82)) .or. (.not. (x <= 5.6d+17))) then
tmp = x * (-3.0d0)
else
tmp = y * 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.05e-82) || !(x <= 5.6e+17)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.05e-82) or not (x <= 5.6e+17): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.05e-82) || !(x <= 5.6e+17)) tmp = Float64(x * -3.0); else tmp = Float64(y * 4.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.05e-82) || ~((x <= 5.6e+17))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.05e-82], N[Not[LessEqual[x, 5.6e+17]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-82} \lor \neg \left(x \leq 5.6 \cdot 10^{+17}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -1.05e-82 or 5.6e17 < x Initial program 99.6%
+-commutative99.6%
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 80.5%
*-lft-identity80.5%
*-commutative80.5%
+-commutative80.5%
*-commutative80.5%
fma-define80.4%
associate-*r*80.4%
neg-mul-180.4%
fma-define80.5%
distribute-neg-in80.5%
distribute-lft-neg-in80.5%
metadata-eval80.5%
metadata-eval80.5%
distribute-rgt-in80.4%
+-commutative80.4%
sub-neg80.4%
distribute-rgt-in80.4%
sub-neg80.4%
distribute-rgt-in80.5%
metadata-eval80.5%
distribute-lft-neg-in80.5%
associate-+r+80.5%
Simplified80.5%
Taylor expanded in z around 0 31.7%
*-commutative31.7%
Simplified31.7%
if -1.05e-82 < x < 5.6e17Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 97.5%
Taylor expanded in z around 0 61.1%
distribute-lft1-in61.1%
metadata-eval61.1%
Simplified61.1%
Taylor expanded in x around 0 49.9%
Final simplification40.4%
(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(Float64(y - x) * 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[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
(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.6%
+-commutative99.6%
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 52.4%
*-lft-identity52.4%
*-commutative52.4%
+-commutative52.4%
*-commutative52.4%
fma-define52.4%
associate-*r*52.4%
neg-mul-152.4%
fma-define52.4%
distribute-neg-in52.4%
distribute-lft-neg-in52.4%
metadata-eval52.4%
metadata-eval52.4%
distribute-rgt-in52.3%
+-commutative52.3%
sub-neg52.3%
distribute-rgt-in52.3%
sub-neg52.3%
distribute-rgt-in52.4%
metadata-eval52.4%
distribute-lft-neg-in52.4%
associate-+r+52.4%
Simplified52.4%
Taylor expanded in z around 0 22.9%
*-commutative22.9%
Simplified22.9%
(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 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 50.6%
Taylor expanded in z around 0 2.8%
herbie shell --seed 2024145
(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))))