
(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-define100.0%
Simplified100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) t)) (t_2 (* y (- t x))) (t_3 (* x (+ z 1.0))))
(if (<= y -1.55e-20)
t_2
(if (<= y -2.75e-198)
t_3
(if (<= y -9.6e-288)
t_1
(if (<= y 1.65e-139)
t_3
(if (<= y 6.6e-105) t_1 (if (<= y 1.65e+14) t_3 t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double t_2 = y * (t - x);
double t_3 = x * (z + 1.0);
double tmp;
if (y <= -1.55e-20) {
tmp = t_2;
} else if (y <= -2.75e-198) {
tmp = t_3;
} else if (y <= -9.6e-288) {
tmp = t_1;
} else if (y <= 1.65e-139) {
tmp = t_3;
} else if (y <= 6.6e-105) {
tmp = t_1;
} else if (y <= 1.65e+14) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_1 = (y - z) * t
t_2 = y * (t - x)
t_3 = x * (z + 1.0d0)
if (y <= (-1.55d-20)) then
tmp = t_2
else if (y <= (-2.75d-198)) then
tmp = t_3
else if (y <= (-9.6d-288)) then
tmp = t_1
else if (y <= 1.65d-139) then
tmp = t_3
else if (y <= 6.6d-105) then
tmp = t_1
else if (y <= 1.65d+14) then
tmp = t_3
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 = (y - z) * t;
double t_2 = y * (t - x);
double t_3 = x * (z + 1.0);
double tmp;
if (y <= -1.55e-20) {
tmp = t_2;
} else if (y <= -2.75e-198) {
tmp = t_3;
} else if (y <= -9.6e-288) {
tmp = t_1;
} else if (y <= 1.65e-139) {
tmp = t_3;
} else if (y <= 6.6e-105) {
tmp = t_1;
} else if (y <= 1.65e+14) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t t_2 = y * (t - x) t_3 = x * (z + 1.0) tmp = 0 if y <= -1.55e-20: tmp = t_2 elif y <= -2.75e-198: tmp = t_3 elif y <= -9.6e-288: tmp = t_1 elif y <= 1.65e-139: tmp = t_3 elif y <= 6.6e-105: tmp = t_1 elif y <= 1.65e+14: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) t_2 = Float64(y * Float64(t - x)) t_3 = Float64(x * Float64(z + 1.0)) tmp = 0.0 if (y <= -1.55e-20) tmp = t_2; elseif (y <= -2.75e-198) tmp = t_3; elseif (y <= -9.6e-288) tmp = t_1; elseif (y <= 1.65e-139) tmp = t_3; elseif (y <= 6.6e-105) tmp = t_1; elseif (y <= 1.65e+14) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * t; t_2 = y * (t - x); t_3 = x * (z + 1.0); tmp = 0.0; if (y <= -1.55e-20) tmp = t_2; elseif (y <= -2.75e-198) tmp = t_3; elseif (y <= -9.6e-288) tmp = t_1; elseif (y <= 1.65e-139) tmp = t_3; elseif (y <= 6.6e-105) tmp = t_1; elseif (y <= 1.65e+14) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.55e-20], t$95$2, If[LessEqual[y, -2.75e-198], t$95$3, If[LessEqual[y, -9.6e-288], t$95$1, If[LessEqual[y, 1.65e-139], t$95$3, If[LessEqual[y, 6.6e-105], t$95$1, If[LessEqual[y, 1.65e+14], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
t_2 := y \cdot \left(t - x\right)\\
t_3 := x \cdot \left(z + 1\right)\\
\mathbf{if}\;y \leq -1.55 \cdot 10^{-20}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -2.75 \cdot 10^{-198}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq -9.6 \cdot 10^{-288}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-139}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{-105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+14}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -1.55e-20 or 1.65e14 < y Initial program 100.0%
Taylor expanded in y around inf 83.9%
if -1.55e-20 < y < -2.75e-198 or -9.5999999999999994e-288 < y < 1.65e-139 or 6.5999999999999997e-105 < y < 1.65e14Initial program 100.0%
Taylor expanded in x around inf 66.9%
mul-1-neg66.9%
unsub-neg66.9%
Simplified66.9%
Taylor expanded in y around 0 66.5%
+-commutative66.5%
Simplified66.5%
if -2.75e-198 < y < -9.5999999999999994e-288 or 1.65e-139 < y < 6.5999999999999997e-105Initial program 100.0%
Taylor expanded in x around 0 80.5%
Final simplification76.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= y -7.5e+290)
(- (* y x))
(if (<= y -1.4e-110)
(* y t)
(if (<= y -6e-196)
x
(if (<= y 1.45e-213)
t_1
(if (<= y 9.5e-131) x (if (<= y 1.18e-29) t_1 (* y t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (y <= -7.5e+290) {
tmp = -(y * x);
} else if (y <= -1.4e-110) {
tmp = y * t;
} else if (y <= -6e-196) {
tmp = x;
} else if (y <= 1.45e-213) {
tmp = t_1;
} else if (y <= 9.5e-131) {
tmp = x;
} else if (y <= 1.18e-29) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = z * -t
if (y <= (-7.5d+290)) then
tmp = -(y * x)
else if (y <= (-1.4d-110)) then
tmp = y * t
else if (y <= (-6d-196)) then
tmp = x
else if (y <= 1.45d-213) then
tmp = t_1
else if (y <= 9.5d-131) then
tmp = x
else if (y <= 1.18d-29) then
tmp = t_1
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (y <= -7.5e+290) {
tmp = -(y * x);
} else if (y <= -1.4e-110) {
tmp = y * t;
} else if (y <= -6e-196) {
tmp = x;
} else if (y <= 1.45e-213) {
tmp = t_1;
} else if (y <= 9.5e-131) {
tmp = x;
} else if (y <= 1.18e-29) {
tmp = t_1;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if y <= -7.5e+290: tmp = -(y * x) elif y <= -1.4e-110: tmp = y * t elif y <= -6e-196: tmp = x elif y <= 1.45e-213: tmp = t_1 elif y <= 9.5e-131: tmp = x elif y <= 1.18e-29: tmp = t_1 else: tmp = y * t return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (y <= -7.5e+290) tmp = Float64(-Float64(y * x)); elseif (y <= -1.4e-110) tmp = Float64(y * t); elseif (y <= -6e-196) tmp = x; elseif (y <= 1.45e-213) tmp = t_1; elseif (y <= 9.5e-131) tmp = x; elseif (y <= 1.18e-29) tmp = t_1; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (y <= -7.5e+290) tmp = -(y * x); elseif (y <= -1.4e-110) tmp = y * t; elseif (y <= -6e-196) tmp = x; elseif (y <= 1.45e-213) tmp = t_1; elseif (y <= 9.5e-131) tmp = x; elseif (y <= 1.18e-29) tmp = t_1; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -7.5e+290], (-N[(y * x), $MachinePrecision]), If[LessEqual[y, -1.4e-110], N[(y * t), $MachinePrecision], If[LessEqual[y, -6e-196], x, If[LessEqual[y, 1.45e-213], t$95$1, If[LessEqual[y, 9.5e-131], x, If[LessEqual[y, 1.18e-29], t$95$1, N[(y * t), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{+290}:\\
\;\;\;\;-y \cdot x\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-110}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -6 \cdot 10^{-196}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{-213}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-131}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.18 \cdot 10^{-29}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -7.50000000000000038e290Initial program 100.0%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
Simplified100.0%
if -7.50000000000000038e290 < y < -1.4e-110 or 1.17999999999999996e-29 < y Initial program 100.0%
Taylor expanded in x around 0 63.4%
Taylor expanded in y around inf 52.3%
*-commutative52.3%
Simplified52.3%
if -1.4e-110 < y < -6e-196 or 1.45e-213 < y < 9.4999999999999996e-131Initial program 100.0%
Taylor expanded in y around 0 93.4%
mul-1-neg93.4%
unsub-neg93.4%
Simplified93.4%
Taylor expanded in z around 0 59.1%
if -6e-196 < y < 1.45e-213 or 9.4999999999999996e-131 < y < 1.17999999999999996e-29Initial program 100.0%
Taylor expanded in x around 0 54.7%
Taylor expanded in y around 0 52.2%
associate-*r*52.2%
neg-mul-152.2%
*-commutative52.2%
Simplified52.2%
Final simplification54.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))) (t_2 (* y (- t x))))
(if (<= y -1.95e-20)
t_2
(if (<= y -1.65e-197)
(* x (+ z 1.0))
(if (<= y 1.25e-213)
t_1
(if (<= y 3.2e-149) (+ x (* z x)) (if (<= y 3.9e+14) 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 <= -1.95e-20) {
tmp = t_2;
} else if (y <= -1.65e-197) {
tmp = x * (z + 1.0);
} else if (y <= 1.25e-213) {
tmp = t_1;
} else if (y <= 3.2e-149) {
tmp = x + (z * x);
} else if (y <= 3.9e+14) {
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 <= (-1.95d-20)) then
tmp = t_2
else if (y <= (-1.65d-197)) then
tmp = x * (z + 1.0d0)
else if (y <= 1.25d-213) then
tmp = t_1
else if (y <= 3.2d-149) then
tmp = x + (z * x)
else if (y <= 3.9d+14) 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 <= -1.95e-20) {
tmp = t_2;
} else if (y <= -1.65e-197) {
tmp = x * (z + 1.0);
} else if (y <= 1.25e-213) {
tmp = t_1;
} else if (y <= 3.2e-149) {
tmp = x + (z * x);
} else if (y <= 3.9e+14) {
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 <= -1.95e-20: tmp = t_2 elif y <= -1.65e-197: tmp = x * (z + 1.0) elif y <= 1.25e-213: tmp = t_1 elif y <= 3.2e-149: tmp = x + (z * x) elif y <= 3.9e+14: 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 <= -1.95e-20) tmp = t_2; elseif (y <= -1.65e-197) tmp = Float64(x * Float64(z + 1.0)); elseif (y <= 1.25e-213) tmp = t_1; elseif (y <= 3.2e-149) tmp = Float64(x + Float64(z * x)); elseif (y <= 3.9e+14) 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 <= -1.95e-20) tmp = t_2; elseif (y <= -1.65e-197) tmp = x * (z + 1.0); elseif (y <= 1.25e-213) tmp = t_1; elseif (y <= 3.2e-149) tmp = x + (z * x); elseif (y <= 3.9e+14) 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, -1.95e-20], t$95$2, If[LessEqual[y, -1.65e-197], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e-213], t$95$1, If[LessEqual[y, 3.2e-149], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e+14], 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 -1.95 \cdot 10^{-20}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.65 \cdot 10^{-197}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-213}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-149}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -1.95000000000000004e-20 or 3.9e14 < y Initial program 100.0%
Taylor expanded in y around inf 83.9%
if -1.95000000000000004e-20 < y < -1.6499999999999999e-197Initial program 100.0%
Taylor expanded in x around inf 68.6%
mul-1-neg68.6%
unsub-neg68.6%
Simplified68.6%
Taylor expanded in y around 0 68.6%
+-commutative68.6%
Simplified68.6%
if -1.6499999999999999e-197 < y < 1.24999999999999994e-213 or 3.20000000000000002e-149 < y < 3.9e14Initial program 100.0%
Taylor expanded in z around inf 67.3%
mul-1-neg67.3%
distribute-rgt-neg-in67.3%
neg-sub067.3%
sub-neg67.3%
+-commutative67.3%
associate--r+67.3%
neg-sub067.3%
remove-double-neg67.3%
Simplified67.3%
if 1.24999999999999994e-213 < y < 3.20000000000000002e-149Initial program 99.9%
Taylor expanded in x around inf 68.4%
mul-1-neg68.4%
unsub-neg68.4%
Simplified68.4%
Taylor expanded in y around 0 68.4%
+-commutative68.4%
Simplified68.4%
distribute-rgt-in68.4%
*-un-lft-identity68.4%
Applied egg-rr68.4%
Final simplification76.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))) (t_2 (* y (- t x))) (t_3 (* x (+ z 1.0))))
(if (<= y -1.5e-20)
t_2
(if (<= y -4e-199)
t_3
(if (<= y 1.4e-213)
t_1
(if (<= y 7.1e-152) t_3 (if (<= y 4.1e+15) 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 t_3 = x * (z + 1.0);
double tmp;
if (y <= -1.5e-20) {
tmp = t_2;
} else if (y <= -4e-199) {
tmp = t_3;
} else if (y <= 1.4e-213) {
tmp = t_1;
} else if (y <= 7.1e-152) {
tmp = t_3;
} else if (y <= 4.1e+15) {
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) :: t_3
real(8) :: tmp
t_1 = z * (x - t)
t_2 = y * (t - x)
t_3 = x * (z + 1.0d0)
if (y <= (-1.5d-20)) then
tmp = t_2
else if (y <= (-4d-199)) then
tmp = t_3
else if (y <= 1.4d-213) then
tmp = t_1
else if (y <= 7.1d-152) then
tmp = t_3
else if (y <= 4.1d+15) 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 t_3 = x * (z + 1.0);
double tmp;
if (y <= -1.5e-20) {
tmp = t_2;
} else if (y <= -4e-199) {
tmp = t_3;
} else if (y <= 1.4e-213) {
tmp = t_1;
} else if (y <= 7.1e-152) {
tmp = t_3;
} else if (y <= 4.1e+15) {
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) t_3 = x * (z + 1.0) tmp = 0 if y <= -1.5e-20: tmp = t_2 elif y <= -4e-199: tmp = t_3 elif y <= 1.4e-213: tmp = t_1 elif y <= 7.1e-152: tmp = t_3 elif y <= 4.1e+15: 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)) t_3 = Float64(x * Float64(z + 1.0)) tmp = 0.0 if (y <= -1.5e-20) tmp = t_2; elseif (y <= -4e-199) tmp = t_3; elseif (y <= 1.4e-213) tmp = t_1; elseif (y <= 7.1e-152) tmp = t_3; elseif (y <= 4.1e+15) 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); t_3 = x * (z + 1.0); tmp = 0.0; if (y <= -1.5e-20) tmp = t_2; elseif (y <= -4e-199) tmp = t_3; elseif (y <= 1.4e-213) tmp = t_1; elseif (y <= 7.1e-152) tmp = t_3; elseif (y <= 4.1e+15) 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]}, Block[{t$95$3 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.5e-20], t$95$2, If[LessEqual[y, -4e-199], t$95$3, If[LessEqual[y, 1.4e-213], t$95$1, If[LessEqual[y, 7.1e-152], t$95$3, If[LessEqual[y, 4.1e+15], 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)\\
t_3 := x \cdot \left(z + 1\right)\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{-20}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -4 \cdot 10^{-199}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-213}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.1 \cdot 10^{-152}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -1.50000000000000014e-20 or 4.1e15 < y Initial program 100.0%
Taylor expanded in y around inf 83.9%
if -1.50000000000000014e-20 < y < -3.99999999999999993e-199 or 1.4e-213 < y < 7.10000000000000011e-152Initial program 100.0%
Taylor expanded in x around inf 68.5%
mul-1-neg68.5%
unsub-neg68.5%
Simplified68.5%
Taylor expanded in y around 0 68.5%
+-commutative68.5%
Simplified68.5%
if -3.99999999999999993e-199 < y < 1.4e-213 or 7.10000000000000011e-152 < y < 4.1e15Initial program 100.0%
Taylor expanded in z around inf 67.3%
mul-1-neg67.3%
distribute-rgt-neg-in67.3%
neg-sub067.3%
sub-neg67.3%
+-commutative67.3%
associate--r+67.3%
neg-sub067.3%
remove-double-neg67.3%
Simplified67.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= y -3.6e-112)
(* y t)
(if (<= y -6.8e-194)
x
(if (<= y 1.8e-213)
t_1
(if (<= y 1.2e-131) x (if (<= y 4.4e-31) t_1 (* y t))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (y <= -3.6e-112) {
tmp = y * t;
} else if (y <= -6.8e-194) {
tmp = x;
} else if (y <= 1.8e-213) {
tmp = t_1;
} else if (y <= 1.2e-131) {
tmp = x;
} else if (y <= 4.4e-31) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = z * -t
if (y <= (-3.6d-112)) then
tmp = y * t
else if (y <= (-6.8d-194)) then
tmp = x
else if (y <= 1.8d-213) then
tmp = t_1
else if (y <= 1.2d-131) then
tmp = x
else if (y <= 4.4d-31) then
tmp = t_1
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (y <= -3.6e-112) {
tmp = y * t;
} else if (y <= -6.8e-194) {
tmp = x;
} else if (y <= 1.8e-213) {
tmp = t_1;
} else if (y <= 1.2e-131) {
tmp = x;
} else if (y <= 4.4e-31) {
tmp = t_1;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if y <= -3.6e-112: tmp = y * t elif y <= -6.8e-194: tmp = x elif y <= 1.8e-213: tmp = t_1 elif y <= 1.2e-131: tmp = x elif y <= 4.4e-31: tmp = t_1 else: tmp = y * t return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (y <= -3.6e-112) tmp = Float64(y * t); elseif (y <= -6.8e-194) tmp = x; elseif (y <= 1.8e-213) tmp = t_1; elseif (y <= 1.2e-131) tmp = x; elseif (y <= 4.4e-31) tmp = t_1; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (y <= -3.6e-112) tmp = y * t; elseif (y <= -6.8e-194) tmp = x; elseif (y <= 1.8e-213) tmp = t_1; elseif (y <= 1.2e-131) tmp = x; elseif (y <= 4.4e-31) tmp = t_1; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -3.6e-112], N[(y * t), $MachinePrecision], If[LessEqual[y, -6.8e-194], x, If[LessEqual[y, 1.8e-213], t$95$1, If[LessEqual[y, 1.2e-131], x, If[LessEqual[y, 4.4e-31], t$95$1, N[(y * t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{-112}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -6.8 \cdot 10^{-194}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-213}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-131}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -3.6000000000000001e-112 or 4.40000000000000019e-31 < y Initial program 100.0%
Taylor expanded in x around 0 61.5%
Taylor expanded in y around inf 50.7%
*-commutative50.7%
Simplified50.7%
if -3.6000000000000001e-112 < y < -6.80000000000000018e-194 or 1.8e-213 < y < 1.2e-131Initial program 100.0%
Taylor expanded in y around 0 93.4%
mul-1-neg93.4%
unsub-neg93.4%
Simplified93.4%
Taylor expanded in z around 0 59.1%
if -6.80000000000000018e-194 < y < 1.8e-213 or 1.2e-131 < y < 4.40000000000000019e-31Initial program 100.0%
Taylor expanded in x around 0 54.7%
Taylor expanded in y around 0 52.2%
associate-*r*52.2%
neg-mul-152.2%
*-commutative52.2%
Simplified52.2%
(FPCore (x y z t)
:precision binary64
(if (or (<= t -850000.0)
(not
(or (<= t -1.45e-32) (and (not (<= t -4.8e-139)) (<= t 6.4e+35)))))
(* (- y z) t)
(* x (+ (- z y) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -850000.0) || !((t <= -1.45e-32) || (!(t <= -4.8e-139) && (t <= 6.4e+35)))) {
tmp = (y - z) * t;
} else {
tmp = x * ((z - y) + 1.0);
}
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 <= (-850000.0d0)) .or. (.not. (t <= (-1.45d-32)) .or. (.not. (t <= (-4.8d-139))) .and. (t <= 6.4d+35))) then
tmp = (y - z) * t
else
tmp = x * ((z - y) + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -850000.0) || !((t <= -1.45e-32) || (!(t <= -4.8e-139) && (t <= 6.4e+35)))) {
tmp = (y - z) * t;
} else {
tmp = x * ((z - y) + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -850000.0) or not ((t <= -1.45e-32) or (not (t <= -4.8e-139) and (t <= 6.4e+35))): tmp = (y - z) * t else: tmp = x * ((z - y) + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -850000.0) || !((t <= -1.45e-32) || (!(t <= -4.8e-139) && (t <= 6.4e+35)))) tmp = Float64(Float64(y - z) * t); else tmp = Float64(x * Float64(Float64(z - y) + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -850000.0) || ~(((t <= -1.45e-32) || (~((t <= -4.8e-139)) && (t <= 6.4e+35))))) tmp = (y - z) * t; else tmp = x * ((z - y) + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -850000.0], N[Not[Or[LessEqual[t, -1.45e-32], And[N[Not[LessEqual[t, -4.8e-139]], $MachinePrecision], LessEqual[t, 6.4e+35]]]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -850000 \lor \neg \left(t \leq -1.45 \cdot 10^{-32} \lor \neg \left(t \leq -4.8 \cdot 10^{-139}\right) \land t \leq 6.4 \cdot 10^{+35}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\end{array}
\end{array}
if t < -8.5e5 or -1.44999999999999998e-32 < t < -4.80000000000000029e-139 or 6.39999999999999965e35 < t Initial program 100.0%
Taylor expanded in x around 0 82.3%
if -8.5e5 < t < -1.44999999999999998e-32 or -4.80000000000000029e-139 < t < 6.39999999999999965e35Initial program 100.0%
Taylor expanded in x around inf 80.2%
mul-1-neg80.2%
unsub-neg80.2%
Simplified80.2%
Final simplification81.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) t)))
(if (<= t -3700.0)
t_1
(if (<= t -2e-33)
(* x (- 1.0 y))
(if (or (<= t -8.4e-148) (not (<= t 2.25e-76))) t_1 (* x (+ z 1.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if (t <= -3700.0) {
tmp = t_1;
} else if (t <= -2e-33) {
tmp = x * (1.0 - y);
} else if ((t <= -8.4e-148) || !(t <= 2.25e-76)) {
tmp = t_1;
} else {
tmp = x * (z + 1.0);
}
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 (t <= (-3700.0d0)) then
tmp = t_1
else if (t <= (-2d-33)) then
tmp = x * (1.0d0 - y)
else if ((t <= (-8.4d-148)) .or. (.not. (t <= 2.25d-76))) then
tmp = t_1
else
tmp = x * (z + 1.0d0)
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 (t <= -3700.0) {
tmp = t_1;
} else if (t <= -2e-33) {
tmp = x * (1.0 - y);
} else if ((t <= -8.4e-148) || !(t <= 2.25e-76)) {
tmp = t_1;
} else {
tmp = x * (z + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if t <= -3700.0: tmp = t_1 elif t <= -2e-33: tmp = x * (1.0 - y) elif (t <= -8.4e-148) or not (t <= 2.25e-76): tmp = t_1 else: tmp = x * (z + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) tmp = 0.0 if (t <= -3700.0) tmp = t_1; elseif (t <= -2e-33) tmp = Float64(x * Float64(1.0 - y)); elseif ((t <= -8.4e-148) || !(t <= 2.25e-76)) tmp = t_1; else tmp = Float64(x * Float64(z + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * t; tmp = 0.0; if (t <= -3700.0) tmp = t_1; elseif (t <= -2e-33) tmp = x * (1.0 - y); elseif ((t <= -8.4e-148) || ~((t <= 2.25e-76))) tmp = t_1; else tmp = x * (z + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -3700.0], t$95$1, If[LessEqual[t, -2e-33], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -8.4e-148], N[Not[LessEqual[t, 2.25e-76]], $MachinePrecision]], t$95$1, N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -3700:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2 \cdot 10^{-33}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;t \leq -8.4 \cdot 10^{-148} \lor \neg \left(t \leq 2.25 \cdot 10^{-76}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\end{array}
\end{array}
if t < -3700 or -2.0000000000000001e-33 < t < -8.4000000000000001e-148 or 2.25e-76 < t Initial program 100.0%
Taylor expanded in x around 0 76.8%
if -3700 < t < -2.0000000000000001e-33Initial program 100.0%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 72.5%
if -8.4000000000000001e-148 < t < 2.25e-76Initial program 100.0%
Taylor expanded in x around inf 83.4%
mul-1-neg83.4%
unsub-neg83.4%
Simplified83.4%
Taylor expanded in y around 0 63.8%
+-commutative63.8%
Simplified63.8%
Final simplification72.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -4.2e-119)
(* y t)
(if (<= y -2.1e-306)
x
(if (<= y 1.9e-213) (* z x) (if (<= y 4.7e-29) x (* y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.2e-119) {
tmp = y * t;
} else if (y <= -2.1e-306) {
tmp = x;
} else if (y <= 1.9e-213) {
tmp = z * x;
} else if (y <= 4.7e-29) {
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 <= (-4.2d-119)) then
tmp = y * t
else if (y <= (-2.1d-306)) then
tmp = x
else if (y <= 1.9d-213) then
tmp = z * x
else if (y <= 4.7d-29) 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 <= -4.2e-119) {
tmp = y * t;
} else if (y <= -2.1e-306) {
tmp = x;
} else if (y <= 1.9e-213) {
tmp = z * x;
} else if (y <= 4.7e-29) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.2e-119: tmp = y * t elif y <= -2.1e-306: tmp = x elif y <= 1.9e-213: tmp = z * x elif y <= 4.7e-29: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.2e-119) tmp = Float64(y * t); elseif (y <= -2.1e-306) tmp = x; elseif (y <= 1.9e-213) tmp = Float64(z * x); elseif (y <= 4.7e-29) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.2e-119) tmp = y * t; elseif (y <= -2.1e-306) tmp = x; elseif (y <= 1.9e-213) tmp = z * x; elseif (y <= 4.7e-29) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.2e-119], N[(y * t), $MachinePrecision], If[LessEqual[y, -2.1e-306], x, If[LessEqual[y, 1.9e-213], N[(z * x), $MachinePrecision], If[LessEqual[y, 4.7e-29], x, N[(y * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{-119}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-306}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-213}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{-29}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -4.2e-119 or 4.6999999999999998e-29 < y Initial program 100.0%
Taylor expanded in x around 0 61.8%
Taylor expanded in y around inf 51.0%
*-commutative51.0%
Simplified51.0%
if -4.2e-119 < y < -2.1000000000000001e-306 or 1.9e-213 < y < 4.6999999999999998e-29Initial program 100.0%
Taylor expanded in y around 0 94.5%
mul-1-neg94.5%
unsub-neg94.5%
Simplified94.5%
Taylor expanded in z around 0 45.4%
if -2.1000000000000001e-306 < y < 1.9e-213Initial program 99.9%
Taylor expanded in z around inf 80.3%
mul-1-neg80.3%
distribute-rgt-neg-in80.3%
neg-sub080.3%
sub-neg80.3%
+-commutative80.3%
associate--r+80.3%
neg-sub080.3%
remove-double-neg80.3%
Simplified80.3%
Taylor expanded in x around inf 42.5%
Final simplification48.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -7.8e-42)
t_1
(if (<= y 5.8e-105)
(- x (* z t))
(if (<= y 1.65e+14) (* x (+ z 1.0)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -7.8e-42) {
tmp = t_1;
} else if (y <= 5.8e-105) {
tmp = x - (z * t);
} else if (y <= 1.65e+14) {
tmp = x * (z + 1.0);
} 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) :: tmp
t_1 = y * (t - x)
if (y <= (-7.8d-42)) then
tmp = t_1
else if (y <= 5.8d-105) then
tmp = x - (z * t)
else if (y <= 1.65d+14) then
tmp = x * (z + 1.0d0)
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 tmp;
if (y <= -7.8e-42) {
tmp = t_1;
} else if (y <= 5.8e-105) {
tmp = x - (z * t);
} else if (y <= 1.65e+14) {
tmp = x * (z + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -7.8e-42: tmp = t_1 elif y <= 5.8e-105: tmp = x - (z * t) elif y <= 1.65e+14: tmp = x * (z + 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -7.8e-42) tmp = t_1; elseif (y <= 5.8e-105) tmp = Float64(x - Float64(z * t)); elseif (y <= 1.65e+14) tmp = Float64(x * Float64(z + 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); tmp = 0.0; if (y <= -7.8e-42) tmp = t_1; elseif (y <= 5.8e-105) tmp = x - (z * t); elseif (y <= 1.65e+14) tmp = x * (z + 1.0); 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]}, If[LessEqual[y, -7.8e-42], t$95$1, If[LessEqual[y, 5.8e-105], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e+14], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -7.8 \cdot 10^{-42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-105}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.8000000000000003e-42 or 1.65e14 < y Initial program 100.0%
Taylor expanded in y around inf 81.8%
if -7.8000000000000003e-42 < y < 5.80000000000000007e-105Initial program 100.0%
Taylor expanded in y around 0 92.8%
mul-1-neg92.8%
unsub-neg92.8%
Simplified92.8%
Taylor expanded in t around inf 74.1%
*-commutative74.1%
Simplified74.1%
if 5.80000000000000007e-105 < y < 1.65e14Initial program 100.0%
Taylor expanded in x around inf 66.5%
mul-1-neg66.5%
unsub-neg66.5%
Simplified66.5%
Taylor expanded in y around 0 64.6%
+-commutative64.6%
Simplified64.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (- y z) -5e-67) (not (<= (- y z) 4e-62))) (* (- y z) t) x))
double code(double x, double y, double z, double t) {
double tmp;
if (((y - z) <= -5e-67) || !((y - z) <= 4e-62)) {
tmp = (y - z) * t;
} else {
tmp = 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 (((y - z) <= (-5d-67)) .or. (.not. ((y - z) <= 4d-62))) then
tmp = (y - z) * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((y - z) <= -5e-67) || !((y - z) <= 4e-62)) {
tmp = (y - z) * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((y - z) <= -5e-67) or not ((y - z) <= 4e-62): tmp = (y - z) * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(y - z) <= -5e-67) || !(Float64(y - z) <= 4e-62)) tmp = Float64(Float64(y - z) * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((y - z) <= -5e-67) || ~(((y - z) <= 4e-62))) tmp = (y - z) * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(y - z), $MachinePrecision], -5e-67], N[Not[LessEqual[N[(y - z), $MachinePrecision], 4e-62]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y - z \leq -5 \cdot 10^{-67} \lor \neg \left(y - z \leq 4 \cdot 10^{-62}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (-.f64 y z) < -4.9999999999999999e-67 or 4.0000000000000002e-62 < (-.f64 y z) Initial program 100.0%
Taylor expanded in x around 0 60.2%
if -4.9999999999999999e-67 < (-.f64 y z) < 4.0000000000000002e-62Initial program 100.0%
Taylor expanded in y around 0 86.9%
mul-1-neg86.9%
unsub-neg86.9%
Simplified86.9%
Taylor expanded in z around 0 74.0%
Final simplification62.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.95e-20) (not (<= y 1.92e+15))) (* y (- t x)) (- x (* z (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.95e-20) || !(y <= 1.92e+15)) {
tmp = y * (t - x);
} else {
tmp = x - (z * (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 ((y <= (-1.95d-20)) .or. (.not. (y <= 1.92d+15))) then
tmp = y * (t - x)
else
tmp = x - (z * (t - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.95e-20) || !(y <= 1.92e+15)) {
tmp = y * (t - x);
} else {
tmp = x - (z * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.95e-20) or not (y <= 1.92e+15): tmp = y * (t - x) else: tmp = x - (z * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.95e-20) || !(y <= 1.92e+15)) tmp = Float64(y * Float64(t - x)); else tmp = Float64(x - Float64(z * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.95e-20) || ~((y <= 1.92e+15))) tmp = y * (t - x); else tmp = x - (z * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.95e-20], N[Not[LessEqual[y, 1.92e+15]], $MachinePrecision]], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.95 \cdot 10^{-20} \lor \neg \left(y \leq 1.92 \cdot 10^{+15}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \left(t - x\right)\\
\end{array}
\end{array}
if y < -1.95000000000000004e-20 or 1.92e15 < y Initial program 100.0%
Taylor expanded in y around inf 83.9%
if -1.95000000000000004e-20 < y < 1.92e15Initial program 100.0%
Taylor expanded in y around 0 89.6%
mul-1-neg89.6%
unsub-neg89.6%
Simplified89.6%
Final simplification86.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -8.4e-148) (not (<= t 9.5e-78))) (* (- y z) t) (* x (+ z 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.4e-148) || !(t <= 9.5e-78)) {
tmp = (y - z) * t;
} else {
tmp = x * (z + 1.0);
}
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 <= (-8.4d-148)) .or. (.not. (t <= 9.5d-78))) then
tmp = (y - z) * t
else
tmp = x * (z + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.4e-148) || !(t <= 9.5e-78)) {
tmp = (y - z) * t;
} else {
tmp = x * (z + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -8.4e-148) or not (t <= 9.5e-78): tmp = (y - z) * t else: tmp = x * (z + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -8.4e-148) || !(t <= 9.5e-78)) tmp = Float64(Float64(y - z) * t); else tmp = Float64(x * Float64(z + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -8.4e-148) || ~((t <= 9.5e-78))) tmp = (y - z) * t; else tmp = x * (z + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -8.4e-148], N[Not[LessEqual[t, 9.5e-78]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.4 \cdot 10^{-148} \lor \neg \left(t \leq 9.5 \cdot 10^{-78}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\end{array}
\end{array}
if t < -8.4000000000000001e-148 or 9.4999999999999997e-78 < t Initial program 100.0%
Taylor expanded in x around 0 73.7%
if -8.4000000000000001e-148 < t < 9.4999999999999997e-78Initial program 100.0%
Taylor expanded in x around inf 83.4%
mul-1-neg83.4%
unsub-neg83.4%
Simplified83.4%
Taylor expanded in y around 0 63.8%
+-commutative63.8%
Simplified63.8%
Final simplification70.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.26e-14))) (* z x) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 1.26e-14)) {
tmp = z * x;
} else {
tmp = 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.0d0)) .or. (.not. (z <= 1.26d-14))) then
tmp = z * x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 1.26e-14)) {
tmp = z * x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 1.26e-14): tmp = z * x else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.26e-14)) tmp = Float64(z * x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.26e-14))) tmp = z * x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.26e-14]], $MachinePrecision]], N[(z * x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1.26 \cdot 10^{-14}\right):\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1 or 1.25999999999999996e-14 < z Initial program 100.0%
Taylor expanded in z around inf 73.0%
mul-1-neg73.0%
distribute-rgt-neg-in73.0%
neg-sub073.0%
sub-neg73.0%
+-commutative73.0%
associate--r+73.0%
neg-sub073.0%
remove-double-neg73.0%
Simplified73.0%
Taylor expanded in x around inf 39.8%
if -1 < z < 1.25999999999999996e-14Initial program 100.0%
Taylor expanded in y around 0 41.5%
mul-1-neg41.5%
unsub-neg41.5%
Simplified41.5%
Taylor expanded in z around 0 31.4%
Final simplification35.2%
(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%
(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 y around 0 56.5%
mul-1-neg56.5%
unsub-neg56.5%
Simplified56.5%
Taylor expanded in z around 0 18.3%
(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 2024086
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:alt
(+ x (+ (* t (- y z)) (* (- x) (- y z))))
(+ x (* (- y z) (- t x))))