
(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 (* x (+ z 1.0))) (t_2 (* (- y z) t)))
(if (<= x -3e-6)
t_1
(if (<= x 8.6e-67)
t_2
(if (<= x 4.2e-18)
t_1
(if (<= x 165000.0)
t_2
(if (or (<= x 4.2e+159) (and (not (<= x 2.7e+210)) (<= x 4.1e+251)))
(* y (- x))
t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z + 1.0);
double t_2 = (y - z) * t;
double tmp;
if (x <= -3e-6) {
tmp = t_1;
} else if (x <= 8.6e-67) {
tmp = t_2;
} else if (x <= 4.2e-18) {
tmp = t_1;
} else if (x <= 165000.0) {
tmp = t_2;
} else if ((x <= 4.2e+159) || (!(x <= 2.7e+210) && (x <= 4.1e+251))) {
tmp = y * -x;
} 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 = x * (z + 1.0d0)
t_2 = (y - z) * t
if (x <= (-3d-6)) then
tmp = t_1
else if (x <= 8.6d-67) then
tmp = t_2
else if (x <= 4.2d-18) then
tmp = t_1
else if (x <= 165000.0d0) then
tmp = t_2
else if ((x <= 4.2d+159) .or. (.not. (x <= 2.7d+210)) .and. (x <= 4.1d+251)) then
tmp = y * -x
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 = x * (z + 1.0);
double t_2 = (y - z) * t;
double tmp;
if (x <= -3e-6) {
tmp = t_1;
} else if (x <= 8.6e-67) {
tmp = t_2;
} else if (x <= 4.2e-18) {
tmp = t_1;
} else if (x <= 165000.0) {
tmp = t_2;
} else if ((x <= 4.2e+159) || (!(x <= 2.7e+210) && (x <= 4.1e+251))) {
tmp = y * -x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z + 1.0) t_2 = (y - z) * t tmp = 0 if x <= -3e-6: tmp = t_1 elif x <= 8.6e-67: tmp = t_2 elif x <= 4.2e-18: tmp = t_1 elif x <= 165000.0: tmp = t_2 elif (x <= 4.2e+159) or (not (x <= 2.7e+210) and (x <= 4.1e+251)): tmp = y * -x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z + 1.0)) t_2 = Float64(Float64(y - z) * t) tmp = 0.0 if (x <= -3e-6) tmp = t_1; elseif (x <= 8.6e-67) tmp = t_2; elseif (x <= 4.2e-18) tmp = t_1; elseif (x <= 165000.0) tmp = t_2; elseif ((x <= 4.2e+159) || (!(x <= 2.7e+210) && (x <= 4.1e+251))) tmp = Float64(y * Float64(-x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (z + 1.0); t_2 = (y - z) * t; tmp = 0.0; if (x <= -3e-6) tmp = t_1; elseif (x <= 8.6e-67) tmp = t_2; elseif (x <= 4.2e-18) tmp = t_1; elseif (x <= 165000.0) tmp = t_2; elseif ((x <= 4.2e+159) || (~((x <= 2.7e+210)) && (x <= 4.1e+251))) tmp = y * -x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[x, -3e-6], t$95$1, If[LessEqual[x, 8.6e-67], t$95$2, If[LessEqual[x, 4.2e-18], t$95$1, If[LessEqual[x, 165000.0], t$95$2, If[Or[LessEqual[x, 4.2e+159], And[N[Not[LessEqual[x, 2.7e+210]], $MachinePrecision], LessEqual[x, 4.1e+251]]], N[(y * (-x)), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(z + 1\right)\\
t_2 := \left(y - z\right) \cdot t\\
\mathbf{if}\;x \leq -3 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 8.6 \cdot 10^{-67}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-18}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 165000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+159} \lor \neg \left(x \leq 2.7 \cdot 10^{+210}\right) \land x \leq 4.1 \cdot 10^{+251}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -3.0000000000000001e-6 or 8.60000000000000053e-67 < x < 4.19999999999999999e-18 or 4.19999999999999978e159 < x < 2.6999999999999999e210 or 4.1000000000000001e251 < x Initial program 100.0%
Taylor expanded in y around 0 69.2%
mul-1-neg69.2%
unsub-neg69.2%
Simplified69.2%
Taylor expanded in x around inf 62.3%
cancel-sign-sub-inv62.3%
metadata-eval62.3%
*-lft-identity62.3%
Simplified62.3%
if -3.0000000000000001e-6 < x < 8.60000000000000053e-67 or 4.19999999999999999e-18 < x < 165000Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-def100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 77.3%
if 165000 < x < 4.19999999999999978e159 or 2.6999999999999999e210 < x < 4.1000000000000001e251Initial program 100.0%
Taylor expanded in x around 0 91.9%
fma-def94.6%
mul-1-neg94.6%
Simplified94.6%
Taylor expanded in y around inf 68.7%
neg-mul-168.7%
sub-neg68.7%
Simplified68.7%
Taylor expanded in t around 0 58.3%
associate-*r*58.3%
mul-1-neg58.3%
Simplified58.3%
Final simplification68.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (* x (+ z 1.0))))
(if (<= y -3.8e-19)
t_1
(if (<= y -1e-134)
t_2
(if (<= y -2.6e-167)
(* (- y z) t)
(if (<= y 2.3e-176)
t_2
(if (<= y 1.75e-149)
(* z (- t))
(if (<= y 88000000.0) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = x * (z + 1.0);
double tmp;
if (y <= -3.8e-19) {
tmp = t_1;
} else if (y <= -1e-134) {
tmp = t_2;
} else if (y <= -2.6e-167) {
tmp = (y - z) * t;
} else if (y <= 2.3e-176) {
tmp = t_2;
} else if (y <= 1.75e-149) {
tmp = z * -t;
} else if (y <= 88000000.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) :: tmp
t_1 = y * (t - x)
t_2 = x * (z + 1.0d0)
if (y <= (-3.8d-19)) then
tmp = t_1
else if (y <= (-1d-134)) then
tmp = t_2
else if (y <= (-2.6d-167)) then
tmp = (y - z) * t
else if (y <= 2.3d-176) then
tmp = t_2
else if (y <= 1.75d-149) then
tmp = z * -t
else if (y <= 88000000.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 = y * (t - x);
double t_2 = x * (z + 1.0);
double tmp;
if (y <= -3.8e-19) {
tmp = t_1;
} else if (y <= -1e-134) {
tmp = t_2;
} else if (y <= -2.6e-167) {
tmp = (y - z) * t;
} else if (y <= 2.3e-176) {
tmp = t_2;
} else if (y <= 1.75e-149) {
tmp = z * -t;
} else if (y <= 88000000.0) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = x * (z + 1.0) tmp = 0 if y <= -3.8e-19: tmp = t_1 elif y <= -1e-134: tmp = t_2 elif y <= -2.6e-167: tmp = (y - z) * t elif y <= 2.3e-176: tmp = t_2 elif y <= 1.75e-149: tmp = z * -t elif y <= 88000000.0: 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(x * Float64(z + 1.0)) tmp = 0.0 if (y <= -3.8e-19) tmp = t_1; elseif (y <= -1e-134) tmp = t_2; elseif (y <= -2.6e-167) tmp = Float64(Float64(y - z) * t); elseif (y <= 2.3e-176) tmp = t_2; elseif (y <= 1.75e-149) tmp = Float64(z * Float64(-t)); elseif (y <= 88000000.0) 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 = x * (z + 1.0); tmp = 0.0; if (y <= -3.8e-19) tmp = t_1; elseif (y <= -1e-134) tmp = t_2; elseif (y <= -2.6e-167) tmp = (y - z) * t; elseif (y <= 2.3e-176) tmp = t_2; elseif (y <= 1.75e-149) tmp = z * -t; elseif (y <= 88000000.0) 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[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.8e-19], t$95$1, If[LessEqual[y, -1e-134], t$95$2, If[LessEqual[y, -2.6e-167], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 2.3e-176], t$95$2, If[LessEqual[y, 1.75e-149], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 88000000.0], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := x \cdot \left(z + 1\right)\\
\mathbf{if}\;y \leq -3.8 \cdot 10^{-19}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-134}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2.6 \cdot 10^{-167}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-176}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-149}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;y \leq 88000000:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -3.8e-19 or 8.8e7 < y Initial program 100.0%
Taylor expanded in x around 0 94.5%
fma-def96.1%
mul-1-neg96.1%
Simplified96.1%
Taylor expanded in y around inf 83.2%
neg-mul-183.2%
sub-neg83.2%
Simplified83.2%
if -3.8e-19 < y < -1.00000000000000004e-134 or -2.5999999999999999e-167 < y < 2.3000000000000001e-176 or 1.75e-149 < y < 8.8e7Initial program 100.0%
Taylor expanded in y around 0 92.4%
mul-1-neg92.4%
unsub-neg92.4%
Simplified92.4%
Taylor expanded in x around inf 68.1%
cancel-sign-sub-inv68.1%
metadata-eval68.1%
*-lft-identity68.1%
Simplified68.1%
if -1.00000000000000004e-134 < y < -2.5999999999999999e-167Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-def100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 83.4%
if 2.3000000000000001e-176 < y < 1.75e-149Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-def100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 80.3%
Taylor expanded in y around 0 80.3%
associate-*r*80.3%
mul-1-neg80.3%
Simplified80.3%
Final simplification76.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= z -1.6e+29)
t_1
(if (<= z -1.5e-184)
(* y t)
(if (<= z 1.6e-162)
x
(if (<= z 8.5e+63)
(* y t)
(if (<= z 1.6e+157) (* z x) (if (<= z 7.5e+176) (* y t) t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (z <= -1.6e+29) {
tmp = t_1;
} else if (z <= -1.5e-184) {
tmp = y * t;
} else if (z <= 1.6e-162) {
tmp = x;
} else if (z <= 8.5e+63) {
tmp = y * t;
} else if (z <= 1.6e+157) {
tmp = z * x;
} else if (z <= 7.5e+176) {
tmp = y * t;
} 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 = z * -t
if (z <= (-1.6d+29)) then
tmp = t_1
else if (z <= (-1.5d-184)) then
tmp = y * t
else if (z <= 1.6d-162) then
tmp = x
else if (z <= 8.5d+63) then
tmp = y * t
else if (z <= 1.6d+157) then
tmp = z * x
else if (z <= 7.5d+176) then
tmp = y * t
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 * -t;
double tmp;
if (z <= -1.6e+29) {
tmp = t_1;
} else if (z <= -1.5e-184) {
tmp = y * t;
} else if (z <= 1.6e-162) {
tmp = x;
} else if (z <= 8.5e+63) {
tmp = y * t;
} else if (z <= 1.6e+157) {
tmp = z * x;
} else if (z <= 7.5e+176) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if z <= -1.6e+29: tmp = t_1 elif z <= -1.5e-184: tmp = y * t elif z <= 1.6e-162: tmp = x elif z <= 8.5e+63: tmp = y * t elif z <= 1.6e+157: tmp = z * x elif z <= 7.5e+176: tmp = y * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (z <= -1.6e+29) tmp = t_1; elseif (z <= -1.5e-184) tmp = Float64(y * t); elseif (z <= 1.6e-162) tmp = x; elseif (z <= 8.5e+63) tmp = Float64(y * t); elseif (z <= 1.6e+157) tmp = Float64(z * x); elseif (z <= 7.5e+176) tmp = Float64(y * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (z <= -1.6e+29) tmp = t_1; elseif (z <= -1.5e-184) tmp = y * t; elseif (z <= 1.6e-162) tmp = x; elseif (z <= 8.5e+63) tmp = y * t; elseif (z <= 1.6e+157) tmp = z * x; elseif (z <= 7.5e+176) tmp = y * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -1.6e+29], t$95$1, If[LessEqual[z, -1.5e-184], N[(y * t), $MachinePrecision], If[LessEqual[z, 1.6e-162], x, If[LessEqual[z, 8.5e+63], N[(y * t), $MachinePrecision], If[LessEqual[z, 1.6e+157], N[(z * x), $MachinePrecision], If[LessEqual[z, 7.5e+176], N[(y * t), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{+29}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-184}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-162}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+63}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+157}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+176}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.59999999999999993e29 or 7.499999999999999e176 < z Initial program 100.0%
Taylor expanded in x around 0 94.4%
fma-def96.6%
mul-1-neg96.6%
Simplified96.6%
Taylor expanded in t around inf 57.0%
Taylor expanded in y around 0 52.6%
associate-*r*52.6%
mul-1-neg52.6%
Simplified52.6%
if -1.59999999999999993e29 < z < -1.49999999999999996e-184 or 1.59999999999999988e-162 < z < 8.5000000000000004e63 or 1.6e157 < z < 7.499999999999999e176Initial program 100.0%
Taylor expanded in x around 0 96.8%
fma-def97.9%
mul-1-neg97.9%
Simplified97.9%
Taylor expanded in t around inf 57.7%
Taylor expanded in y around inf 45.7%
*-commutative45.7%
Simplified45.7%
if -1.49999999999999996e-184 < z < 1.59999999999999988e-162Initial program 100.0%
Taylor expanded in t around inf 72.0%
Taylor expanded in x around inf 47.3%
if 8.5000000000000004e63 < z < 1.6e157Initial program 99.9%
Taylor expanded in x around 0 99.9%
fma-def100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 67.6%
mul-1-neg67.6%
sub-neg67.6%
Simplified67.6%
Taylor expanded in x around inf 47.7%
Final simplification48.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))))
(if (<= z -7.5e+28)
t_1
(if (<= z -4.7e-184)
(* y (- t x))
(if (<= z 2.15e-291)
(- x (* y x))
(if (<= z 14000.0) (+ x (* y t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -7.5e+28) {
tmp = t_1;
} else if (z <= -4.7e-184) {
tmp = y * (t - x);
} else if (z <= 2.15e-291) {
tmp = x - (y * x);
} else if (z <= 14000.0) {
tmp = x + (y * t);
} 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 = z * (x - t)
if (z <= (-7.5d+28)) then
tmp = t_1
else if (z <= (-4.7d-184)) then
tmp = y * (t - x)
else if (z <= 2.15d-291) then
tmp = x - (y * x)
else if (z <= 14000.0d0) then
tmp = x + (y * t)
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 tmp;
if (z <= -7.5e+28) {
tmp = t_1;
} else if (z <= -4.7e-184) {
tmp = y * (t - x);
} else if (z <= 2.15e-291) {
tmp = x - (y * x);
} else if (z <= 14000.0) {
tmp = x + (y * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -7.5e+28: tmp = t_1 elif z <= -4.7e-184: tmp = y * (t - x) elif z <= 2.15e-291: tmp = x - (y * x) elif z <= 14000.0: tmp = x + (y * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -7.5e+28) tmp = t_1; elseif (z <= -4.7e-184) tmp = Float64(y * Float64(t - x)); elseif (z <= 2.15e-291) tmp = Float64(x - Float64(y * x)); elseif (z <= 14000.0) tmp = Float64(x + Float64(y * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); tmp = 0.0; if (z <= -7.5e+28) tmp = t_1; elseif (z <= -4.7e-184) tmp = y * (t - x); elseif (z <= 2.15e-291) tmp = x - (y * x); elseif (z <= 14000.0) tmp = x + (y * t); 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]}, If[LessEqual[z, -7.5e+28], t$95$1, If[LessEqual[z, -4.7e-184], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.15e-291], N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 14000.0], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -7.5 \cdot 10^{+28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-184}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-291}:\\
\;\;\;\;x - y \cdot x\\
\mathbf{elif}\;z \leq 14000:\\
\;\;\;\;x + y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -7.4999999999999998e28 or 14000 < z Initial program 99.9%
Taylor expanded in x around 0 95.9%
fma-def97.5%
mul-1-neg97.5%
Simplified97.5%
Taylor expanded in z around inf 80.4%
mul-1-neg80.4%
sub-neg80.4%
Simplified80.4%
if -7.4999999999999998e28 < z < -4.70000000000000019e-184Initial program 100.0%
Taylor expanded in x around 0 98.0%
fma-def100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 71.4%
neg-mul-171.4%
sub-neg71.4%
Simplified71.4%
if -4.70000000000000019e-184 < z < 2.15000000000000018e-291Initial program 100.0%
Taylor expanded in y around inf 97.0%
*-commutative97.0%
Simplified97.0%
Taylor expanded in t around 0 82.2%
mul-1-neg82.2%
distribute-lft-neg-out82.2%
*-commutative82.2%
Simplified82.2%
distribute-rgt-neg-out82.2%
unsub-neg82.2%
*-commutative82.2%
Applied egg-rr82.2%
if 2.15000000000000018e-291 < z < 14000Initial program 100.0%
Taylor expanded in t around inf 83.3%
Taylor expanded in y around inf 77.5%
*-commutative43.9%
Simplified77.5%
Final simplification78.3%
(FPCore (x y z t)
:precision binary64
(if (<= z -5.2e+28)
(* z x)
(if (<= z -2.45e-186)
(* y t)
(if (<= z 3.7e-162) x (if (<= z 1.8e+68) (* y t) (* z x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e+28) {
tmp = z * x;
} else if (z <= -2.45e-186) {
tmp = y * t;
} else if (z <= 3.7e-162) {
tmp = x;
} else if (z <= 1.8e+68) {
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 <= (-5.2d+28)) then
tmp = z * x
else if (z <= (-2.45d-186)) then
tmp = y * t
else if (z <= 3.7d-162) then
tmp = x
else if (z <= 1.8d+68) 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 <= -5.2e+28) {
tmp = z * x;
} else if (z <= -2.45e-186) {
tmp = y * t;
} else if (z <= 3.7e-162) {
tmp = x;
} else if (z <= 1.8e+68) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.2e+28: tmp = z * x elif z <= -2.45e-186: tmp = y * t elif z <= 3.7e-162: tmp = x elif z <= 1.8e+68: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.2e+28) tmp = Float64(z * x); elseif (z <= -2.45e-186) tmp = Float64(y * t); elseif (z <= 3.7e-162) tmp = x; elseif (z <= 1.8e+68) 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 <= -5.2e+28) tmp = z * x; elseif (z <= -2.45e-186) tmp = y * t; elseif (z <= 3.7e-162) tmp = x; elseif (z <= 1.8e+68) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.2e+28], N[(z * x), $MachinePrecision], If[LessEqual[z, -2.45e-186], N[(y * t), $MachinePrecision], If[LessEqual[z, 3.7e-162], x, If[LessEqual[z, 1.8e+68], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+28}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{-186}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-162}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+68}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -5.2000000000000004e28 or 1.7999999999999999e68 < z Initial program 100.0%
Taylor expanded in x around 0 95.3%
fma-def97.2%
mul-1-neg97.2%
Simplified97.2%
Taylor expanded in z around inf 83.6%
mul-1-neg83.6%
sub-neg83.6%
Simplified83.6%
Taylor expanded in x around inf 45.3%
if -5.2000000000000004e28 < z < -2.4499999999999998e-186 or 3.7000000000000002e-162 < z < 1.7999999999999999e68Initial program 99.9%
Taylor expanded in x around 0 96.7%
fma-def97.8%
mul-1-neg97.8%
Simplified97.8%
Taylor expanded in t around inf 56.4%
Taylor expanded in y around inf 44.9%
*-commutative44.9%
Simplified44.9%
if -2.4499999999999998e-186 < z < 3.7000000000000002e-162Initial program 100.0%
Taylor expanded in t around inf 72.0%
Taylor expanded in x around inf 47.3%
Final simplification45.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))))
(if (<= z -5.8e+29)
t_1
(if (<= z -9.5e-233)
(* y (- t x))
(if (<= z 84000.0) (+ x (* y t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -5.8e+29) {
tmp = t_1;
} else if (z <= -9.5e-233) {
tmp = y * (t - x);
} else if (z <= 84000.0) {
tmp = x + (y * t);
} 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 = z * (x - t)
if (z <= (-5.8d+29)) then
tmp = t_1
else if (z <= (-9.5d-233)) then
tmp = y * (t - x)
else if (z <= 84000.0d0) then
tmp = x + (y * t)
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 tmp;
if (z <= -5.8e+29) {
tmp = t_1;
} else if (z <= -9.5e-233) {
tmp = y * (t - x);
} else if (z <= 84000.0) {
tmp = x + (y * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -5.8e+29: tmp = t_1 elif z <= -9.5e-233: tmp = y * (t - x) elif z <= 84000.0: tmp = x + (y * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -5.8e+29) tmp = t_1; elseif (z <= -9.5e-233) tmp = Float64(y * Float64(t - x)); elseif (z <= 84000.0) tmp = Float64(x + Float64(y * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); tmp = 0.0; if (z <= -5.8e+29) tmp = t_1; elseif (z <= -9.5e-233) tmp = y * (t - x); elseif (z <= 84000.0) tmp = x + (y * t); 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]}, If[LessEqual[z, -5.8e+29], t$95$1, If[LessEqual[z, -9.5e-233], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 84000.0], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{+29}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-233}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{elif}\;z \leq 84000:\\
\;\;\;\;x + y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -5.7999999999999999e29 or 84000 < z Initial program 99.9%
Taylor expanded in x around 0 95.9%
fma-def97.5%
mul-1-neg97.5%
Simplified97.5%
Taylor expanded in z around inf 80.4%
mul-1-neg80.4%
sub-neg80.4%
Simplified80.4%
if -5.7999999999999999e29 < z < -9.5000000000000003e-233Initial program 100.0%
Taylor expanded in x around 0 96.8%
fma-def98.4%
mul-1-neg98.4%
Simplified98.4%
Taylor expanded in y around inf 69.7%
neg-mul-169.7%
sub-neg69.7%
Simplified69.7%
if -9.5000000000000003e-233 < z < 84000Initial program 100.0%
Taylor expanded in t around inf 79.7%
Taylor expanded in y around inf 75.5%
*-commutative36.6%
Simplified75.5%
Final simplification76.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.8e-35) (not (<= x 2.5e-63))) (* x (+ (- z y) 1.0)) (* (- y z) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.8e-35) || !(x <= 2.5e-63)) {
tmp = x * ((z - y) + 1.0);
} else {
tmp = (y - z) * 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 ((x <= (-3.8d-35)) .or. (.not. (x <= 2.5d-63))) then
tmp = x * ((z - y) + 1.0d0)
else
tmp = (y - z) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.8e-35) || !(x <= 2.5e-63)) {
tmp = x * ((z - y) + 1.0);
} else {
tmp = (y - z) * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.8e-35) or not (x <= 2.5e-63): tmp = x * ((z - y) + 1.0) else: tmp = (y - z) * t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.8e-35) || !(x <= 2.5e-63)) tmp = Float64(x * Float64(Float64(z - y) + 1.0)); else tmp = Float64(Float64(y - z) * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.8e-35) || ~((x <= 2.5e-63))) tmp = x * ((z - y) + 1.0); else tmp = (y - z) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.8e-35], N[Not[LessEqual[x, 2.5e-63]], $MachinePrecision]], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{-35} \lor \neg \left(x \leq 2.5 \cdot 10^{-63}\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -3.8000000000000001e-35 or 2.5000000000000001e-63 < x Initial program 100.0%
Taylor expanded in x around inf 81.3%
mul-1-neg81.3%
unsub-neg81.3%
Simplified81.3%
if -3.8000000000000001e-35 < x < 2.5000000000000001e-63Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-def100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 78.8%
Final simplification80.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2050000.0) (not (<= x 18.0))) (* x (+ (- z y) 1.0)) (+ x (* (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2050000.0) || !(x <= 18.0)) {
tmp = x * ((z - y) + 1.0);
} else {
tmp = x + ((y - z) * 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 ((x <= (-2050000.0d0)) .or. (.not. (x <= 18.0d0))) then
tmp = x * ((z - y) + 1.0d0)
else
tmp = x + ((y - z) * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2050000.0) || !(x <= 18.0)) {
tmp = x * ((z - y) + 1.0);
} else {
tmp = x + ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2050000.0) or not (x <= 18.0): tmp = x * ((z - y) + 1.0) else: tmp = x + ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2050000.0) || !(x <= 18.0)) tmp = Float64(x * Float64(Float64(z - y) + 1.0)); else tmp = Float64(x + Float64(Float64(y - z) * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2050000.0) || ~((x <= 18.0))) tmp = x * ((z - y) + 1.0); else tmp = x + ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2050000.0], N[Not[LessEqual[x, 18.0]], $MachinePrecision]], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2050000 \lor \neg \left(x \leq 18\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -2.05e6 or 18 < x Initial program 100.0%
Taylor expanded in x around inf 87.2%
mul-1-neg87.2%
unsub-neg87.2%
Simplified87.2%
if -2.05e6 < x < 18Initial program 100.0%
Taylor expanded in t around inf 81.2%
Final simplification84.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3e+29) (not (<= z 6200000.0))) (* z (- x t)) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3e+29) || !(z <= 6200000.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 <= (-3d+29)) .or. (.not. (z <= 6200000.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 <= -3e+29) || !(z <= 6200000.0)) {
tmp = z * (x - t);
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3e+29) or not (z <= 6200000.0): tmp = z * (x - t) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3e+29) || !(z <= 6200000.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 <= -3e+29) || ~((z <= 6200000.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, -3e+29], N[Not[LessEqual[z, 6200000.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 \cdot 10^{+29} \lor \neg \left(z \leq 6200000\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -2.9999999999999999e29 or 6.2e6 < z Initial program 99.9%
Taylor expanded in x around 0 95.9%
fma-def97.5%
mul-1-neg97.5%
Simplified97.5%
Taylor expanded in z around inf 80.4%
mul-1-neg80.4%
sub-neg80.4%
Simplified80.4%
if -2.9999999999999999e29 < z < 6.2e6Initial program 100.0%
Taylor expanded in y around inf 92.3%
*-commutative92.3%
Simplified92.3%
Final simplification86.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))))
(if (<= z -7.7e+28)
t_1
(if (<= z 1550000.0) (+ x (* y (- t x))) (+ x t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -7.7e+28) {
tmp = t_1;
} else if (z <= 1550000.0) {
tmp = x + (y * (t - x));
} else {
tmp = x + 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 = z * (x - t)
if (z <= (-7.7d+28)) then
tmp = t_1
else if (z <= 1550000.0d0) then
tmp = x + (y * (t - x))
else
tmp = x + 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 tmp;
if (z <= -7.7e+28) {
tmp = t_1;
} else if (z <= 1550000.0) {
tmp = x + (y * (t - x));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -7.7e+28: tmp = t_1 elif z <= 1550000.0: tmp = x + (y * (t - x)) else: tmp = x + t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -7.7e+28) tmp = t_1; elseif (z <= 1550000.0) tmp = Float64(x + Float64(y * Float64(t - x))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); tmp = 0.0; if (z <= -7.7e+28) tmp = t_1; elseif (z <= 1550000.0) tmp = x + (y * (t - x)); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.7e+28], t$95$1, If[LessEqual[z, 1550000.0], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -7.7 \cdot 10^{+28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1550000:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + t_1\\
\end{array}
\end{array}
if z < -7.6999999999999997e28Initial program 100.0%
Taylor expanded in x around 0 91.6%
fma-def95.0%
mul-1-neg95.0%
Simplified95.0%
Taylor expanded in z around inf 83.5%
mul-1-neg83.5%
sub-neg83.5%
Simplified83.5%
if -7.6999999999999997e28 < z < 1.55e6Initial program 100.0%
Taylor expanded in y around inf 92.3%
*-commutative92.3%
Simplified92.3%
if 1.55e6 < z Initial program 99.9%
Taylor expanded in y around 0 78.3%
mul-1-neg78.3%
unsub-neg78.3%
Simplified78.3%
Final simplification86.8%
(FPCore (x y z t)
:precision binary64
(if (<= x -9200000.0)
(* z x)
(if (<= x 58000.0)
(* (- y z) t)
(if (<= x 1.22e+290) (* y (- x)) (* z x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9200000.0) {
tmp = z * x;
} else if (x <= 58000.0) {
tmp = (y - z) * t;
} else if (x <= 1.22e+290) {
tmp = y * -x;
} 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 (x <= (-9200000.0d0)) then
tmp = z * x
else if (x <= 58000.0d0) then
tmp = (y - z) * t
else if (x <= 1.22d+290) then
tmp = y * -x
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 (x <= -9200000.0) {
tmp = z * x;
} else if (x <= 58000.0) {
tmp = (y - z) * t;
} else if (x <= 1.22e+290) {
tmp = y * -x;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -9200000.0: tmp = z * x elif x <= 58000.0: tmp = (y - z) * t elif x <= 1.22e+290: tmp = y * -x else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -9200000.0) tmp = Float64(z * x); elseif (x <= 58000.0) tmp = Float64(Float64(y - z) * t); elseif (x <= 1.22e+290) tmp = Float64(y * Float64(-x)); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -9200000.0) tmp = z * x; elseif (x <= 58000.0) tmp = (y - z) * t; elseif (x <= 1.22e+290) tmp = y * -x; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -9200000.0], N[(z * x), $MachinePrecision], If[LessEqual[x, 58000.0], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[x, 1.22e+290], N[(y * (-x)), $MachinePrecision], N[(z * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9200000:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;x \leq 58000:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{+290}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if x < -9.2e6 or 1.22000000000000006e290 < x Initial program 100.0%
Taylor expanded in x around 0 91.2%
fma-def94.1%
mul-1-neg94.1%
Simplified94.1%
Taylor expanded in z around inf 52.3%
mul-1-neg52.3%
sub-neg52.3%
Simplified52.3%
Taylor expanded in x around inf 46.8%
if -9.2e6 < x < 58000Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-def100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 70.8%
if 58000 < x < 1.22000000000000006e290Initial program 100.0%
Taylor expanded in x around 0 90.7%
fma-def94.4%
mul-1-neg94.4%
Simplified94.4%
Taylor expanded in y around inf 56.6%
neg-mul-156.6%
sub-neg56.6%
Simplified56.6%
Taylor expanded in t around 0 47.6%
associate-*r*47.6%
mul-1-neg47.6%
Simplified47.6%
Final simplification59.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.15e+30) (not (<= z 140000.0))) (* z (- x t)) (* y (- t x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.15e+30) || !(z <= 140000.0)) {
tmp = z * (x - t);
} else {
tmp = 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 <= (-1.15d+30)) .or. (.not. (z <= 140000.0d0))) then
tmp = z * (x - t)
else
tmp = 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 <= -1.15e+30) || !(z <= 140000.0)) {
tmp = z * (x - t);
} else {
tmp = y * (t - x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.15e+30) or not (z <= 140000.0): tmp = z * (x - t) else: tmp = y * (t - x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.15e+30) || !(z <= 140000.0)) tmp = Float64(z * Float64(x - t)); else tmp = Float64(y * Float64(t - x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.15e+30) || ~((z <= 140000.0))) tmp = z * (x - t); else tmp = y * (t - x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.15e+30], N[Not[LessEqual[z, 140000.0]], $MachinePrecision]], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+30} \lor \neg \left(z \leq 140000\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -1.15e30 or 1.4e5 < z Initial program 99.9%
Taylor expanded in x around 0 95.9%
fma-def97.5%
mul-1-neg97.5%
Simplified97.5%
Taylor expanded in z around inf 80.4%
mul-1-neg80.4%
sub-neg80.4%
Simplified80.4%
if -1.15e30 < z < 1.4e5Initial program 100.0%
Taylor expanded in x around 0 95.5%
fma-def97.0%
mul-1-neg97.0%
Simplified97.0%
Taylor expanded in y around inf 62.4%
neg-mul-162.4%
sub-neg62.4%
Simplified62.4%
Final simplification71.1%
(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 (or (<= z -1.85e-33) (not (<= z 1.0))) (* z x) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.85e-33) || !(z <= 1.0)) {
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.85d-33)) .or. (.not. (z <= 1.0d0))) 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.85e-33) || !(z <= 1.0)) {
tmp = z * x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.85e-33) or not (z <= 1.0): tmp = z * x else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.85e-33) || !(z <= 1.0)) 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.85e-33) || ~((z <= 1.0))) tmp = z * x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.85e-33], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(z * x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-33} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.85000000000000007e-33 or 1 < z Initial program 100.0%
Taylor expanded in x around 0 96.2%
fma-def97.7%
mul-1-neg97.7%
Simplified97.7%
Taylor expanded in z around inf 74.8%
mul-1-neg74.8%
sub-neg74.8%
Simplified74.8%
Taylor expanded in x around inf 40.4%
if -1.85000000000000007e-33 < z < 1Initial program 100.0%
Taylor expanded in t around inf 74.2%
Taylor expanded in x around inf 34.2%
Final simplification37.5%
(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 t around inf 65.7%
Taylor expanded in x around inf 17.7%
Final simplification17.7%
(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 2023322
(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))))