
(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 13 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 (* y t))) (t_2 (* x (- (+ z 1.0) y))))
(if (<= t -5e+232)
(* y (+ t x))
(if (<= t -1.65e+208)
(* z (- t))
(if (<= t -2.85e+150)
t_1
(if (<= t -3.2e+22)
t_2
(if (<= t -2.65e-39)
(* y (- t x))
(if (<= t 3e+42)
t_2
(if (or (<= t 3.8e+112) (not (<= t 5.3e+190)))
t_1
(- x (* z t)))))))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y * t);
double t_2 = x * ((z + 1.0) - y);
double tmp;
if (t <= -5e+232) {
tmp = y * (t + x);
} else if (t <= -1.65e+208) {
tmp = z * -t;
} else if (t <= -2.85e+150) {
tmp = t_1;
} else if (t <= -3.2e+22) {
tmp = t_2;
} else if (t <= -2.65e-39) {
tmp = y * (t - x);
} else if (t <= 3e+42) {
tmp = t_2;
} else if ((t <= 3.8e+112) || !(t <= 5.3e+190)) {
tmp = t_1;
} else {
tmp = x - (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (y * t)
t_2 = x * ((z + 1.0d0) - y)
if (t <= (-5d+232)) then
tmp = y * (t + x)
else if (t <= (-1.65d+208)) then
tmp = z * -t
else if (t <= (-2.85d+150)) then
tmp = t_1
else if (t <= (-3.2d+22)) then
tmp = t_2
else if (t <= (-2.65d-39)) then
tmp = y * (t - x)
else if (t <= 3d+42) then
tmp = t_2
else if ((t <= 3.8d+112) .or. (.not. (t <= 5.3d+190))) then
tmp = t_1
else
tmp = x - (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x + (y * t);
double t_2 = x * ((z + 1.0) - y);
double tmp;
if (t <= -5e+232) {
tmp = y * (t + x);
} else if (t <= -1.65e+208) {
tmp = z * -t;
} else if (t <= -2.85e+150) {
tmp = t_1;
} else if (t <= -3.2e+22) {
tmp = t_2;
} else if (t <= -2.65e-39) {
tmp = y * (t - x);
} else if (t <= 3e+42) {
tmp = t_2;
} else if ((t <= 3.8e+112) || !(t <= 5.3e+190)) {
tmp = t_1;
} else {
tmp = x - (z * t);
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y * t) t_2 = x * ((z + 1.0) - y) tmp = 0 if t <= -5e+232: tmp = y * (t + x) elif t <= -1.65e+208: tmp = z * -t elif t <= -2.85e+150: tmp = t_1 elif t <= -3.2e+22: tmp = t_2 elif t <= -2.65e-39: tmp = y * (t - x) elif t <= 3e+42: tmp = t_2 elif (t <= 3.8e+112) or not (t <= 5.3e+190): tmp = t_1 else: tmp = x - (z * t) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y * t)) t_2 = Float64(x * Float64(Float64(z + 1.0) - y)) tmp = 0.0 if (t <= -5e+232) tmp = Float64(y * Float64(t + x)); elseif (t <= -1.65e+208) tmp = Float64(z * Float64(-t)); elseif (t <= -2.85e+150) tmp = t_1; elseif (t <= -3.2e+22) tmp = t_2; elseif (t <= -2.65e-39) tmp = Float64(y * Float64(t - x)); elseif (t <= 3e+42) tmp = t_2; elseif ((t <= 3.8e+112) || !(t <= 5.3e+190)) tmp = t_1; else tmp = Float64(x - Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y * t); t_2 = x * ((z + 1.0) - y); tmp = 0.0; if (t <= -5e+232) tmp = y * (t + x); elseif (t <= -1.65e+208) tmp = z * -t; elseif (t <= -2.85e+150) tmp = t_1; elseif (t <= -3.2e+22) tmp = t_2; elseif (t <= -2.65e-39) tmp = y * (t - x); elseif (t <= 3e+42) tmp = t_2; elseif ((t <= 3.8e+112) || ~((t <= 5.3e+190))) tmp = t_1; else tmp = x - (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(z + 1.0), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5e+232], N[(y * N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.65e+208], N[(z * (-t)), $MachinePrecision], If[LessEqual[t, -2.85e+150], t$95$1, If[LessEqual[t, -3.2e+22], t$95$2, If[LessEqual[t, -2.65e-39], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e+42], t$95$2, If[Or[LessEqual[t, 3.8e+112], N[Not[LessEqual[t, 5.3e+190]], $MachinePrecision]], t$95$1, N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot t\\
t_2 := x \cdot \left(\left(z + 1\right) - y\right)\\
\mathbf{if}\;t \leq -5 \cdot 10^{+232}:\\
\;\;\;\;y \cdot \left(t + x\right)\\
\mathbf{elif}\;t \leq -1.65 \cdot 10^{+208}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;t \leq -2.85 \cdot 10^{+150}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -3.2 \cdot 10^{+22}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -2.65 \cdot 10^{-39}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+42}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+112} \lor \neg \left(t \leq 5.3 \cdot 10^{+190}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot t\\
\end{array}
\end{array}
if t < -4.99999999999999987e232Initial program 100.0%
Taylor expanded in z around 0 82.6%
Taylor expanded in y around inf 82.6%
sub-neg82.6%
distribute-lft-in82.6%
add-sqr-sqrt63.6%
sqrt-unprod73.6%
sqr-neg73.6%
sqrt-unprod9.9%
add-sqr-sqrt73.6%
Applied egg-rr73.6%
distribute-lft-in82.6%
Simplified82.6%
if -4.99999999999999987e232 < t < -1.65e208Initial program 100.0%
Taylor expanded in t around inf 100.0%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
associate-*r*100.0%
neg-mul-1100.0%
*-commutative100.0%
Simplified100.0%
if -1.65e208 < t < -2.8500000000000001e150 or 3.00000000000000029e42 < t < 3.80000000000000008e112 or 5.30000000000000015e190 < t Initial program 100.0%
Taylor expanded in t around inf 96.7%
Taylor expanded in z around 0 72.1%
if -2.8500000000000001e150 < t < -3.2e22 or -2.65000000000000002e-39 < t < 3.00000000000000029e42Initial program 100.0%
Taylor expanded in x around inf 79.7%
*-commutative79.7%
mul-1-neg79.7%
unsub-neg79.7%
distribute-lft-out--79.7%
*-rgt-identity79.7%
Simplified79.7%
Taylor expanded in x around 0 79.7%
if -3.2e22 < t < -2.65000000000000002e-39Initial program 100.0%
Taylor expanded in z around 0 82.4%
Taylor expanded in y around inf 73.9%
if 3.80000000000000008e112 < t < 5.30000000000000015e190Initial program 100.0%
Taylor expanded in t around inf 95.4%
Taylor expanded in y around 0 90.4%
+-commutative90.4%
mul-1-neg90.4%
unsub-neg90.4%
Simplified90.4%
Final simplification79.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ t x))) (t_2 (* z (- t))))
(if (<= y -2.7e+39)
t_1
(if (<= y -1.35e-43)
t_2
(if (<= y -1.42e-105)
x
(if (<= y -1.35e-237)
t_2
(if (<= y 4.1e-275)
x
(if (<= y 2.05e-196)
t_2
(if (<= y 2e-106) x (if (<= y 3.8e-64) t_2 t_1))))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t + x);
double t_2 = z * -t;
double tmp;
if (y <= -2.7e+39) {
tmp = t_1;
} else if (y <= -1.35e-43) {
tmp = t_2;
} else if (y <= -1.42e-105) {
tmp = x;
} else if (y <= -1.35e-237) {
tmp = t_2;
} else if (y <= 4.1e-275) {
tmp = x;
} else if (y <= 2.05e-196) {
tmp = t_2;
} else if (y <= 2e-106) {
tmp = x;
} else if (y <= 3.8e-64) {
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 * -t
if (y <= (-2.7d+39)) then
tmp = t_1
else if (y <= (-1.35d-43)) then
tmp = t_2
else if (y <= (-1.42d-105)) then
tmp = x
else if (y <= (-1.35d-237)) then
tmp = t_2
else if (y <= 4.1d-275) then
tmp = x
else if (y <= 2.05d-196) then
tmp = t_2
else if (y <= 2d-106) then
tmp = x
else if (y <= 3.8d-64) 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 * -t;
double tmp;
if (y <= -2.7e+39) {
tmp = t_1;
} else if (y <= -1.35e-43) {
tmp = t_2;
} else if (y <= -1.42e-105) {
tmp = x;
} else if (y <= -1.35e-237) {
tmp = t_2;
} else if (y <= 4.1e-275) {
tmp = x;
} else if (y <= 2.05e-196) {
tmp = t_2;
} else if (y <= 2e-106) {
tmp = x;
} else if (y <= 3.8e-64) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t + x) t_2 = z * -t tmp = 0 if y <= -2.7e+39: tmp = t_1 elif y <= -1.35e-43: tmp = t_2 elif y <= -1.42e-105: tmp = x elif y <= -1.35e-237: tmp = t_2 elif y <= 4.1e-275: tmp = x elif y <= 2.05e-196: tmp = t_2 elif y <= 2e-106: tmp = x elif y <= 3.8e-64: 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(-t)) tmp = 0.0 if (y <= -2.7e+39) tmp = t_1; elseif (y <= -1.35e-43) tmp = t_2; elseif (y <= -1.42e-105) tmp = x; elseif (y <= -1.35e-237) tmp = t_2; elseif (y <= 4.1e-275) tmp = x; elseif (y <= 2.05e-196) tmp = t_2; elseif (y <= 2e-106) tmp = x; elseif (y <= 3.8e-64) 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 * -t; tmp = 0.0; if (y <= -2.7e+39) tmp = t_1; elseif (y <= -1.35e-43) tmp = t_2; elseif (y <= -1.42e-105) tmp = x; elseif (y <= -1.35e-237) tmp = t_2; elseif (y <= 4.1e-275) tmp = x; elseif (y <= 2.05e-196) tmp = t_2; elseif (y <= 2e-106) tmp = x; elseif (y <= 3.8e-64) 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 * (-t)), $MachinePrecision]}, If[LessEqual[y, -2.7e+39], t$95$1, If[LessEqual[y, -1.35e-43], t$95$2, If[LessEqual[y, -1.42e-105], x, If[LessEqual[y, -1.35e-237], t$95$2, If[LessEqual[y, 4.1e-275], x, If[LessEqual[y, 2.05e-196], t$95$2, If[LessEqual[y, 2e-106], x, If[LessEqual[y, 3.8e-64], 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(-t\right)\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{+39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-43}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.42 \cdot 10^{-105}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-237}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-275}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-196}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-106}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-64}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.70000000000000003e39 or 3.8000000000000002e-64 < y Initial program 100.0%
Taylor expanded in z around 0 78.8%
Taylor expanded in y around inf 73.8%
sub-neg73.8%
distribute-lft-in72.9%
add-sqr-sqrt41.4%
sqrt-unprod58.1%
sqr-neg58.1%
sqrt-unprod17.6%
add-sqr-sqrt43.7%
Applied egg-rr43.7%
distribute-lft-in45.4%
Simplified45.4%
if -2.70000000000000003e39 < y < -1.34999999999999996e-43 or -1.4199999999999999e-105 < y < -1.34999999999999992e-237 or 4.09999999999999975e-275 < y < 2.05000000000000011e-196 or 1.99999999999999988e-106 < y < 3.8000000000000002e-64Initial program 100.0%
Taylor expanded in t around inf 68.6%
Taylor expanded in y around 0 59.7%
+-commutative59.7%
mul-1-neg59.7%
unsub-neg59.7%
Simplified59.7%
Taylor expanded in x around 0 50.1%
associate-*r*50.1%
neg-mul-150.1%
*-commutative50.1%
Simplified50.1%
if -1.34999999999999996e-43 < y < -1.4199999999999999e-105 or -1.34999999999999992e-237 < y < 4.09999999999999975e-275 or 2.05000000000000011e-196 < y < 1.99999999999999988e-106Initial program 100.0%
Taylor expanded in t around inf 76.2%
Taylor expanded in x around inf 55.7%
Final simplification49.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* z x))) (t_2 (* y (- t x))) (t_3 (- x (* z t))))
(if (<= y -4.2e+19)
t_2
(if (<= y -2.7e-150)
t_3
(if (<= y -3.4e-192)
t_1
(if (<= y 4.8e-214)
t_3
(if (<= y 3.7e-102)
t_1
(if (<= y 3.5e-21) t_3 (if (<= y 23000.0) t_1 t_2)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (z * x);
double t_2 = y * (t - x);
double t_3 = x - (z * t);
double tmp;
if (y <= -4.2e+19) {
tmp = t_2;
} else if (y <= -2.7e-150) {
tmp = t_3;
} else if (y <= -3.4e-192) {
tmp = t_1;
} else if (y <= 4.8e-214) {
tmp = t_3;
} else if (y <= 3.7e-102) {
tmp = t_1;
} else if (y <= 3.5e-21) {
tmp = t_3;
} else if (y <= 23000.0) {
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 = x + (z * x)
t_2 = y * (t - x)
t_3 = x - (z * t)
if (y <= (-4.2d+19)) then
tmp = t_2
else if (y <= (-2.7d-150)) then
tmp = t_3
else if (y <= (-3.4d-192)) then
tmp = t_1
else if (y <= 4.8d-214) then
tmp = t_3
else if (y <= 3.7d-102) then
tmp = t_1
else if (y <= 3.5d-21) then
tmp = t_3
else if (y <= 23000.0d0) 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 = x + (z * x);
double t_2 = y * (t - x);
double t_3 = x - (z * t);
double tmp;
if (y <= -4.2e+19) {
tmp = t_2;
} else if (y <= -2.7e-150) {
tmp = t_3;
} else if (y <= -3.4e-192) {
tmp = t_1;
} else if (y <= 4.8e-214) {
tmp = t_3;
} else if (y <= 3.7e-102) {
tmp = t_1;
} else if (y <= 3.5e-21) {
tmp = t_3;
} else if (y <= 23000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (z * x) t_2 = y * (t - x) t_3 = x - (z * t) tmp = 0 if y <= -4.2e+19: tmp = t_2 elif y <= -2.7e-150: tmp = t_3 elif y <= -3.4e-192: tmp = t_1 elif y <= 4.8e-214: tmp = t_3 elif y <= 3.7e-102: tmp = t_1 elif y <= 3.5e-21: tmp = t_3 elif y <= 23000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(z * x)) t_2 = Float64(y * Float64(t - x)) t_3 = Float64(x - Float64(z * t)) tmp = 0.0 if (y <= -4.2e+19) tmp = t_2; elseif (y <= -2.7e-150) tmp = t_3; elseif (y <= -3.4e-192) tmp = t_1; elseif (y <= 4.8e-214) tmp = t_3; elseif (y <= 3.7e-102) tmp = t_1; elseif (y <= 3.5e-21) tmp = t_3; elseif (y <= 23000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (z * x); t_2 = y * (t - x); t_3 = x - (z * t); tmp = 0.0; if (y <= -4.2e+19) tmp = t_2; elseif (y <= -2.7e-150) tmp = t_3; elseif (y <= -3.4e-192) tmp = t_1; elseif (y <= 4.8e-214) tmp = t_3; elseif (y <= 3.7e-102) tmp = t_1; elseif (y <= 3.5e-21) tmp = t_3; elseif (y <= 23000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.2e+19], t$95$2, If[LessEqual[y, -2.7e-150], t$95$3, If[LessEqual[y, -3.4e-192], t$95$1, If[LessEqual[y, 4.8e-214], t$95$3, If[LessEqual[y, 3.7e-102], t$95$1, If[LessEqual[y, 3.5e-21], t$95$3, If[LessEqual[y, 23000.0], t$95$1, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot x\\
t_2 := y \cdot \left(t - x\right)\\
t_3 := x - z \cdot t\\
\mathbf{if}\;y \leq -4.2 \cdot 10^{+19}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2.7 \cdot 10^{-150}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{-192}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-214}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-21}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 23000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -4.2e19 or 23000 < y Initial program 100.0%
Taylor expanded in z around 0 79.2%
Taylor expanded in y around inf 79.0%
if -4.2e19 < y < -2.7000000000000001e-150 or -3.40000000000000002e-192 < y < 4.80000000000000041e-214 or 3.6999999999999997e-102 < y < 3.5000000000000003e-21Initial program 100.0%
Taylor expanded in t around inf 81.0%
Taylor expanded in y around 0 72.4%
+-commutative72.4%
mul-1-neg72.4%
unsub-neg72.4%
Simplified72.4%
if -2.7000000000000001e-150 < y < -3.40000000000000002e-192 or 4.80000000000000041e-214 < y < 3.6999999999999997e-102 or 3.5000000000000003e-21 < y < 23000Initial program 100.0%
Taylor expanded in x around inf 82.1%
*-commutative82.1%
mul-1-neg82.1%
unsub-neg82.1%
distribute-lft-out--82.1%
*-rgt-identity82.1%
Simplified82.1%
Taylor expanded in y around 0 80.7%
mul-1-neg80.7%
distribute-rgt-neg-in80.7%
Simplified80.7%
Final simplification76.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (* z (- t))))
(if (<= y -4.2e+19)
t_1
(if (<= y -8.2e-233)
t_2
(if (<= y 4.9e-276)
x
(if (<= y 1.2e-196)
t_2
(if (<= y 1.45e-106) x (if (<= y 8.6e-63) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = z * -t;
double tmp;
if (y <= -4.2e+19) {
tmp = t_1;
} else if (y <= -8.2e-233) {
tmp = t_2;
} else if (y <= 4.9e-276) {
tmp = x;
} else if (y <= 1.2e-196) {
tmp = t_2;
} else if (y <= 1.45e-106) {
tmp = x;
} else if (y <= 8.6e-63) {
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 * -t
if (y <= (-4.2d+19)) then
tmp = t_1
else if (y <= (-8.2d-233)) then
tmp = t_2
else if (y <= 4.9d-276) then
tmp = x
else if (y <= 1.2d-196) then
tmp = t_2
else if (y <= 1.45d-106) then
tmp = x
else if (y <= 8.6d-63) 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 * -t;
double tmp;
if (y <= -4.2e+19) {
tmp = t_1;
} else if (y <= -8.2e-233) {
tmp = t_2;
} else if (y <= 4.9e-276) {
tmp = x;
} else if (y <= 1.2e-196) {
tmp = t_2;
} else if (y <= 1.45e-106) {
tmp = x;
} else if (y <= 8.6e-63) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = z * -t tmp = 0 if y <= -4.2e+19: tmp = t_1 elif y <= -8.2e-233: tmp = t_2 elif y <= 4.9e-276: tmp = x elif y <= 1.2e-196: tmp = t_2 elif y <= 1.45e-106: tmp = x elif y <= 8.6e-63: 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(-t)) tmp = 0.0 if (y <= -4.2e+19) tmp = t_1; elseif (y <= -8.2e-233) tmp = t_2; elseif (y <= 4.9e-276) tmp = x; elseif (y <= 1.2e-196) tmp = t_2; elseif (y <= 1.45e-106) tmp = x; elseif (y <= 8.6e-63) 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 * -t; tmp = 0.0; if (y <= -4.2e+19) tmp = t_1; elseif (y <= -8.2e-233) tmp = t_2; elseif (y <= 4.9e-276) tmp = x; elseif (y <= 1.2e-196) tmp = t_2; elseif (y <= 1.45e-106) tmp = x; elseif (y <= 8.6e-63) 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 * (-t)), $MachinePrecision]}, If[LessEqual[y, -4.2e+19], t$95$1, If[LessEqual[y, -8.2e-233], t$95$2, If[LessEqual[y, 4.9e-276], x, If[LessEqual[y, 1.2e-196], t$95$2, If[LessEqual[y, 1.45e-106], x, If[LessEqual[y, 8.6e-63], 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(-t\right)\\
\mathbf{if}\;y \leq -4.2 \cdot 10^{+19}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -8.2 \cdot 10^{-233}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 4.9 \cdot 10^{-276}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-196}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{-106}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{-63}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -4.2e19 or 8.5999999999999997e-63 < y Initial program 100.0%
Taylor expanded in z around 0 77.8%
Taylor expanded in y around inf 73.1%
if -4.2e19 < y < -8.2000000000000009e-233 or 4.89999999999999966e-276 < y < 1.2000000000000001e-196 or 1.45e-106 < y < 8.5999999999999997e-63Initial program 100.0%
Taylor expanded in t around inf 72.2%
Taylor expanded in y around 0 63.7%
+-commutative63.7%
mul-1-neg63.7%
unsub-neg63.7%
Simplified63.7%
Taylor expanded in x around 0 46.4%
associate-*r*46.4%
neg-mul-146.4%
*-commutative46.4%
Simplified46.4%
if -8.2000000000000009e-233 < y < 4.89999999999999966e-276 or 1.2000000000000001e-196 < y < 1.45e-106Initial program 100.0%
Taylor expanded in t around inf 74.8%
Taylor expanded in x around inf 55.1%
Final simplification61.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.8e-41) (not (<= t 2.5e-56))) (+ x (* (- y z) t)) (* x (- (+ z 1.0) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.8e-41) || !(t <= 2.5e-56)) {
tmp = x + ((y - z) * t);
} else {
tmp = x * ((z + 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 <= (-2.8d-41)) .or. (.not. (t <= 2.5d-56))) then
tmp = x + ((y - z) * t)
else
tmp = x * ((z + 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 <= -2.8e-41) || !(t <= 2.5e-56)) {
tmp = x + ((y - z) * t);
} else {
tmp = x * ((z + 1.0) - y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.8e-41) or not (t <= 2.5e-56): tmp = x + ((y - z) * t) else: tmp = x * ((z + 1.0) - y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.8e-41) || !(t <= 2.5e-56)) tmp = Float64(x + Float64(Float64(y - z) * t)); else tmp = Float64(x * Float64(Float64(z + 1.0) - y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.8e-41) || ~((t <= 2.5e-56))) tmp = x + ((y - z) * t); else tmp = x * ((z + 1.0) - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.8e-41], N[Not[LessEqual[t, 2.5e-56]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(z + 1.0), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{-41} \lor \neg \left(t \leq 2.5 \cdot 10^{-56}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\
\end{array}
\end{array}
if t < -2.8000000000000002e-41 or 2.49999999999999999e-56 < t Initial program 100.0%
Taylor expanded in t around inf 87.1%
if -2.8000000000000002e-41 < t < 2.49999999999999999e-56Initial program 100.0%
Taylor expanded in x around inf 91.4%
*-commutative91.4%
mul-1-neg91.4%
unsub-neg91.4%
distribute-lft-out--91.4%
*-rgt-identity91.4%
Simplified91.4%
Taylor expanded in x around 0 91.4%
Final simplification88.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.9e-42) (not (<= t 1.3e-56))) (+ x (* (- y z) t)) (+ x (* x (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.9e-42) || !(t <= 1.3e-56)) {
tmp = x + ((y - z) * t);
} else {
tmp = x + (x * (z - 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 <= (-2.9d-42)) .or. (.not. (t <= 1.3d-56))) then
tmp = x + ((y - z) * t)
else
tmp = x + (x * (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.9e-42) || !(t <= 1.3e-56)) {
tmp = x + ((y - z) * t);
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.9e-42) or not (t <= 1.3e-56): tmp = x + ((y - z) * t) else: tmp = x + (x * (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.9e-42) || !(t <= 1.3e-56)) tmp = Float64(x + Float64(Float64(y - z) * t)); else tmp = Float64(x + Float64(x * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.9e-42) || ~((t <= 1.3e-56))) tmp = x + ((y - z) * t); else tmp = x + (x * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.9e-42], N[Not[LessEqual[t, 1.3e-56]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{-42} \lor \neg \left(t \leq 1.3 \cdot 10^{-56}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\end{array}
\end{array}
if t < -2.9000000000000003e-42 or 1.29999999999999998e-56 < t Initial program 100.0%
Taylor expanded in t around inf 87.1%
if -2.9000000000000003e-42 < t < 1.29999999999999998e-56Initial program 100.0%
sub-neg100.0%
distribute-lft-in100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 96.0%
+-commutative96.0%
associate-+r+96.0%
associate-*r*96.0%
*-commutative96.0%
distribute-rgt-in96.0%
*-commutative96.0%
mul-1-neg96.0%
distribute-lft-in96.0%
distribute-rgt-neg-in96.0%
mul-1-neg96.0%
fma-def97.0%
+-commutative97.0%
mul-1-neg97.0%
sub-neg97.0%
mul-1-neg97.0%
distribute-rgt-neg-in97.0%
distribute-lft-in97.0%
sub-neg97.0%
*-commutative97.0%
Simplified97.0%
Taylor expanded in t around 0 91.2%
associate-*r*91.2%
neg-mul-191.2%
Simplified91.2%
Taylor expanded in x around inf 91.4%
*-commutative91.4%
mul-1-neg91.4%
unsub-neg91.4%
Simplified91.4%
Final simplification88.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -0.066) (not (<= z 5.8e-8))) (- x (* z (- t x))) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.066) || !(z <= 5.8e-8)) {
tmp = x - (z * (t - x));
} 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 <= (-0.066d0)) .or. (.not. (z <= 5.8d-8))) then
tmp = x - (z * (t - x))
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 <= -0.066) || !(z <= 5.8e-8)) {
tmp = x - (z * (t - x));
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -0.066) or not (z <= 5.8e-8): tmp = x - (z * (t - x)) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -0.066) || !(z <= 5.8e-8)) tmp = Float64(x - Float64(z * Float64(t - x))); 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 <= -0.066) || ~((z <= 5.8e-8))) tmp = x - (z * (t - x)); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.066], N[Not[LessEqual[z, 5.8e-8]], $MachinePrecision]], N[(x - N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.066 \lor \neg \left(z \leq 5.8 \cdot 10^{-8}\right):\\
\;\;\;\;x - z \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -0.066000000000000003 or 5.8000000000000003e-8 < z Initial program 100.0%
Taylor expanded in y around 0 86.6%
+-commutative86.6%
mul-1-neg86.6%
unsub-neg86.6%
*-commutative86.6%
Simplified86.6%
if -0.066000000000000003 < z < 5.8000000000000003e-8Initial program 100.0%
Taylor expanded in z around 0 92.2%
Final simplification89.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.5e+65) (not (<= z 1.7e+43))) (* z (- t)) (+ x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.5e+65) || !(z <= 1.7e+43)) {
tmp = z * -t;
} else {
tmp = x + (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 ((z <= (-5.5d+65)) .or. (.not. (z <= 1.7d+43))) then
tmp = z * -t
else
tmp = x + (y * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.5e+65) || !(z <= 1.7e+43)) {
tmp = z * -t;
} else {
tmp = x + (y * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.5e+65) or not (z <= 1.7e+43): tmp = z * -t else: tmp = x + (y * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.5e+65) || !(z <= 1.7e+43)) tmp = Float64(z * Float64(-t)); else tmp = Float64(x + Float64(y * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.5e+65) || ~((z <= 1.7e+43))) tmp = z * -t; else tmp = x + (y * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.5e+65], N[Not[LessEqual[z, 1.7e+43]], $MachinePrecision]], N[(z * (-t)), $MachinePrecision], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+65} \lor \neg \left(z \leq 1.7 \cdot 10^{+43}\right):\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot t\\
\end{array}
\end{array}
if z < -5.4999999999999996e65 or 1.70000000000000006e43 < z Initial program 100.0%
Taylor expanded in t around inf 55.8%
Taylor expanded in y around 0 50.7%
+-commutative50.7%
mul-1-neg50.7%
unsub-neg50.7%
Simplified50.7%
Taylor expanded in x around 0 50.2%
associate-*r*50.2%
neg-mul-150.2%
*-commutative50.2%
Simplified50.2%
if -5.4999999999999996e65 < z < 1.70000000000000006e43Initial program 100.0%
Taylor expanded in t around inf 73.6%
Taylor expanded in z around 0 65.4%
Final simplification59.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.2e+19) (not (<= y 10500000000.0))) (* y (- t x)) (- x (* z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.2e+19) || !(y <= 10500000000.0)) {
tmp = y * (t - x);
} else {
tmp = x - (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 ((y <= (-4.2d+19)) .or. (.not. (y <= 10500000000.0d0))) then
tmp = y * (t - x)
else
tmp = x - (z * 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+19) || !(y <= 10500000000.0)) {
tmp = y * (t - x);
} else {
tmp = x - (z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.2e+19) or not (y <= 10500000000.0): tmp = y * (t - x) else: tmp = x - (z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.2e+19) || !(y <= 10500000000.0)) tmp = Float64(y * Float64(t - x)); else tmp = Float64(x - Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4.2e+19) || ~((y <= 10500000000.0))) tmp = y * (t - x); else tmp = x - (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.2e+19], N[Not[LessEqual[y, 10500000000.0]], $MachinePrecision]], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+19} \lor \neg \left(y \leq 10500000000\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot t\\
\end{array}
\end{array}
if y < -4.2e19 or 1.05e10 < y Initial program 100.0%
Taylor expanded in z around 0 79.9%
Taylor expanded in y around inf 79.6%
if -4.2e19 < y < 1.05e10Initial program 100.0%
Taylor expanded in t around inf 73.6%
Taylor expanded in y around 0 64.4%
+-commutative64.4%
mul-1-neg64.4%
unsub-neg64.4%
Simplified64.4%
Final simplification71.0%
(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 -0.0029) (not (<= z 2.5e-17))) (* z (- t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.0029) || !(z <= 2.5e-17)) {
tmp = 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 ((z <= (-0.0029d0)) .or. (.not. (z <= 2.5d-17))) then
tmp = 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 ((z <= -0.0029) || !(z <= 2.5e-17)) {
tmp = z * -t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -0.0029) or not (z <= 2.5e-17): tmp = z * -t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -0.0029) || !(z <= 2.5e-17)) tmp = Float64(z * Float64(-t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -0.0029) || ~((z <= 2.5e-17))) tmp = z * -t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.0029], N[Not[LessEqual[z, 2.5e-17]], $MachinePrecision]], N[(z * (-t)), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0029 \lor \neg \left(z \leq 2.5 \cdot 10^{-17}\right):\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -0.0029 or 2.4999999999999999e-17 < z Initial program 100.0%
Taylor expanded in t around inf 53.6%
Taylor expanded in y around 0 44.9%
+-commutative44.9%
mul-1-neg44.9%
unsub-neg44.9%
Simplified44.9%
Taylor expanded in x around 0 44.2%
associate-*r*44.2%
neg-mul-144.2%
*-commutative44.2%
Simplified44.2%
if -0.0029 < z < 2.4999999999999999e-17Initial program 100.0%
Taylor expanded in t around inf 78.8%
Taylor expanded in x around inf 35.8%
Final simplification39.8%
(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 66.7%
Taylor expanded in x around inf 20.1%
Final simplification20.1%
(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 2023230
(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))))