
(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) (* 6.0 (- 0.6666666666666666 z)) x))
double code(double x, double y, double z) {
return fma((y - x), (6.0 * (0.6666666666666666 - z)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(6.0 * Float64(0.6666666666666666 - z)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(6.0 * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 6 \cdot \left(0.6666666666666666 - z\right), x\right)
\end{array}
Initial program 99.3%
+-commutative99.3%
associate-*l*99.5%
fma-def99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* x 6.0))) (t_1 (* z (* y -6.0))))
(if (<= z -4.7e+72)
t_0
(if (<= z -115000000.0)
t_1
(if (<= z 8.6e-296)
(* y 4.0)
(if (<= z 3.8e-217)
(* x -3.0)
(if (<= z 0.65)
(* y 4.0)
(if (<= z 1.4e+149)
(* -6.0 (* y z))
(if (<= z 3.5e+189) t_0 t_1)))))))))
double code(double x, double y, double z) {
double t_0 = z * (x * 6.0);
double t_1 = z * (y * -6.0);
double tmp;
if (z <= -4.7e+72) {
tmp = t_0;
} else if (z <= -115000000.0) {
tmp = t_1;
} else if (z <= 8.6e-296) {
tmp = y * 4.0;
} else if (z <= 3.8e-217) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else if (z <= 1.4e+149) {
tmp = -6.0 * (y * z);
} else if (z <= 3.5e+189) {
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 * (x * 6.0d0)
t_1 = z * (y * (-6.0d0))
if (z <= (-4.7d+72)) then
tmp = t_0
else if (z <= (-115000000.0d0)) then
tmp = t_1
else if (z <= 8.6d-296) then
tmp = y * 4.0d0
else if (z <= 3.8d-217) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else if (z <= 1.4d+149) then
tmp = (-6.0d0) * (y * z)
else if (z <= 3.5d+189) 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 * (x * 6.0);
double t_1 = z * (y * -6.0);
double tmp;
if (z <= -4.7e+72) {
tmp = t_0;
} else if (z <= -115000000.0) {
tmp = t_1;
} else if (z <= 8.6e-296) {
tmp = y * 4.0;
} else if (z <= 3.8e-217) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else if (z <= 1.4e+149) {
tmp = -6.0 * (y * z);
} else if (z <= 3.5e+189) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = z * (x * 6.0) t_1 = z * (y * -6.0) tmp = 0 if z <= -4.7e+72: tmp = t_0 elif z <= -115000000.0: tmp = t_1 elif z <= 8.6e-296: tmp = y * 4.0 elif z <= 3.8e-217: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.0 elif z <= 1.4e+149: tmp = -6.0 * (y * z) elif z <= 3.5e+189: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(x * 6.0)) t_1 = Float64(z * Float64(y * -6.0)) tmp = 0.0 if (z <= -4.7e+72) tmp = t_0; elseif (z <= -115000000.0) tmp = t_1; elseif (z <= 8.6e-296) tmp = Float64(y * 4.0); elseif (z <= 3.8e-217) tmp = Float64(x * -3.0); elseif (z <= 0.65) tmp = Float64(y * 4.0); elseif (z <= 1.4e+149) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= 3.5e+189) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (x * 6.0); t_1 = z * (y * -6.0); tmp = 0.0; if (z <= -4.7e+72) tmp = t_0; elseif (z <= -115000000.0) tmp = t_1; elseif (z <= 8.6e-296) tmp = y * 4.0; elseif (z <= 3.8e-217) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; elseif (z <= 1.4e+149) tmp = -6.0 * (y * z); elseif (z <= 3.5e+189) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.7e+72], t$95$0, If[LessEqual[z, -115000000.0], t$95$1, If[LessEqual[z, 8.6e-296], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.8e-217], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.4e+149], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e+189], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(x \cdot 6\right)\\
t_1 := z \cdot \left(y \cdot -6\right)\\
\mathbf{if}\;z \leq -4.7 \cdot 10^{+72}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -115000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-296}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-217}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+149}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+189}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.70000000000000034e72 or 1.4e149 < z < 3.49999999999999996e189Initial program 99.9%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around 0 64.0%
*-commutative64.0%
associate-*l*64.1%
Simplified64.1%
if -4.70000000000000034e72 < z < -1.15e8 or 3.49999999999999996e189 < z Initial program 99.9%
Taylor expanded in z around inf 98.8%
Taylor expanded in y around inf 68.1%
associate-*r*68.2%
*-commutative68.2%
Simplified68.2%
if -1.15e8 < z < 8.59999999999999956e-296 or 3.79999999999999987e-217 < z < 0.650000000000000022Initial program 98.7%
Taylor expanded in z around 0 96.1%
Taylor expanded in y around inf 57.9%
*-commutative57.9%
Simplified57.9%
if 8.59999999999999956e-296 < z < 3.79999999999999987e-217Initial program 99.5%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 66.8%
distribute-lft1-in66.8%
metadata-eval66.8%
*-commutative66.8%
Simplified66.8%
if 0.650000000000000022 < z < 1.4e149Initial program 99.4%
Taylor expanded in z around inf 99.6%
Taylor expanded in y around inf 68.0%
*-commutative68.0%
Simplified68.0%
Final simplification62.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* x 6.0))) (t_1 (* z (* y -6.0))))
(if (<= z -1.56e+71)
t_0
(if (<= z -115000000.0)
t_1
(if (<= z 8.6e-296)
(* y 4.0)
(if (<= z 2.5e-217)
(* x -3.0)
(if (<= z 0.65)
(* y 4.0)
(if (<= z 3.3e+131)
(* y (* z -6.0))
(if (<= z 1.8e+188) t_0 t_1)))))))))
double code(double x, double y, double z) {
double t_0 = z * (x * 6.0);
double t_1 = z * (y * -6.0);
double tmp;
if (z <= -1.56e+71) {
tmp = t_0;
} else if (z <= -115000000.0) {
tmp = t_1;
} else if (z <= 8.6e-296) {
tmp = y * 4.0;
} else if (z <= 2.5e-217) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else if (z <= 3.3e+131) {
tmp = y * (z * -6.0);
} else if (z <= 1.8e+188) {
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 * (x * 6.0d0)
t_1 = z * (y * (-6.0d0))
if (z <= (-1.56d+71)) then
tmp = t_0
else if (z <= (-115000000.0d0)) then
tmp = t_1
else if (z <= 8.6d-296) then
tmp = y * 4.0d0
else if (z <= 2.5d-217) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else if (z <= 3.3d+131) then
tmp = y * (z * (-6.0d0))
else if (z <= 1.8d+188) 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 * (x * 6.0);
double t_1 = z * (y * -6.0);
double tmp;
if (z <= -1.56e+71) {
tmp = t_0;
} else if (z <= -115000000.0) {
tmp = t_1;
} else if (z <= 8.6e-296) {
tmp = y * 4.0;
} else if (z <= 2.5e-217) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else if (z <= 3.3e+131) {
tmp = y * (z * -6.0);
} else if (z <= 1.8e+188) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = z * (x * 6.0) t_1 = z * (y * -6.0) tmp = 0 if z <= -1.56e+71: tmp = t_0 elif z <= -115000000.0: tmp = t_1 elif z <= 8.6e-296: tmp = y * 4.0 elif z <= 2.5e-217: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.0 elif z <= 3.3e+131: tmp = y * (z * -6.0) elif z <= 1.8e+188: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(x * 6.0)) t_1 = Float64(z * Float64(y * -6.0)) tmp = 0.0 if (z <= -1.56e+71) tmp = t_0; elseif (z <= -115000000.0) tmp = t_1; elseif (z <= 8.6e-296) tmp = Float64(y * 4.0); elseif (z <= 2.5e-217) tmp = Float64(x * -3.0); elseif (z <= 0.65) tmp = Float64(y * 4.0); elseif (z <= 3.3e+131) tmp = Float64(y * Float64(z * -6.0)); elseif (z <= 1.8e+188) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (x * 6.0); t_1 = z * (y * -6.0); tmp = 0.0; if (z <= -1.56e+71) tmp = t_0; elseif (z <= -115000000.0) tmp = t_1; elseif (z <= 8.6e-296) tmp = y * 4.0; elseif (z <= 2.5e-217) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; elseif (z <= 3.3e+131) tmp = y * (z * -6.0); elseif (z <= 1.8e+188) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.56e+71], t$95$0, If[LessEqual[z, -115000000.0], t$95$1, If[LessEqual[z, 8.6e-296], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.5e-217], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.3e+131], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e+188], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(x \cdot 6\right)\\
t_1 := z \cdot \left(y \cdot -6\right)\\
\mathbf{if}\;z \leq -1.56 \cdot 10^{+71}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -115000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-296}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-217}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+131}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+188}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.5599999999999999e71 or 3.2999999999999998e131 < z < 1.8000000000000001e188Initial program 99.9%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around 0 64.0%
*-commutative64.0%
associate-*l*64.1%
Simplified64.1%
if -1.5599999999999999e71 < z < -1.15e8 or 1.8000000000000001e188 < z Initial program 99.9%
Taylor expanded in z around inf 98.8%
Taylor expanded in y around inf 68.1%
associate-*r*68.2%
*-commutative68.2%
Simplified68.2%
if -1.15e8 < z < 8.59999999999999956e-296 or 2.5000000000000001e-217 < z < 0.650000000000000022Initial program 98.7%
Taylor expanded in z around 0 96.1%
Taylor expanded in y around inf 57.9%
*-commutative57.9%
Simplified57.9%
if 8.59999999999999956e-296 < z < 2.5000000000000001e-217Initial program 99.5%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 66.8%
distribute-lft1-in66.8%
metadata-eval66.8%
*-commutative66.8%
Simplified66.8%
if 0.650000000000000022 < z < 3.2999999999999998e131Initial program 99.4%
+-commutative99.4%
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.6%
metadata-eval99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 68.1%
Taylor expanded in z around inf 68.1%
Final simplification62.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -0.0285)
t_0
(if (<= z 8.6e-296)
(* y 4.0)
(if (<= z 1.6e-215) (* x -3.0) (if (<= z 0.55) (* 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.0285) {
tmp = t_0;
} else if (z <= 8.6e-296) {
tmp = y * 4.0;
} else if (z <= 1.6e-215) {
tmp = x * -3.0;
} else if (z <= 0.55) {
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.0285d0)) then
tmp = t_0
else if (z <= 8.6d-296) then
tmp = y * 4.0d0
else if (z <= 1.6d-215) then
tmp = x * (-3.0d0)
else if (z <= 0.55d0) 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.0285) {
tmp = t_0;
} else if (z <= 8.6e-296) {
tmp = y * 4.0;
} else if (z <= 1.6e-215) {
tmp = x * -3.0;
} else if (z <= 0.55) {
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.0285: tmp = t_0 elif z <= 8.6e-296: tmp = y * 4.0 elif z <= 1.6e-215: tmp = x * -3.0 elif z <= 0.55: 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.0285) tmp = t_0; elseif (z <= 8.6e-296) tmp = Float64(y * 4.0); elseif (z <= 1.6e-215) tmp = Float64(x * -3.0); elseif (z <= 0.55) 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.0285) tmp = t_0; elseif (z <= 8.6e-296) tmp = y * 4.0; elseif (z <= 1.6e-215) tmp = x * -3.0; elseif (z <= 0.55) 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.0285], t$95$0, If[LessEqual[z, 8.6e-296], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.6e-215], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.55], 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.0285:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-296}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-215}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.55:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -0.028500000000000001 or 0.55000000000000004 < z Initial program 99.8%
Taylor expanded in z around inf 99.1%
if -0.028500000000000001 < z < 8.59999999999999956e-296 or 1.6000000000000001e-215 < z < 0.55000000000000004Initial program 98.7%
Taylor expanded in z around 0 96.9%
Taylor expanded in y around inf 58.4%
*-commutative58.4%
Simplified58.4%
if 8.59999999999999956e-296 < z < 1.6000000000000001e-215Initial program 99.5%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 66.8%
distribute-lft1-in66.8%
metadata-eval66.8%
*-commutative66.8%
Simplified66.8%
Final simplification78.9%
(FPCore (x y z)
:precision binary64
(if (<= z -0.018)
(* z (* (- y x) -6.0))
(if (<= z 8.6e-296)
(* y 4.0)
(if (<= z 8e-215)
(* x -3.0)
(if (<= z 0.56) (* y 4.0) (* -6.0 (* (- y x) z)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.018) {
tmp = z * ((y - x) * -6.0);
} else if (z <= 8.6e-296) {
tmp = y * 4.0;
} else if (z <= 8e-215) {
tmp = x * -3.0;
} else if (z <= 0.56) {
tmp = y * 4.0;
} else {
tmp = -6.0 * ((y - 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 <= (-0.018d0)) then
tmp = z * ((y - x) * (-6.0d0))
else if (z <= 8.6d-296) then
tmp = y * 4.0d0
else if (z <= 8d-215) then
tmp = x * (-3.0d0)
else if (z <= 0.56d0) then
tmp = y * 4.0d0
else
tmp = (-6.0d0) * ((y - x) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.018) {
tmp = z * ((y - x) * -6.0);
} else if (z <= 8.6e-296) {
tmp = y * 4.0;
} else if (z <= 8e-215) {
tmp = x * -3.0;
} else if (z <= 0.56) {
tmp = y * 4.0;
} else {
tmp = -6.0 * ((y - x) * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.018: tmp = z * ((y - x) * -6.0) elif z <= 8.6e-296: tmp = y * 4.0 elif z <= 8e-215: tmp = x * -3.0 elif z <= 0.56: tmp = y * 4.0 else: tmp = -6.0 * ((y - x) * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.018) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); elseif (z <= 8.6e-296) tmp = Float64(y * 4.0); elseif (z <= 8e-215) tmp = Float64(x * -3.0); elseif (z <= 0.56) tmp = Float64(y * 4.0); else tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.018) tmp = z * ((y - x) * -6.0); elseif (z <= 8.6e-296) tmp = y * 4.0; elseif (z <= 8e-215) tmp = x * -3.0; elseif (z <= 0.56) tmp = y * 4.0; else tmp = -6.0 * ((y - x) * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.018], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.6e-296], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 8e-215], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.56], N[(y * 4.0), $MachinePrecision], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.018:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-296}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-215}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.56:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\end{array}
\end{array}
if z < -0.0179999999999999986Initial program 99.9%
Taylor expanded in z around inf 98.8%
associate-*r*98.8%
*-commutative98.8%
associate-*l*98.9%
Simplified98.9%
if -0.0179999999999999986 < z < 8.59999999999999956e-296 or 8.00000000000000033e-215 < z < 0.56000000000000005Initial program 98.7%
Taylor expanded in z around 0 96.9%
Taylor expanded in y around inf 58.4%
*-commutative58.4%
Simplified58.4%
if 8.59999999999999956e-296 < z < 8.00000000000000033e-215Initial program 99.5%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 66.8%
distribute-lft1-in66.8%
metadata-eval66.8%
*-commutative66.8%
Simplified66.8%
if 0.56000000000000005 < z Initial program 99.7%
Taylor expanded in z around inf 99.7%
Final simplification78.9%
(FPCore (x y z)
:precision binary64
(if (<= z -0.0132)
(* z (* (- y x) -6.0))
(if (<= z 8.6e-296)
(* y 4.0)
(if (<= z 1.2e-216)
(* x -3.0)
(if (<= z 0.65) (* y 4.0) (* (- y x) (* z -6.0)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.0132) {
tmp = z * ((y - x) * -6.0);
} else if (z <= 8.6e-296) {
tmp = y * 4.0;
} else if (z <= 1.2e-216) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = (y - 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.0132d0)) then
tmp = z * ((y - x) * (-6.0d0))
else if (z <= 8.6d-296) then
tmp = y * 4.0d0
else if (z <= 1.2d-216) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else
tmp = (y - 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.0132) {
tmp = z * ((y - x) * -6.0);
} else if (z <= 8.6e-296) {
tmp = y * 4.0;
} else if (z <= 1.2e-216) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = (y - x) * (z * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.0132: tmp = z * ((y - x) * -6.0) elif z <= 8.6e-296: tmp = y * 4.0 elif z <= 1.2e-216: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.0 else: tmp = (y - x) * (z * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.0132) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); elseif (z <= 8.6e-296) tmp = Float64(y * 4.0); elseif (z <= 1.2e-216) tmp = Float64(x * -3.0); elseif (z <= 0.65) tmp = Float64(y * 4.0); else tmp = Float64(Float64(y - x) * Float64(z * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.0132) tmp = z * ((y - x) * -6.0); elseif (z <= 8.6e-296) tmp = y * 4.0; elseif (z <= 1.2e-216) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; else tmp = (y - x) * (z * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.0132], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.6e-296], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.2e-216], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0132:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-296}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-216}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.0132Initial program 99.9%
Taylor expanded in z around inf 98.8%
associate-*r*98.8%
*-commutative98.8%
associate-*l*98.9%
Simplified98.9%
if -0.0132 < z < 8.59999999999999956e-296 or 1.20000000000000002e-216 < z < 0.650000000000000022Initial program 98.7%
Taylor expanded in z around 0 96.9%
Taylor expanded in y around inf 58.4%
*-commutative58.4%
Simplified58.4%
if 8.59999999999999956e-296 < z < 1.20000000000000002e-216Initial program 99.5%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 66.8%
distribute-lft1-in66.8%
metadata-eval66.8%
*-commutative66.8%
Simplified66.8%
if 0.650000000000000022 < z Initial program 99.7%
Taylor expanded in z around inf 99.7%
associate-*r*99.9%
*-commutative99.9%
Simplified99.9%
Final simplification79.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (+ 4.0 (* z -6.0)))))
(if (<= z -490.0)
(* z (* (- y x) -6.0))
(if (<= z 8.6e-296)
t_0
(if (<= z 2.05e-215)
(* x -3.0)
(if (<= z 300000.0) t_0 (* (- y x) (* z -6.0))))))))
double code(double x, double y, double z) {
double t_0 = y * (4.0 + (z * -6.0));
double tmp;
if (z <= -490.0) {
tmp = z * ((y - x) * -6.0);
} else if (z <= 8.6e-296) {
tmp = t_0;
} else if (z <= 2.05e-215) {
tmp = x * -3.0;
} else if (z <= 300000.0) {
tmp = t_0;
} else {
tmp = (y - 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) :: t_0
real(8) :: tmp
t_0 = y * (4.0d0 + (z * (-6.0d0)))
if (z <= (-490.0d0)) then
tmp = z * ((y - x) * (-6.0d0))
else if (z <= 8.6d-296) then
tmp = t_0
else if (z <= 2.05d-215) then
tmp = x * (-3.0d0)
else if (z <= 300000.0d0) then
tmp = t_0
else
tmp = (y - x) * (z * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (4.0 + (z * -6.0));
double tmp;
if (z <= -490.0) {
tmp = z * ((y - x) * -6.0);
} else if (z <= 8.6e-296) {
tmp = t_0;
} else if (z <= 2.05e-215) {
tmp = x * -3.0;
} else if (z <= 300000.0) {
tmp = t_0;
} else {
tmp = (y - x) * (z * -6.0);
}
return tmp;
}
def code(x, y, z): t_0 = y * (4.0 + (z * -6.0)) tmp = 0 if z <= -490.0: tmp = z * ((y - x) * -6.0) elif z <= 8.6e-296: tmp = t_0 elif z <= 2.05e-215: tmp = x * -3.0 elif z <= 300000.0: tmp = t_0 else: tmp = (y - x) * (z * -6.0) return tmp
function code(x, y, z) t_0 = Float64(y * Float64(4.0 + Float64(z * -6.0))) tmp = 0.0 if (z <= -490.0) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); elseif (z <= 8.6e-296) tmp = t_0; elseif (z <= 2.05e-215) tmp = Float64(x * -3.0); elseif (z <= 300000.0) tmp = t_0; else tmp = Float64(Float64(y - x) * Float64(z * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (4.0 + (z * -6.0)); tmp = 0.0; if (z <= -490.0) tmp = z * ((y - x) * -6.0); elseif (z <= 8.6e-296) tmp = t_0; elseif (z <= 2.05e-215) tmp = x * -3.0; elseif (z <= 300000.0) tmp = t_0; else tmp = (y - x) * (z * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -490.0], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.6e-296], t$95$0, If[LessEqual[z, 2.05e-215], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 300000.0], t$95$0, N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{if}\;z \leq -490:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-296}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-215}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 300000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\end{array}
\end{array}
if z < -490Initial program 99.9%
Taylor expanded in z around inf 98.8%
associate-*r*98.8%
*-commutative98.8%
associate-*l*98.9%
Simplified98.9%
if -490 < z < 8.59999999999999956e-296 or 2.04999999999999992e-215 < z < 3e5Initial program 98.7%
+-commutative98.7%
associate-*l*99.1%
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 59.7%
if 8.59999999999999956e-296 < z < 2.04999999999999992e-215Initial program 99.5%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 66.8%
distribute-lft1-in66.8%
metadata-eval66.8%
*-commutative66.8%
Simplified66.8%
if 3e5 < z Initial program 99.7%
Taylor expanded in z around inf 99.7%
associate-*r*99.9%
*-commutative99.9%
Simplified99.9%
Final simplification79.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -115000000.0)
t_0
(if (<= z 8.6e-296)
(* y 4.0)
(if (<= z 2.3e-215) (* x -3.0) (if (<= z 0.65) (* y 4.0) t_0))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -115000000.0) {
tmp = t_0;
} else if (z <= 8.6e-296) {
tmp = y * 4.0;
} else if (z <= 2.3e-215) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-115000000.0d0)) then
tmp = t_0
else if (z <= 8.6d-296) then
tmp = y * 4.0d0
else if (z <= 2.3d-215) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -115000000.0) {
tmp = t_0;
} else if (z <= 8.6e-296) {
tmp = y * 4.0;
} else if (z <= 2.3e-215) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -115000000.0: tmp = t_0 elif z <= 8.6e-296: tmp = y * 4.0 elif z <= 2.3e-215: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -115000000.0) tmp = t_0; elseif (z <= 8.6e-296) tmp = Float64(y * 4.0); elseif (z <= 2.3e-215) tmp = Float64(x * -3.0); elseif (z <= 0.65) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -115000000.0) tmp = t_0; elseif (z <= 8.6e-296) tmp = y * 4.0; elseif (z <= 2.3e-215) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -115000000.0], t$95$0, If[LessEqual[z, 8.6e-296], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.3e-215], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -115000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-296}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-215}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1.15e8 or 0.650000000000000022 < z Initial program 99.8%
Taylor expanded in z around inf 99.5%
Taylor expanded in y around inf 55.7%
*-commutative55.7%
Simplified55.7%
if -1.15e8 < z < 8.59999999999999956e-296 or 2.2999999999999999e-215 < z < 0.650000000000000022Initial program 98.7%
Taylor expanded in z around 0 96.1%
Taylor expanded in y around inf 57.9%
*-commutative57.9%
Simplified57.9%
if 8.59999999999999956e-296 < z < 2.2999999999999999e-215Initial program 99.5%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 66.8%
distribute-lft1-in66.8%
metadata-eval66.8%
*-commutative66.8%
Simplified66.8%
Final simplification57.5%
(FPCore (x y z)
:precision binary64
(if (<= z -115000000.0)
(* z (* y -6.0))
(if (<= z 8.6e-296)
(* y 4.0)
(if (<= z 2.4e-216)
(* x -3.0)
(if (<= z 0.65) (* y 4.0) (* -6.0 (* y z)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -115000000.0) {
tmp = z * (y * -6.0);
} else if (z <= 8.6e-296) {
tmp = y * 4.0;
} else if (z <= 2.4e-216) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = -6.0 * (y * 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 <= (-115000000.0d0)) then
tmp = z * (y * (-6.0d0))
else if (z <= 8.6d-296) then
tmp = y * 4.0d0
else if (z <= 2.4d-216) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else
tmp = (-6.0d0) * (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -115000000.0) {
tmp = z * (y * -6.0);
} else if (z <= 8.6e-296) {
tmp = y * 4.0;
} else if (z <= 2.4e-216) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = -6.0 * (y * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -115000000.0: tmp = z * (y * -6.0) elif z <= 8.6e-296: tmp = y * 4.0 elif z <= 2.4e-216: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.0 else: tmp = -6.0 * (y * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -115000000.0) tmp = Float64(z * Float64(y * -6.0)); elseif (z <= 8.6e-296) tmp = Float64(y * 4.0); elseif (z <= 2.4e-216) tmp = Float64(x * -3.0); elseif (z <= 0.65) tmp = Float64(y * 4.0); else tmp = Float64(-6.0 * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -115000000.0) tmp = z * (y * -6.0); elseif (z <= 8.6e-296) tmp = y * 4.0; elseif (z <= 2.4e-216) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; else tmp = -6.0 * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -115000000.0], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.6e-296], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.4e-216], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -115000000:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-296}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-216}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if z < -1.15e8Initial program 99.9%
Taylor expanded in z around inf 99.3%
Taylor expanded in y around inf 52.8%
associate-*r*52.8%
*-commutative52.8%
Simplified52.8%
if -1.15e8 < z < 8.59999999999999956e-296 or 2.40000000000000004e-216 < z < 0.650000000000000022Initial program 98.7%
Taylor expanded in z around 0 96.1%
Taylor expanded in y around inf 57.9%
*-commutative57.9%
Simplified57.9%
if 8.59999999999999956e-296 < z < 2.40000000000000004e-216Initial program 99.5%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 66.8%
distribute-lft1-in66.8%
metadata-eval66.8%
*-commutative66.8%
Simplified66.8%
if 0.650000000000000022 < z Initial program 99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in y around inf 60.2%
*-commutative60.2%
Simplified60.2%
Final simplification57.5%
(FPCore (x y z) :precision binary64 (if (or (<= x -2.05e-14) (not (<= x 3.9e-20))) (* x (- (* 6.0 z) 3.0)) (* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.05e-14) || !(x <= 3.9e-20)) {
tmp = x * ((6.0 * z) - 3.0);
} else {
tmp = y * (4.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 ((x <= (-2.05d-14)) .or. (.not. (x <= 3.9d-20))) then
tmp = x * ((6.0d0 * z) - 3.0d0)
else
tmp = y * (4.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -2.05e-14) || !(x <= 3.9e-20)) {
tmp = x * ((6.0 * z) - 3.0);
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.05e-14) or not (x <= 3.9e-20): tmp = x * ((6.0 * z) - 3.0) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.05e-14) || !(x <= 3.9e-20)) tmp = Float64(x * Float64(Float64(6.0 * z) - 3.0)); else tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -2.05e-14) || ~((x <= 3.9e-20))) tmp = x * ((6.0 * z) - 3.0); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.05e-14], N[Not[LessEqual[x, 3.9e-20]], $MachinePrecision]], N[(x * N[(N[(6.0 * z), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.05 \cdot 10^{-14} \lor \neg \left(x \leq 3.9 \cdot 10^{-20}\right):\\
\;\;\;\;x \cdot \left(6 \cdot z - 3\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if x < -2.0500000000000001e-14 or 3.90000000000000007e-20 < x Initial program 99.0%
Taylor expanded in z around 0 99.2%
Taylor expanded in x around inf 80.3%
if -2.0500000000000001e-14 < x < 3.90000000000000007e-20Initial 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 85.4%
Final simplification82.9%
(FPCore (x y z) :precision binary64 (if (<= z -0.6) (* z (* (- y x) -6.0)) (if (<= z 0.64) (+ (* x -3.0) (* y 4.0)) (* (- y x) (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.6) {
tmp = z * ((y - x) * -6.0);
} else if (z <= 0.64) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = (y - 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.6d0)) then
tmp = z * ((y - x) * (-6.0d0))
else if (z <= 0.64d0) then
tmp = (x * (-3.0d0)) + (y * 4.0d0)
else
tmp = (y - 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.6) {
tmp = z * ((y - x) * -6.0);
} else if (z <= 0.64) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = (y - x) * (z * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.6: tmp = z * ((y - x) * -6.0) elif z <= 0.64: tmp = (x * -3.0) + (y * 4.0) else: tmp = (y - x) * (z * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.6) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); elseif (z <= 0.64) tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); else tmp = Float64(Float64(y - x) * Float64(z * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.6) tmp = z * ((y - x) * -6.0); elseif (z <= 0.64) tmp = (x * -3.0) + (y * 4.0); else tmp = (y - x) * (z * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.6], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.64], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.6:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.64:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.599999999999999978Initial program 99.9%
Taylor expanded in z around inf 98.8%
associate-*r*98.8%
*-commutative98.8%
associate-*l*98.9%
Simplified98.9%
if -0.599999999999999978 < z < 0.640000000000000013Initial program 98.8%
Taylor expanded in z around 0 97.3%
Taylor expanded in x around 0 97.9%
if 0.640000000000000013 < z Initial program 99.7%
Taylor expanded in z around inf 99.7%
associate-*r*99.9%
*-commutative99.9%
Simplified99.9%
Final simplification98.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.3%
associate-*l*99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (if (<= x -5.8e-52) (* x -3.0) (if (<= x 4.4e+67) (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -5.8e-52) {
tmp = x * -3.0;
} else if (x <= 4.4e+67) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-5.8d-52)) then
tmp = x * (-3.0d0)
else if (x <= 4.4d+67) then
tmp = y * 4.0d0
else
tmp = x * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -5.8e-52) {
tmp = x * -3.0;
} else if (x <= 4.4e+67) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -5.8e-52: tmp = x * -3.0 elif x <= 4.4e+67: tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -5.8e-52) tmp = Float64(x * -3.0); elseif (x <= 4.4e+67) tmp = Float64(y * 4.0); else tmp = Float64(x * -3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -5.8e-52) tmp = x * -3.0; elseif (x <= 4.4e+67) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -5.8e-52], N[(x * -3.0), $MachinePrecision], If[LessEqual[x, 4.4e+67], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-52}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{+67}:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if x < -5.8000000000000003e-52 or 4.4e67 < x Initial program 99.0%
Taylor expanded in z around 0 49.9%
Taylor expanded in y around 0 40.2%
distribute-lft1-in40.8%
metadata-eval40.8%
*-commutative40.8%
Simplified40.8%
if -5.8000000000000003e-52 < x < 4.4e67Initial program 99.5%
Taylor expanded in z around 0 53.7%
Taylor expanded in y around inf 44.7%
*-commutative44.7%
Simplified44.7%
Final simplification43.0%
(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.3%
Taylor expanded in z around 0 52.0%
Taylor expanded in y around 0 24.0%
distribute-lft1-in24.3%
metadata-eval24.3%
*-commutative24.3%
Simplified24.3%
Final simplification24.3%
herbie shell --seed 2023192
(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))))