
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
(FPCore (x y z t) :precision binary64 (fma (- y z) (- t x) x))
double code(double x, double y, double z, double t) {
return fma((y - z), (t - x), x);
}
function code(x, y, z, t) return fma(Float64(y - z), Float64(t - x), x) end
code[x_, y_, z_, t_] := N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - z, t - x, x\right)
\end{array}
Initial program 100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) t)))
(if (<= (- y z) -5e-26)
t_1
(if (<= (- y z) 1e-19)
x
(if (or (<= (- y z) 5e+174) (not (<= (- y z) 2e+267))) t_1 (* z x))))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if ((y - z) <= -5e-26) {
tmp = t_1;
} else if ((y - z) <= 1e-19) {
tmp = x;
} else if (((y - z) <= 5e+174) || !((y - z) <= 2e+267)) {
tmp = t_1;
} else {
tmp = z * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) * t
if ((y - z) <= (-5d-26)) then
tmp = t_1
else if ((y - z) <= 1d-19) then
tmp = x
else if (((y - z) <= 5d+174) .or. (.not. ((y - z) <= 2d+267))) then
tmp = t_1
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if ((y - z) <= -5e-26) {
tmp = t_1;
} else if ((y - z) <= 1e-19) {
tmp = x;
} else if (((y - z) <= 5e+174) || !((y - z) <= 2e+267)) {
tmp = t_1;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if (y - z) <= -5e-26: tmp = t_1 elif (y - z) <= 1e-19: tmp = x elif ((y - z) <= 5e+174) or not ((y - z) <= 2e+267): tmp = t_1 else: tmp = z * x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) tmp = 0.0 if (Float64(y - z) <= -5e-26) tmp = t_1; elseif (Float64(y - z) <= 1e-19) tmp = x; elseif ((Float64(y - z) <= 5e+174) || !(Float64(y - z) <= 2e+267)) tmp = t_1; else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * t; tmp = 0.0; if ((y - z) <= -5e-26) tmp = t_1; elseif ((y - z) <= 1e-19) tmp = x; elseif (((y - z) <= 5e+174) || ~(((y - z) <= 2e+267))) tmp = t_1; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[N[(y - z), $MachinePrecision], -5e-26], t$95$1, If[LessEqual[N[(y - z), $MachinePrecision], 1e-19], x, If[Or[LessEqual[N[(y - z), $MachinePrecision], 5e+174], N[Not[LessEqual[N[(y - z), $MachinePrecision], 2e+267]], $MachinePrecision]], t$95$1, N[(z * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;y - z \leq -5 \cdot 10^{-26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y - z \leq 10^{-19}:\\
\;\;\;\;x\\
\mathbf{elif}\;y - z \leq 5 \cdot 10^{+174} \lor \neg \left(y - z \leq 2 \cdot 10^{+267}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if (-.f64 y z) < -5.00000000000000019e-26 or 9.9999999999999998e-20 < (-.f64 y z) < 4.9999999999999997e174 or 1.9999999999999999e267 < (-.f64 y z) Initial program 100.0%
Taylor expanded in x around 0 58.6%
if -5.00000000000000019e-26 < (-.f64 y z) < 9.9999999999999998e-20Initial program 100.0%
Taylor expanded in z around 0 82.4%
Taylor expanded in y around 0 71.9%
if 4.9999999999999997e174 < (-.f64 y z) < 1.9999999999999999e267Initial program 100.0%
Taylor expanded in z around inf 54.1%
mul-1-neg54.1%
distribute-lft-neg-out54.1%
*-commutative54.1%
Simplified54.1%
Taylor expanded in t around 0 49.2%
Final simplification60.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (* z (- x t))))
(if (<= y -1.76e+30)
t_1
(if (<= y -3.4e-14)
(- x (* y x))
(if (<= y -1.15e-26)
(* (- y z) t)
(if (<= y 3.4e-291)
(- x (* z t))
(if (<= y 9e-242)
t_2
(if (<= y 6.8e-121)
(+ x (* z x))
(if (<= y 7.8e-11) t_2 t_1)))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = z * (x - t);
double tmp;
if (y <= -1.76e+30) {
tmp = t_1;
} else if (y <= -3.4e-14) {
tmp = x - (y * x);
} else if (y <= -1.15e-26) {
tmp = (y - z) * t;
} else if (y <= 3.4e-291) {
tmp = x - (z * t);
} else if (y <= 9e-242) {
tmp = t_2;
} else if (y <= 6.8e-121) {
tmp = x + (z * x);
} else if (y <= 7.8e-11) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y * (t - x)
t_2 = z * (x - t)
if (y <= (-1.76d+30)) then
tmp = t_1
else if (y <= (-3.4d-14)) then
tmp = x - (y * x)
else if (y <= (-1.15d-26)) then
tmp = (y - z) * t
else if (y <= 3.4d-291) then
tmp = x - (z * t)
else if (y <= 9d-242) then
tmp = t_2
else if (y <= 6.8d-121) then
tmp = x + (z * x)
else if (y <= 7.8d-11) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = z * (x - t);
double tmp;
if (y <= -1.76e+30) {
tmp = t_1;
} else if (y <= -3.4e-14) {
tmp = x - (y * x);
} else if (y <= -1.15e-26) {
tmp = (y - z) * t;
} else if (y <= 3.4e-291) {
tmp = x - (z * t);
} else if (y <= 9e-242) {
tmp = t_2;
} else if (y <= 6.8e-121) {
tmp = x + (z * x);
} else if (y <= 7.8e-11) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = z * (x - t) tmp = 0 if y <= -1.76e+30: tmp = t_1 elif y <= -3.4e-14: tmp = x - (y * x) elif y <= -1.15e-26: tmp = (y - z) * t elif y <= 3.4e-291: tmp = x - (z * t) elif y <= 9e-242: tmp = t_2 elif y <= 6.8e-121: tmp = x + (z * x) elif y <= 7.8e-11: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(z * Float64(x - t)) tmp = 0.0 if (y <= -1.76e+30) tmp = t_1; elseif (y <= -3.4e-14) tmp = Float64(x - Float64(y * x)); elseif (y <= -1.15e-26) tmp = Float64(Float64(y - z) * t); elseif (y <= 3.4e-291) tmp = Float64(x - Float64(z * t)); elseif (y <= 9e-242) tmp = t_2; elseif (y <= 6.8e-121) tmp = Float64(x + Float64(z * x)); elseif (y <= 7.8e-11) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); t_2 = z * (x - t); tmp = 0.0; if (y <= -1.76e+30) tmp = t_1; elseif (y <= -3.4e-14) tmp = x - (y * x); elseif (y <= -1.15e-26) tmp = (y - z) * t; elseif (y <= 3.4e-291) tmp = x - (z * t); elseif (y <= 9e-242) tmp = t_2; elseif (y <= 6.8e-121) tmp = x + (z * x); elseif (y <= 7.8e-11) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.76e+30], t$95$1, If[LessEqual[y, -3.4e-14], N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.15e-26], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 3.4e-291], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e-242], t$95$2, If[LessEqual[y, 6.8e-121], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e-11], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := z \cdot \left(x - t\right)\\
\mathbf{if}\;y \leq -1.76 \cdot 10^{+30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{-14}:\\
\;\;\;\;x - y \cdot x\\
\mathbf{elif}\;y \leq -1.15 \cdot 10^{-26}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-291}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-242}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{-121}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{-11}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.7600000000000001e30 or 7.80000000000000021e-11 < y Initial program 100.0%
Taylor expanded in y around inf 78.8%
if -1.7600000000000001e30 < y < -3.40000000000000003e-14Initial program 99.9%
Taylor expanded in z around 0 73.1%
Taylor expanded in t around 0 64.5%
mul-1-neg19.5%
distribute-rgt-neg-out19.5%
Simplified64.5%
if -3.40000000000000003e-14 < y < -1.15000000000000004e-26Initial program 100.0%
Taylor expanded in x around 0 100.0%
if -1.15000000000000004e-26 < y < 3.40000000000000026e-291Initial program 100.0%
Taylor expanded in y around 0 94.3%
+-commutative94.3%
mul-1-neg94.3%
unsub-neg94.3%
*-commutative94.3%
Simplified94.3%
Taylor expanded in t around inf 76.6%
if 3.40000000000000026e-291 < y < 8.9999999999999997e-242 or 6.80000000000000003e-121 < y < 7.80000000000000021e-11Initial program 100.0%
Taylor expanded in y around 0 94.3%
+-commutative94.3%
mul-1-neg94.3%
unsub-neg94.3%
*-commutative94.3%
Simplified94.3%
Taylor expanded in z around inf 88.8%
if 8.9999999999999997e-242 < y < 6.80000000000000003e-121Initial program 100.0%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 76.4%
sub-neg76.4%
neg-mul-176.4%
remove-double-neg76.4%
*-commutative76.4%
distribute-lft-in76.5%
*-rgt-identity76.5%
Simplified76.5%
Final simplification79.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (- z))))
(if (<= y -1.6e-17)
(* y t)
(if (<= y -2.9e-285)
t_1
(if (<= y 8.4e-268)
(* z x)
(if (<= y 6.1e-238)
t_1
(if (<= y 1.35e-132)
x
(if (<= y 1.6e-19)
t_1
(if (<= y 4.7e+63) (* z x) (* y (- x)))))))))))
double code(double x, double y, double z, double t) {
double t_1 = t * -z;
double tmp;
if (y <= -1.6e-17) {
tmp = y * t;
} else if (y <= -2.9e-285) {
tmp = t_1;
} else if (y <= 8.4e-268) {
tmp = z * x;
} else if (y <= 6.1e-238) {
tmp = t_1;
} else if (y <= 1.35e-132) {
tmp = x;
} else if (y <= 1.6e-19) {
tmp = t_1;
} else if (y <= 4.7e+63) {
tmp = z * x;
} else {
tmp = y * -x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = t * -z
if (y <= (-1.6d-17)) then
tmp = y * t
else if (y <= (-2.9d-285)) then
tmp = t_1
else if (y <= 8.4d-268) then
tmp = z * x
else if (y <= 6.1d-238) then
tmp = t_1
else if (y <= 1.35d-132) then
tmp = x
else if (y <= 1.6d-19) then
tmp = t_1
else if (y <= 4.7d+63) then
tmp = z * x
else
tmp = y * -x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t * -z;
double tmp;
if (y <= -1.6e-17) {
tmp = y * t;
} else if (y <= -2.9e-285) {
tmp = t_1;
} else if (y <= 8.4e-268) {
tmp = z * x;
} else if (y <= 6.1e-238) {
tmp = t_1;
} else if (y <= 1.35e-132) {
tmp = x;
} else if (y <= 1.6e-19) {
tmp = t_1;
} else if (y <= 4.7e+63) {
tmp = z * x;
} else {
tmp = y * -x;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * -z tmp = 0 if y <= -1.6e-17: tmp = y * t elif y <= -2.9e-285: tmp = t_1 elif y <= 8.4e-268: tmp = z * x elif y <= 6.1e-238: tmp = t_1 elif y <= 1.35e-132: tmp = x elif y <= 1.6e-19: tmp = t_1 elif y <= 4.7e+63: tmp = z * x else: tmp = y * -x return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(-z)) tmp = 0.0 if (y <= -1.6e-17) tmp = Float64(y * t); elseif (y <= -2.9e-285) tmp = t_1; elseif (y <= 8.4e-268) tmp = Float64(z * x); elseif (y <= 6.1e-238) tmp = t_1; elseif (y <= 1.35e-132) tmp = x; elseif (y <= 1.6e-19) tmp = t_1; elseif (y <= 4.7e+63) tmp = Float64(z * x); else tmp = Float64(y * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * -z; tmp = 0.0; if (y <= -1.6e-17) tmp = y * t; elseif (y <= -2.9e-285) tmp = t_1; elseif (y <= 8.4e-268) tmp = z * x; elseif (y <= 6.1e-238) tmp = t_1; elseif (y <= 1.35e-132) tmp = x; elseif (y <= 1.6e-19) tmp = t_1; elseif (y <= 4.7e+63) tmp = z * x; else tmp = y * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * (-z)), $MachinePrecision]}, If[LessEqual[y, -1.6e-17], N[(y * t), $MachinePrecision], If[LessEqual[y, -2.9e-285], t$95$1, If[LessEqual[y, 8.4e-268], N[(z * x), $MachinePrecision], If[LessEqual[y, 6.1e-238], t$95$1, If[LessEqual[y, 1.35e-132], x, If[LessEqual[y, 1.6e-19], t$95$1, If[LessEqual[y, 4.7e+63], N[(z * x), $MachinePrecision], N[(y * (-x)), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(-z\right)\\
\mathbf{if}\;y \leq -1.6 \cdot 10^{-17}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{-285}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 8.4 \cdot 10^{-268}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 6.1 \cdot 10^{-238}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-132}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-19}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+63}:\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\end{array}
\end{array}
if y < -1.6000000000000001e-17Initial program 100.0%
Taylor expanded in x around 0 55.2%
Taylor expanded in y around inf 50.1%
if -1.6000000000000001e-17 < y < -2.9e-285 or 8.39999999999999991e-268 < y < 6.1000000000000001e-238 or 1.34999999999999995e-132 < y < 1.59999999999999991e-19Initial program 100.0%
Taylor expanded in x around 0 60.0%
Taylor expanded in y around 0 52.4%
associate-*r*52.4%
mul-1-neg52.4%
Simplified52.4%
if -2.9e-285 < y < 8.39999999999999991e-268 or 1.59999999999999991e-19 < y < 4.7000000000000003e63Initial program 100.0%
Taylor expanded in z around inf 58.1%
mul-1-neg58.1%
distribute-lft-neg-out58.1%
*-commutative58.1%
Simplified58.1%
Taylor expanded in t around 0 47.3%
if 6.1000000000000001e-238 < y < 1.34999999999999995e-132Initial program 100.0%
Taylor expanded in z around 0 48.7%
Taylor expanded in y around 0 48.5%
if 4.7000000000000003e63 < y Initial program 100.0%
Taylor expanded in y around inf 78.5%
Taylor expanded in t around 0 49.6%
mul-1-neg49.6%
distribute-rgt-neg-out49.6%
Simplified49.6%
Final simplification50.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))) (t_2 (+ x (* y t))) (t_3 (* x (- 1.0 y))))
(if (<= z -4.3e-13)
t_1
(if (<= z -7.5e-75)
t_3
(if (<= z -2.8e-128)
(* (- y z) t)
(if (<= z -4.2e-228)
t_2
(if (<= z -5e-290) t_3 (if (<= z 1600000000.0) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = x + (y * t);
double t_3 = x * (1.0 - y);
double tmp;
if (z <= -4.3e-13) {
tmp = t_1;
} else if (z <= -7.5e-75) {
tmp = t_3;
} else if (z <= -2.8e-128) {
tmp = (y - z) * t;
} else if (z <= -4.2e-228) {
tmp = t_2;
} else if (z <= -5e-290) {
tmp = t_3;
} else if (z <= 1600000000.0) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = z * (x - t)
t_2 = x + (y * t)
t_3 = x * (1.0d0 - y)
if (z <= (-4.3d-13)) then
tmp = t_1
else if (z <= (-7.5d-75)) then
tmp = t_3
else if (z <= (-2.8d-128)) then
tmp = (y - z) * t
else if (z <= (-4.2d-228)) then
tmp = t_2
else if (z <= (-5d-290)) then
tmp = t_3
else if (z <= 1600000000.0d0) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = x + (y * t);
double t_3 = x * (1.0 - y);
double tmp;
if (z <= -4.3e-13) {
tmp = t_1;
} else if (z <= -7.5e-75) {
tmp = t_3;
} else if (z <= -2.8e-128) {
tmp = (y - z) * t;
} else if (z <= -4.2e-228) {
tmp = t_2;
} else if (z <= -5e-290) {
tmp = t_3;
} else if (z <= 1600000000.0) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) t_2 = x + (y * t) t_3 = x * (1.0 - y) tmp = 0 if z <= -4.3e-13: tmp = t_1 elif z <= -7.5e-75: tmp = t_3 elif z <= -2.8e-128: tmp = (y - z) * t elif z <= -4.2e-228: tmp = t_2 elif z <= -5e-290: tmp = t_3 elif z <= 1600000000.0: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) t_2 = Float64(x + Float64(y * t)) t_3 = Float64(x * Float64(1.0 - y)) tmp = 0.0 if (z <= -4.3e-13) tmp = t_1; elseif (z <= -7.5e-75) tmp = t_3; elseif (z <= -2.8e-128) tmp = Float64(Float64(y - z) * t); elseif (z <= -4.2e-228) tmp = t_2; elseif (z <= -5e-290) tmp = t_3; elseif (z <= 1600000000.0) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); t_2 = x + (y * t); t_3 = x * (1.0 - y); tmp = 0.0; if (z <= -4.3e-13) tmp = t_1; elseif (z <= -7.5e-75) tmp = t_3; elseif (z <= -2.8e-128) tmp = (y - z) * t; elseif (z <= -4.2e-228) tmp = t_2; elseif (z <= -5e-290) tmp = t_3; elseif (z <= 1600000000.0) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.3e-13], t$95$1, If[LessEqual[z, -7.5e-75], t$95$3, If[LessEqual[z, -2.8e-128], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, -4.2e-228], t$95$2, If[LessEqual[z, -5e-290], t$95$3, If[LessEqual[z, 1600000000.0], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
t_2 := x + y \cdot t\\
t_3 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -4.3 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-75}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-128}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-228}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-290}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 1600000000:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.2999999999999999e-13 or 1.6e9 < z Initial program 100.0%
Taylor expanded in y around 0 82.8%
+-commutative82.8%
mul-1-neg82.8%
unsub-neg82.8%
*-commutative82.8%
Simplified82.8%
Taylor expanded in z around inf 82.6%
if -4.2999999999999999e-13 < z < -7.50000000000000017e-75 or -4.19999999999999982e-228 < z < -5.0000000000000001e-290Initial program 99.9%
Taylor expanded in z around 0 96.5%
Taylor expanded in t around 0 84.0%
*-lft-identity84.0%
associate-*r*84.0%
distribute-rgt-in84.0%
mul-1-neg84.0%
unsub-neg84.0%
Simplified84.0%
if -7.50000000000000017e-75 < z < -2.7999999999999998e-128Initial program 100.0%
Taylor expanded in x around 0 78.1%
if -2.7999999999999998e-128 < z < -4.19999999999999982e-228 or -5.0000000000000001e-290 < z < 1.6e9Initial program 100.0%
Taylor expanded in x around -inf 98.8%
+-commutative98.8%
mul-1-neg98.8%
unsub-neg98.8%
*-commutative98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in z around 0 89.4%
Taylor expanded in y around 0 72.1%
neg-mul-172.1%
Simplified72.1%
Final simplification79.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))) (t_2 (* y (- t x))))
(if (<= y -5.6e-7)
t_2
(if (<= y 5.4e-290)
(- x (* z t))
(if (<= y 4.1e-241)
t_1
(if (<= y 3.2e-122) (+ x (* z x)) (if (<= y 6e-11) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = y * (t - x);
double tmp;
if (y <= -5.6e-7) {
tmp = t_2;
} else if (y <= 5.4e-290) {
tmp = x - (z * t);
} else if (y <= 4.1e-241) {
tmp = t_1;
} else if (y <= 3.2e-122) {
tmp = x + (z * x);
} else if (y <= 6e-11) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = z * (x - t)
t_2 = y * (t - x)
if (y <= (-5.6d-7)) then
tmp = t_2
else if (y <= 5.4d-290) then
tmp = x - (z * t)
else if (y <= 4.1d-241) then
tmp = t_1
else if (y <= 3.2d-122) then
tmp = x + (z * x)
else if (y <= 6d-11) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = y * (t - x);
double tmp;
if (y <= -5.6e-7) {
tmp = t_2;
} else if (y <= 5.4e-290) {
tmp = x - (z * t);
} else if (y <= 4.1e-241) {
tmp = t_1;
} else if (y <= 3.2e-122) {
tmp = x + (z * x);
} else if (y <= 6e-11) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) t_2 = y * (t - x) tmp = 0 if y <= -5.6e-7: tmp = t_2 elif y <= 5.4e-290: tmp = x - (z * t) elif y <= 4.1e-241: tmp = t_1 elif y <= 3.2e-122: tmp = x + (z * x) elif y <= 6e-11: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) t_2 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -5.6e-7) tmp = t_2; elseif (y <= 5.4e-290) tmp = Float64(x - Float64(z * t)); elseif (y <= 4.1e-241) tmp = t_1; elseif (y <= 3.2e-122) tmp = Float64(x + Float64(z * x)); elseif (y <= 6e-11) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); t_2 = y * (t - x); tmp = 0.0; if (y <= -5.6e-7) tmp = t_2; elseif (y <= 5.4e-290) tmp = x - (z * t); elseif (y <= 4.1e-241) tmp = t_1; elseif (y <= 3.2e-122) tmp = x + (z * x); elseif (y <= 6e-11) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.6e-7], t$95$2, If[LessEqual[y, 5.4e-290], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e-241], t$95$1, If[LessEqual[y, 3.2e-122], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e-11], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
t_2 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -5.6 \cdot 10^{-7}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-290}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-241}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-122}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -5.60000000000000038e-7 or 6e-11 < y Initial program 100.0%
Taylor expanded in y around inf 75.9%
if -5.60000000000000038e-7 < y < 5.39999999999999997e-290Initial program 100.0%
Taylor expanded in y around 0 91.0%
+-commutative91.0%
mul-1-neg91.0%
unsub-neg91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in t around inf 74.9%
if 5.39999999999999997e-290 < y < 4.0999999999999999e-241 or 3.2000000000000002e-122 < y < 6e-11Initial program 100.0%
Taylor expanded in y around 0 94.3%
+-commutative94.3%
mul-1-neg94.3%
unsub-neg94.3%
*-commutative94.3%
Simplified94.3%
Taylor expanded in z around inf 88.8%
if 4.0999999999999999e-241 < y < 3.2000000000000002e-122Initial program 100.0%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 76.4%
sub-neg76.4%
neg-mul-176.4%
remove-double-neg76.4%
*-commutative76.4%
distribute-lft-in76.5%
*-rgt-identity76.5%
Simplified76.5%
Final simplification77.4%
(FPCore (x y z t)
:precision binary64
(if (<= z -5e+76)
(* z x)
(if (<= z -2.4e+39)
(* y t)
(if (<= z -5.5)
(* z x)
(if (<= z -6.4e-75) x (if (<= z 3400000000.0) (* y t) (* z x)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5e+76) {
tmp = z * x;
} else if (z <= -2.4e+39) {
tmp = y * t;
} else if (z <= -5.5) {
tmp = z * x;
} else if (z <= -6.4e-75) {
tmp = x;
} else if (z <= 3400000000.0) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-5d+76)) then
tmp = z * x
else if (z <= (-2.4d+39)) then
tmp = y * t
else if (z <= (-5.5d0)) then
tmp = z * x
else if (z <= (-6.4d-75)) then
tmp = x
else if (z <= 3400000000.0d0) then
tmp = y * t
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5e+76) {
tmp = z * x;
} else if (z <= -2.4e+39) {
tmp = y * t;
} else if (z <= -5.5) {
tmp = z * x;
} else if (z <= -6.4e-75) {
tmp = x;
} else if (z <= 3400000000.0) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5e+76: tmp = z * x elif z <= -2.4e+39: tmp = y * t elif z <= -5.5: tmp = z * x elif z <= -6.4e-75: tmp = x elif z <= 3400000000.0: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5e+76) tmp = Float64(z * x); elseif (z <= -2.4e+39) tmp = Float64(y * t); elseif (z <= -5.5) tmp = Float64(z * x); elseif (z <= -6.4e-75) tmp = x; elseif (z <= 3400000000.0) tmp = Float64(y * t); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5e+76) tmp = z * x; elseif (z <= -2.4e+39) tmp = y * t; elseif (z <= -5.5) tmp = z * x; elseif (z <= -6.4e-75) tmp = x; elseif (z <= 3400000000.0) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5e+76], N[(z * x), $MachinePrecision], If[LessEqual[z, -2.4e+39], N[(y * t), $MachinePrecision], If[LessEqual[z, -5.5], N[(z * x), $MachinePrecision], If[LessEqual[z, -6.4e-75], x, If[LessEqual[z, 3400000000.0], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+76}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{+39}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq -5.5:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -6.4 \cdot 10^{-75}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3400000000:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -4.99999999999999991e76 or -2.4000000000000001e39 < z < -5.5 or 3.4e9 < z Initial program 100.0%
Taylor expanded in z around inf 88.0%
mul-1-neg88.0%
distribute-lft-neg-out88.0%
*-commutative88.0%
Simplified88.0%
Taylor expanded in t around 0 44.9%
if -4.99999999999999991e76 < z < -2.4000000000000001e39 or -6.39999999999999953e-75 < z < 3.4e9Initial program 100.0%
Taylor expanded in x around 0 52.0%
Taylor expanded in y around inf 43.5%
if -5.5 < z < -6.39999999999999953e-75Initial program 100.0%
Taylor expanded in z around 0 84.4%
Taylor expanded in y around 0 34.9%
Final simplification43.5%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.6e+75)
(* z x)
(if (<= z -3.1e+34)
(* y t)
(if (<= z -175.0)
(* z x)
(if (<= z -8.8e-75)
(* y (- x))
(if (<= z 750000000.0) (* y t) (* z x)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.6e+75) {
tmp = z * x;
} else if (z <= -3.1e+34) {
tmp = y * t;
} else if (z <= -175.0) {
tmp = z * x;
} else if (z <= -8.8e-75) {
tmp = y * -x;
} else if (z <= 750000000.0) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.6d+75)) then
tmp = z * x
else if (z <= (-3.1d+34)) then
tmp = y * t
else if (z <= (-175.0d0)) then
tmp = z * x
else if (z <= (-8.8d-75)) then
tmp = y * -x
else if (z <= 750000000.0d0) then
tmp = y * t
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.6e+75) {
tmp = z * x;
} else if (z <= -3.1e+34) {
tmp = y * t;
} else if (z <= -175.0) {
tmp = z * x;
} else if (z <= -8.8e-75) {
tmp = y * -x;
} else if (z <= 750000000.0) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.6e+75: tmp = z * x elif z <= -3.1e+34: tmp = y * t elif z <= -175.0: tmp = z * x elif z <= -8.8e-75: tmp = y * -x elif z <= 750000000.0: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.6e+75) tmp = Float64(z * x); elseif (z <= -3.1e+34) tmp = Float64(y * t); elseif (z <= -175.0) tmp = Float64(z * x); elseif (z <= -8.8e-75) tmp = Float64(y * Float64(-x)); elseif (z <= 750000000.0) tmp = Float64(y * t); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.6e+75) tmp = z * x; elseif (z <= -3.1e+34) tmp = y * t; elseif (z <= -175.0) tmp = z * x; elseif (z <= -8.8e-75) tmp = y * -x; elseif (z <= 750000000.0) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.6e+75], N[(z * x), $MachinePrecision], If[LessEqual[z, -3.1e+34], N[(y * t), $MachinePrecision], If[LessEqual[z, -175.0], N[(z * x), $MachinePrecision], If[LessEqual[z, -8.8e-75], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 750000000.0], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+75}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{+34}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq -175:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -8.8 \cdot 10^{-75}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 750000000:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -1.59999999999999992e75 or -3.09999999999999977e34 < z < -175 or 7.5e8 < z Initial program 100.0%
Taylor expanded in z around inf 88.0%
mul-1-neg88.0%
distribute-lft-neg-out88.0%
*-commutative88.0%
Simplified88.0%
Taylor expanded in t around 0 44.9%
if -1.59999999999999992e75 < z < -3.09999999999999977e34 or -8.80000000000000022e-75 < z < 7.5e8Initial program 100.0%
Taylor expanded in x around 0 52.0%
Taylor expanded in y around inf 43.5%
if -175 < z < -8.80000000000000022e-75Initial program 100.0%
Taylor expanded in y around inf 50.1%
Taylor expanded in t around 0 36.3%
mul-1-neg36.3%
distribute-rgt-neg-out36.3%
Simplified36.3%
Final simplification43.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (* z (- x t))))
(if (<= y -1.02e+27)
t_1
(if (<= y 4.5e-238)
t_2
(if (<= y 3.5e-124) (+ x (* z x)) (if (<= y 7.8e-11) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = z * (x - t);
double tmp;
if (y <= -1.02e+27) {
tmp = t_1;
} else if (y <= 4.5e-238) {
tmp = t_2;
} else if (y <= 3.5e-124) {
tmp = x + (z * x);
} else if (y <= 7.8e-11) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y * (t - x)
t_2 = z * (x - t)
if (y <= (-1.02d+27)) then
tmp = t_1
else if (y <= 4.5d-238) then
tmp = t_2
else if (y <= 3.5d-124) then
tmp = x + (z * x)
else if (y <= 7.8d-11) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = z * (x - t);
double tmp;
if (y <= -1.02e+27) {
tmp = t_1;
} else if (y <= 4.5e-238) {
tmp = t_2;
} else if (y <= 3.5e-124) {
tmp = x + (z * x);
} else if (y <= 7.8e-11) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = z * (x - t) tmp = 0 if y <= -1.02e+27: tmp = t_1 elif y <= 4.5e-238: tmp = t_2 elif y <= 3.5e-124: tmp = x + (z * x) elif y <= 7.8e-11: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(z * Float64(x - t)) tmp = 0.0 if (y <= -1.02e+27) tmp = t_1; elseif (y <= 4.5e-238) tmp = t_2; elseif (y <= 3.5e-124) tmp = Float64(x + Float64(z * x)); elseif (y <= 7.8e-11) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); t_2 = z * (x - t); tmp = 0.0; if (y <= -1.02e+27) tmp = t_1; elseif (y <= 4.5e-238) tmp = t_2; elseif (y <= 3.5e-124) tmp = x + (z * x); elseif (y <= 7.8e-11) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.02e+27], t$95$1, If[LessEqual[y, 4.5e-238], t$95$2, If[LessEqual[y, 3.5e-124], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e-11], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := z \cdot \left(x - t\right)\\
\mathbf{if}\;y \leq -1.02 \cdot 10^{+27}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-238}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-124}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{-11}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.0199999999999999e27 or 7.80000000000000021e-11 < y Initial program 100.0%
Taylor expanded in y around inf 79.0%
if -1.0199999999999999e27 < y < 4.49999999999999996e-238 or 3.4999999999999999e-124 < y < 7.80000000000000021e-11Initial program 100.0%
Taylor expanded in y around 0 89.8%
+-commutative89.8%
mul-1-neg89.8%
unsub-neg89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in z around inf 67.2%
if 4.49999999999999996e-238 < y < 3.4999999999999999e-124Initial program 100.0%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 78.7%
sub-neg78.7%
neg-mul-178.7%
remove-double-neg78.7%
*-commutative78.7%
distribute-lft-in78.7%
*-rgt-identity78.7%
Simplified78.7%
Final simplification73.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.8e-12) (not (<= z 20000000.0))) (* z (- x t)) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.8e-12) || !(z <= 20000000.0)) {
tmp = z * (x - t);
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3.8d-12)) .or. (.not. (z <= 20000000.0d0))) then
tmp = z * (x - t)
else
tmp = x + (y * (t - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.8e-12) || !(z <= 20000000.0)) {
tmp = z * (x - t);
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.8e-12) or not (z <= 20000000.0): tmp = z * (x - t) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.8e-12) || !(z <= 20000000.0)) tmp = Float64(z * Float64(x - t)); else tmp = Float64(x + Float64(y * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.8e-12) || ~((z <= 20000000.0))) tmp = z * (x - t); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.8e-12], N[Not[LessEqual[z, 20000000.0]], $MachinePrecision]], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{-12} \lor \neg \left(z \leq 20000000\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -3.79999999999999996e-12 or 2e7 < z Initial program 100.0%
Taylor expanded in y around 0 83.4%
+-commutative83.4%
mul-1-neg83.4%
unsub-neg83.4%
*-commutative83.4%
Simplified83.4%
Taylor expanded in z around inf 83.2%
if -3.79999999999999996e-12 < z < 2e7Initial program 100.0%
Taylor expanded in z around 0 91.1%
Final simplification87.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -9.5e-17) (not (<= y 3.1e-11))) (+ x (* y (- t x))) (+ x (* z (- x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9.5e-17) || !(y <= 3.1e-11)) {
tmp = x + (y * (t - x));
} else {
tmp = x + (z * (x - t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-9.5d-17)) .or. (.not. (y <= 3.1d-11))) then
tmp = x + (y * (t - x))
else
tmp = x + (z * (x - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9.5e-17) || !(y <= 3.1e-11)) {
tmp = x + (y * (t - x));
} else {
tmp = x + (z * (x - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -9.5e-17) or not (y <= 3.1e-11): tmp = x + (y * (t - x)) else: tmp = x + (z * (x - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -9.5e-17) || !(y <= 3.1e-11)) tmp = Float64(x + Float64(y * Float64(t - x))); else tmp = Float64(x + Float64(z * Float64(x - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -9.5e-17) || ~((y <= 3.1e-11))) tmp = x + (y * (t - x)); else tmp = x + (z * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -9.5e-17], N[Not[LessEqual[y, 3.1e-11]], $MachinePrecision]], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{-17} \lor \neg \left(y \leq 3.1 \cdot 10^{-11}\right):\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\end{array}
\end{array}
if y < -9.50000000000000029e-17 or 3.10000000000000028e-11 < y Initial program 100.0%
Taylor expanded in z around 0 79.7%
if -9.50000000000000029e-17 < y < 3.10000000000000028e-11Initial program 100.0%
Taylor expanded in y around 0 94.8%
+-commutative94.8%
mul-1-neg94.8%
unsub-neg94.8%
*-commutative94.8%
Simplified94.8%
Final simplification87.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.3e-103) (not (<= t 2.05e+15))) (* (- y z) t) (* x (- 1.0 y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.3e-103) || !(t <= 2.05e+15)) {
tmp = (y - z) * t;
} else {
tmp = x * (1.0 - y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-4.3d-103)) .or. (.not. (t <= 2.05d+15))) then
tmp = (y - z) * t
else
tmp = x * (1.0d0 - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.3e-103) || !(t <= 2.05e+15)) {
tmp = (y - z) * t;
} else {
tmp = x * (1.0 - y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.3e-103) or not (t <= 2.05e+15): tmp = (y - z) * t else: tmp = x * (1.0 - y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.3e-103) || !(t <= 2.05e+15)) tmp = Float64(Float64(y - z) * t); else tmp = Float64(x * Float64(1.0 - y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.3e-103) || ~((t <= 2.05e+15))) tmp = (y - z) * t; else tmp = x * (1.0 - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.3e-103], N[Not[LessEqual[t, 2.05e+15]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{-103} \lor \neg \left(t \leq 2.05 \cdot 10^{+15}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\end{array}
\end{array}
if t < -4.30000000000000023e-103 or 2.05e15 < t Initial program 100.0%
Taylor expanded in x around 0 67.9%
if -4.30000000000000023e-103 < t < 2.05e15Initial program 100.0%
Taylor expanded in z around 0 58.3%
Taylor expanded in t around 0 54.2%
*-lft-identity54.2%
associate-*r*54.2%
distribute-rgt-in54.2%
mul-1-neg54.2%
unsub-neg54.2%
Simplified54.2%
Final simplification62.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -8.5e+24) (not (<= y 7.8e-11))) (* y (- t x)) (* z (- x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8.5e+24) || !(y <= 7.8e-11)) {
tmp = y * (t - x);
} else {
tmp = z * (x - t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-8.5d+24)) .or. (.not. (y <= 7.8d-11))) then
tmp = y * (t - x)
else
tmp = z * (x - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8.5e+24) || !(y <= 7.8e-11)) {
tmp = y * (t - x);
} else {
tmp = z * (x - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -8.5e+24) or not (y <= 7.8e-11): tmp = y * (t - x) else: tmp = z * (x - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -8.5e+24) || !(y <= 7.8e-11)) tmp = Float64(y * Float64(t - x)); else tmp = Float64(z * Float64(x - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -8.5e+24) || ~((y <= 7.8e-11))) tmp = y * (t - x); else tmp = z * (x - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -8.5e+24], N[Not[LessEqual[y, 7.8e-11]], $MachinePrecision]], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{+24} \lor \neg \left(y \leq 7.8 \cdot 10^{-11}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\end{array}
\end{array}
if y < -8.49999999999999959e24 or 7.80000000000000021e-11 < y Initial program 100.0%
Taylor expanded in y around inf 79.0%
if -8.49999999999999959e24 < y < 7.80000000000000021e-11Initial program 100.0%
Taylor expanded in y around 0 91.4%
+-commutative91.4%
mul-1-neg91.4%
unsub-neg91.4%
*-commutative91.4%
Simplified91.4%
Taylor expanded in z around inf 65.0%
Final simplification71.3%
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (<= y -2.7e-55) (* y t) (if (<= y 2.4e-111) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.7e-55) {
tmp = y * t;
} else if (y <= 2.4e-111) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.7d-55)) then
tmp = y * t
else if (y <= 2.4d-111) then
tmp = x
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.7e-55) {
tmp = y * t;
} else if (y <= 2.4e-111) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.7e-55: tmp = y * t elif y <= 2.4e-111: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.7e-55) tmp = Float64(y * t); elseif (y <= 2.4e-111) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.7e-55) tmp = y * t; elseif (y <= 2.4e-111) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.7e-55], N[(y * t), $MachinePrecision], If[LessEqual[y, 2.4e-111], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-55}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-111}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -2.70000000000000004e-55 or 2.4000000000000001e-111 < y Initial program 100.0%
Taylor expanded in x around 0 54.2%
Taylor expanded in y around inf 38.3%
if -2.70000000000000004e-55 < y < 2.4000000000000001e-111Initial program 100.0%
Taylor expanded in z around 0 37.5%
Taylor expanded in y around 0 35.3%
Final simplification37.2%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 100.0%
Taylor expanded in z around 0 56.5%
Taylor expanded in y around 0 17.2%
Final simplification17.2%
(FPCore (x y z t) :precision binary64 (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((t * (y - z)) + (-x * (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
def code(x, y, z, t): return x + ((t * (y - z)) + (-x * (y - z)))
function code(x, y, z, t) return Float64(x + Float64(Float64(t * Float64(y - z)) + Float64(Float64(-x) * Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = x + ((t * (y - z)) + (-x * (y - z))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] + N[((-x) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)
\end{array}
herbie shell --seed 2023171
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:herbie-target
(+ x (+ (* t (- y z)) (* (- x) (- y z))))
(+ x (* (- y z) (- t x))))