
(FPCore (x y z t) :precision binary64 (+ x (/ (* (- y x) z) t)))
double code(double x, double y, double z, double t) {
return x + (((y - x) * z) / t);
}
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 - x) * z) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + (((y - x) * z) / t);
}
def code(x, y, z, t): return x + (((y - x) * z) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(y - x) * z) / t)) end
function tmp = code(x, y, z, t) tmp = x + (((y - x) * z) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot z}{t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (/ (* (- y x) z) t)))
double code(double x, double y, double z, double t) {
return x + (((y - x) * z) / t);
}
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 - x) * z) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + (((y - x) * z) / t);
}
def code(x, y, z, t): return x + (((y - x) * z) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(y - x) * z) / t)) end
function tmp = code(x, y, z, t) tmp = x + (((y - x) * z) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot z}{t}
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (/ (- y x) (/ t z))))
double code(double x, double y, double z, double t) {
return x + ((y - x) / (t / 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 + ((y - x) / (t / z))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - x) / (t / z));
}
def code(x, y, z, t): return x + ((y - x) / (t / z))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - x) / Float64(t / z))) end
function tmp = code(x, y, z, t) tmp = x + ((y - x) / (t / z)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - x}{\frac{t}{z}}
\end{array}
Initial program 92.4%
associate-/l*96.5%
Simplified96.5%
Final simplification96.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (/ (* (- y x) z) t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 INFINITY)))
(+ x (* z (/ (- y x) t)))
t_1)))
double code(double x, double y, double z, double t) {
double t_1 = x + (((y - x) * z) / t);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= ((double) INFINITY))) {
tmp = x + (z * ((y - x) / t));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x + (((y - x) * z) / t);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= Double.POSITIVE_INFINITY)) {
tmp = x + (z * ((y - x) / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (((y - x) * z) / t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= math.inf): tmp = x + (z * ((y - x) / t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(Float64(y - x) * z) / t)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= Inf)) tmp = Float64(x + Float64(z * Float64(Float64(y - x) / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (((y - x) * z) / t); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= Inf))) tmp = x + (z * ((y - x) / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]], N[(x + N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq \infty\right):\\
\;\;\;\;x + z \cdot \frac{y - x}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) < -inf.0 or +inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) Initial program 85.0%
associate-*l/94.8%
Applied egg-rr100.0%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) < +inf.0Initial program 93.7%
Final simplification94.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (/ (- x) t))) (t_2 (/ y (/ t z))))
(if (<= z -8.6e-38)
t_2
(if (<= z 4.9e-73)
x
(if (<= z 4.3e-6)
t_1
(if (<= z 8.1e+80) x (if (<= z 1.05e+171) 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 / z);
double tmp;
if (z <= -8.6e-38) {
tmp = t_2;
} else if (z <= 4.9e-73) {
tmp = x;
} else if (z <= 4.3e-6) {
tmp = t_1;
} else if (z <= 8.1e+80) {
tmp = x;
} else if (z <= 1.05e+171) {
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 / z)
if (z <= (-8.6d-38)) then
tmp = t_2
else if (z <= 4.9d-73) then
tmp = x
else if (z <= 4.3d-6) then
tmp = t_1
else if (z <= 8.1d+80) then
tmp = x
else if (z <= 1.05d+171) 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 / z);
double tmp;
if (z <= -8.6e-38) {
tmp = t_2;
} else if (z <= 4.9e-73) {
tmp = x;
} else if (z <= 4.3e-6) {
tmp = t_1;
} else if (z <= 8.1e+80) {
tmp = x;
} else if (z <= 1.05e+171) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (-x / t) t_2 = y / (t / z) tmp = 0 if z <= -8.6e-38: tmp = t_2 elif z <= 4.9e-73: tmp = x elif z <= 4.3e-6: tmp = t_1 elif z <= 8.1e+80: tmp = x elif z <= 1.05e+171: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(Float64(-x) / t)) t_2 = Float64(y / Float64(t / z)) tmp = 0.0 if (z <= -8.6e-38) tmp = t_2; elseif (z <= 4.9e-73) tmp = x; elseif (z <= 4.3e-6) tmp = t_1; elseif (z <= 8.1e+80) tmp = x; elseif (z <= 1.05e+171) 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 / z); tmp = 0.0; if (z <= -8.6e-38) tmp = t_2; elseif (z <= 4.9e-73) tmp = x; elseif (z <= 4.3e-6) tmp = t_1; elseif (z <= 8.1e+80) tmp = x; elseif (z <= 1.05e+171) 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 / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.6e-38], t$95$2, If[LessEqual[z, 4.9e-73], x, If[LessEqual[z, 4.3e-6], t$95$1, If[LessEqual[z, 8.1e+80], x, If[LessEqual[z, 1.05e+171], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{-x}{t}\\
t_2 := \frac{y}{\frac{t}{z}}\\
\mathbf{if}\;z \leq -8.6 \cdot 10^{-38}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{-73}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8.1 \cdot 10^{+80}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+171}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -8.6000000000000004e-38 or 1.0500000000000001e171 < z Initial program 87.5%
+-commutative87.5%
*-commutative87.5%
associate-*l/95.5%
fma-def95.5%
Simplified95.5%
Taylor expanded in t around 0 82.4%
Taylor expanded in y around inf 56.7%
associate-*r/64.7%
Simplified64.7%
clear-num64.6%
un-div-inv64.7%
Applied egg-rr64.7%
if -8.6000000000000004e-38 < z < 4.90000000000000028e-73 or 4.30000000000000033e-6 < z < 8.10000000000000002e80Initial program 97.4%
+-commutative97.4%
*-commutative97.4%
associate-*l/99.1%
fma-def99.1%
Simplified99.1%
Taylor expanded in z around 0 68.9%
if 4.90000000000000028e-73 < z < 4.30000000000000033e-6 or 8.10000000000000002e80 < z < 1.0500000000000001e171Initial program 91.2%
+-commutative91.2%
*-commutative91.2%
associate-*l/89.1%
fma-def89.1%
Simplified89.1%
Taylor expanded in t around 0 78.6%
Taylor expanded in y around 0 59.0%
associate-*r/59.0%
mul-1-neg59.0%
distribute-rgt-neg-out59.0%
associate-*l/59.4%
Simplified59.4%
Taylor expanded in z around 0 59.0%
associate-*r/56.8%
neg-mul-156.8%
distribute-rgt-neg-in56.8%
distribute-neg-frac56.8%
Simplified56.8%
Final simplification65.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- z) t))) (t_2 (/ y (/ t z))))
(if (<= z -1.42e-39)
t_2
(if (<= z 2.1e-118)
x
(if (<= z 5.5e-6)
t_1
(if (<= z 2.1e+80) x (if (<= z 6.5e+171) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (-z / t);
double t_2 = y / (t / z);
double tmp;
if (z <= -1.42e-39) {
tmp = t_2;
} else if (z <= 2.1e-118) {
tmp = x;
} else if (z <= 5.5e-6) {
tmp = t_1;
} else if (z <= 2.1e+80) {
tmp = x;
} else if (z <= 6.5e+171) {
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 = x * (-z / t)
t_2 = y / (t / z)
if (z <= (-1.42d-39)) then
tmp = t_2
else if (z <= 2.1d-118) then
tmp = x
else if (z <= 5.5d-6) then
tmp = t_1
else if (z <= 2.1d+80) then
tmp = x
else if (z <= 6.5d+171) 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 / t);
double t_2 = y / (t / z);
double tmp;
if (z <= -1.42e-39) {
tmp = t_2;
} else if (z <= 2.1e-118) {
tmp = x;
} else if (z <= 5.5e-6) {
tmp = t_1;
} else if (z <= 2.1e+80) {
tmp = x;
} else if (z <= 6.5e+171) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (-z / t) t_2 = y / (t / z) tmp = 0 if z <= -1.42e-39: tmp = t_2 elif z <= 2.1e-118: tmp = x elif z <= 5.5e-6: tmp = t_1 elif z <= 2.1e+80: tmp = x elif z <= 6.5e+171: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(-z) / t)) t_2 = Float64(y / Float64(t / z)) tmp = 0.0 if (z <= -1.42e-39) tmp = t_2; elseif (z <= 2.1e-118) tmp = x; elseif (z <= 5.5e-6) tmp = t_1; elseif (z <= 2.1e+80) tmp = x; elseif (z <= 6.5e+171) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (-z / t); t_2 = y / (t / z); tmp = 0.0; if (z <= -1.42e-39) tmp = t_2; elseif (z <= 2.1e-118) tmp = x; elseif (z <= 5.5e-6) tmp = t_1; elseif (z <= 2.1e+80) tmp = x; elseif (z <= 6.5e+171) 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) / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.42e-39], t$95$2, If[LessEqual[z, 2.1e-118], x, If[LessEqual[z, 5.5e-6], t$95$1, If[LessEqual[z, 2.1e+80], x, If[LessEqual[z, 6.5e+171], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{-z}{t}\\
t_2 := \frac{y}{\frac{t}{z}}\\
\mathbf{if}\;z \leq -1.42 \cdot 10^{-39}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-118}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+80}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+171}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.42000000000000005e-39 or 6.5e171 < z Initial program 87.5%
+-commutative87.5%
*-commutative87.5%
associate-*l/95.5%
fma-def95.5%
Simplified95.5%
Taylor expanded in t around 0 82.4%
Taylor expanded in y around inf 56.7%
associate-*r/64.7%
Simplified64.7%
clear-num64.6%
un-div-inv64.7%
Applied egg-rr64.7%
if -1.42000000000000005e-39 < z < 2.1e-118 or 5.4999999999999999e-6 < z < 2.10000000000000001e80Initial program 97.1%
+-commutative97.1%
*-commutative97.1%
associate-*l/99.0%
fma-def99.0%
Simplified99.0%
Taylor expanded in z around 0 72.3%
if 2.1e-118 < z < 5.4999999999999999e-6 or 2.10000000000000001e80 < z < 6.5e171Initial program 93.1%
+-commutative93.1%
*-commutative93.1%
associate-*l/91.5%
fma-def91.5%
Simplified91.5%
Taylor expanded in t around 0 76.5%
Taylor expanded in y around 0 54.7%
associate-*r/54.7%
mul-1-neg54.7%
distribute-rgt-neg-out54.7%
associate-*l/55.2%
Simplified55.2%
Final simplification66.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ y (/ t z))))
(if (<= z -1.15e-37)
t_1
(if (<= z 2.8e-119)
x
(if (<= z 1.76e-6)
(/ (* x z) (- t))
(if (<= z 1.6e+79) x (if (<= z 1.2e+171) (* x (/ (- z) t)) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = y / (t / z);
double tmp;
if (z <= -1.15e-37) {
tmp = t_1;
} else if (z <= 2.8e-119) {
tmp = x;
} else if (z <= 1.76e-6) {
tmp = (x * z) / -t;
} else if (z <= 1.6e+79) {
tmp = x;
} else if (z <= 1.2e+171) {
tmp = x * (-z / 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 = y / (t / z)
if (z <= (-1.15d-37)) then
tmp = t_1
else if (z <= 2.8d-119) then
tmp = x
else if (z <= 1.76d-6) then
tmp = (x * z) / -t
else if (z <= 1.6d+79) then
tmp = x
else if (z <= 1.2d+171) then
tmp = x * (-z / 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 = y / (t / z);
double tmp;
if (z <= -1.15e-37) {
tmp = t_1;
} else if (z <= 2.8e-119) {
tmp = x;
} else if (z <= 1.76e-6) {
tmp = (x * z) / -t;
} else if (z <= 1.6e+79) {
tmp = x;
} else if (z <= 1.2e+171) {
tmp = x * (-z / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y / (t / z) tmp = 0 if z <= -1.15e-37: tmp = t_1 elif z <= 2.8e-119: tmp = x elif z <= 1.76e-6: tmp = (x * z) / -t elif z <= 1.6e+79: tmp = x elif z <= 1.2e+171: tmp = x * (-z / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y / Float64(t / z)) tmp = 0.0 if (z <= -1.15e-37) tmp = t_1; elseif (z <= 2.8e-119) tmp = x; elseif (z <= 1.76e-6) tmp = Float64(Float64(x * z) / Float64(-t)); elseif (z <= 1.6e+79) tmp = x; elseif (z <= 1.2e+171) tmp = Float64(x * Float64(Float64(-z) / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y / (t / z); tmp = 0.0; if (z <= -1.15e-37) tmp = t_1; elseif (z <= 2.8e-119) tmp = x; elseif (z <= 1.76e-6) tmp = (x * z) / -t; elseif (z <= 1.6e+79) tmp = x; elseif (z <= 1.2e+171) tmp = x * (-z / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e-37], t$95$1, If[LessEqual[z, 2.8e-119], x, If[LessEqual[z, 1.76e-6], N[(N[(x * z), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[z, 1.6e+79], x, If[LessEqual[z, 1.2e+171], N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{\frac{t}{z}}\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-119}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.76 \cdot 10^{-6}:\\
\;\;\;\;\frac{x \cdot z}{-t}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+79}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+171}:\\
\;\;\;\;x \cdot \frac{-z}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.15e-37 or 1.19999999999999999e171 < z Initial program 87.5%
+-commutative87.5%
*-commutative87.5%
associate-*l/95.5%
fma-def95.5%
Simplified95.5%
Taylor expanded in t around 0 82.4%
Taylor expanded in y around inf 56.7%
associate-*r/64.7%
Simplified64.7%
clear-num64.6%
un-div-inv64.7%
Applied egg-rr64.7%
if -1.15e-37 < z < 2.8e-119 or 1.7600000000000001e-6 < z < 1.60000000000000001e79Initial program 97.1%
+-commutative97.1%
*-commutative97.1%
associate-*l/99.0%
fma-def99.0%
Simplified99.0%
Taylor expanded in z around 0 72.3%
if 2.8e-119 < z < 1.7600000000000001e-6Initial program 99.7%
+-commutative99.7%
*-commutative99.7%
associate-*l/99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in t around 0 73.1%
Taylor expanded in y around 0 53.1%
associate-*r/53.1%
mul-1-neg53.1%
distribute-rgt-neg-out53.1%
associate-*l/53.1%
Simplified53.1%
associate-*l/53.1%
frac-2neg53.1%
add-sqr-sqrt19.7%
sqrt-unprod13.9%
sqr-neg13.9%
sqrt-unprod1.0%
add-sqr-sqrt1.7%
distribute-rgt-neg-out1.7%
add-sqr-sqrt0.7%
sqrt-unprod26.5%
sqr-neg26.5%
sqrt-unprod33.4%
add-sqr-sqrt53.1%
Applied egg-rr53.1%
if 1.60000000000000001e79 < z < 1.19999999999999999e171Initial program 85.2%
+-commutative85.2%
*-commutative85.2%
associate-*l/81.8%
fma-def81.8%
Simplified81.8%
Taylor expanded in t around 0 80.5%
Taylor expanded in y around 0 56.7%
associate-*r/56.7%
mul-1-neg56.7%
distribute-rgt-neg-out56.7%
associate-*l/57.6%
Simplified57.6%
Final simplification66.2%
(FPCore (x y z t)
:precision binary64
(if (or (<= z -2.8e-90)
(and (not (<= z 1.55e-120)) (or (<= z 0.07) (not (<= z 5.4e+76)))))
(* z (/ (- y x) t))
x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.8e-90) || (!(z <= 1.55e-120) && ((z <= 0.07) || !(z <= 5.4e+76)))) {
tmp = z * ((y - x) / 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 <= (-2.8d-90)) .or. (.not. (z <= 1.55d-120)) .and. (z <= 0.07d0) .or. (.not. (z <= 5.4d+76))) then
tmp = z * ((y - x) / 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 <= -2.8e-90) || (!(z <= 1.55e-120) && ((z <= 0.07) || !(z <= 5.4e+76)))) {
tmp = z * ((y - x) / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.8e-90) or (not (z <= 1.55e-120) and ((z <= 0.07) or not (z <= 5.4e+76))): tmp = z * ((y - x) / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.8e-90) || (!(z <= 1.55e-120) && ((z <= 0.07) || !(z <= 5.4e+76)))) tmp = Float64(z * Float64(Float64(y - x) / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.8e-90) || (~((z <= 1.55e-120)) && ((z <= 0.07) || ~((z <= 5.4e+76))))) tmp = z * ((y - x) / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.8e-90], And[N[Not[LessEqual[z, 1.55e-120]], $MachinePrecision], Or[LessEqual[z, 0.07], N[Not[LessEqual[z, 5.4e+76]], $MachinePrecision]]]], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-90} \lor \neg \left(z \leq 1.55 \cdot 10^{-120}\right) \land \left(z \leq 0.07 \lor \neg \left(z \leq 5.4 \cdot 10^{+76}\right)\right):\\
\;\;\;\;z \cdot \frac{y - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.7999999999999999e-90 or 1.5500000000000001e-120 < z < 0.070000000000000007 or 5.3999999999999998e76 < z Initial program 89.7%
+-commutative89.7%
*-commutative89.7%
associate-*l/94.6%
fma-def94.6%
Simplified94.6%
Taylor expanded in t around 0 79.8%
associate-*l/83.6%
Applied egg-rr83.6%
if -2.7999999999999999e-90 < z < 1.5500000000000001e-120 or 0.070000000000000007 < z < 5.3999999999999998e76Initial program 96.9%
+-commutative96.9%
*-commutative96.9%
associate-*l/99.0%
fma-def99.0%
Simplified99.0%
Taylor expanded in z around 0 75.1%
Final simplification80.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (/ (- y x) t))))
(if (<= z -4e-14)
t_1
(if (<= z 4.9e-80)
(+ x (/ y (/ t z)))
(if (<= z 3.1e-9)
(- x (* z (/ x t)))
(if (<= z 1.02e+77) (+ x (* y (/ z t))) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * ((y - x) / t);
double tmp;
if (z <= -4e-14) {
tmp = t_1;
} else if (z <= 4.9e-80) {
tmp = x + (y / (t / z));
} else if (z <= 3.1e-9) {
tmp = x - (z * (x / t));
} else if (z <= 1.02e+77) {
tmp = x + (y * (z / 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 * ((y - x) / t)
if (z <= (-4d-14)) then
tmp = t_1
else if (z <= 4.9d-80) then
tmp = x + (y / (t / z))
else if (z <= 3.1d-9) then
tmp = x - (z * (x / t))
else if (z <= 1.02d+77) then
tmp = x + (y * (z / 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 * ((y - x) / t);
double tmp;
if (z <= -4e-14) {
tmp = t_1;
} else if (z <= 4.9e-80) {
tmp = x + (y / (t / z));
} else if (z <= 3.1e-9) {
tmp = x - (z * (x / t));
} else if (z <= 1.02e+77) {
tmp = x + (y * (z / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * ((y - x) / t) tmp = 0 if z <= -4e-14: tmp = t_1 elif z <= 4.9e-80: tmp = x + (y / (t / z)) elif z <= 3.1e-9: tmp = x - (z * (x / t)) elif z <= 1.02e+77: tmp = x + (y * (z / t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(Float64(y - x) / t)) tmp = 0.0 if (z <= -4e-14) tmp = t_1; elseif (z <= 4.9e-80) tmp = Float64(x + Float64(y / Float64(t / z))); elseif (z <= 3.1e-9) tmp = Float64(x - Float64(z * Float64(x / t))); elseif (z <= 1.02e+77) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * ((y - x) / t); tmp = 0.0; if (z <= -4e-14) tmp = t_1; elseif (z <= 4.9e-80) tmp = x + (y / (t / z)); elseif (z <= 3.1e-9) tmp = x - (z * (x / t)); elseif (z <= 1.02e+77) tmp = x + (y * (z / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e-14], t$95$1, If[LessEqual[z, 4.9e-80], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e-9], N[(x - N[(z * N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e+77], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y - x}{t}\\
\mathbf{if}\;z \leq -4 \cdot 10^{-14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{-80}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-9}:\\
\;\;\;\;x - z \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+77}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4e-14 or 1.02e77 < z Initial program 86.5%
+-commutative86.5%
*-commutative86.5%
associate-*l/93.0%
fma-def93.0%
Simplified93.0%
Taylor expanded in t around 0 82.0%
associate-*l/90.5%
Applied egg-rr90.5%
if -4e-14 < z < 4.8999999999999999e-80Initial program 98.8%
Taylor expanded in y around inf 88.3%
associate-*r/24.3%
Simplified87.4%
clear-num24.3%
un-div-inv24.4%
Applied egg-rr87.4%
if 4.8999999999999999e-80 < z < 3.10000000000000005e-9Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l/99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in y around 0 93.0%
fma-def93.0%
*-commutative93.0%
associate-*r/92.7%
fma-def92.7%
neg-mul-192.7%
+-commutative92.7%
unsub-neg92.7%
*-commutative92.7%
associate-/r/87.5%
Simplified87.5%
clear-num87.3%
associate-/r/87.3%
clear-num87.3%
Applied egg-rr87.3%
if 3.10000000000000005e-9 < z < 1.02e77Initial program 91.7%
Taylor expanded in y around inf 91.0%
associate-*r/32.1%
Simplified91.1%
Final simplification89.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -7.6e-116) (not (<= x 1.55e-27))) (- x (* x (/ z t))) (+ x (* (* y z) (/ 1.0 t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.6e-116) || !(x <= 1.55e-27)) {
tmp = x - (x * (z / t));
} else {
tmp = x + ((y * z) * (1.0 / 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 <= (-7.6d-116)) .or. (.not. (x <= 1.55d-27))) then
tmp = x - (x * (z / t))
else
tmp = x + ((y * z) * (1.0d0 / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.6e-116) || !(x <= 1.55e-27)) {
tmp = x - (x * (z / t));
} else {
tmp = x + ((y * z) * (1.0 / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7.6e-116) or not (x <= 1.55e-27): tmp = x - (x * (z / t)) else: tmp = x + ((y * z) * (1.0 / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7.6e-116) || !(x <= 1.55e-27)) tmp = Float64(x - Float64(x * Float64(z / t))); else tmp = Float64(x + Float64(Float64(y * z) * Float64(1.0 / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -7.6e-116) || ~((x <= 1.55e-27))) tmp = x - (x * (z / t)); else tmp = x + ((y * z) * (1.0 / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7.6e-116], N[Not[LessEqual[x, 1.55e-27]], $MachinePrecision]], N[(x - N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.6 \cdot 10^{-116} \lor \neg \left(x \leq 1.55 \cdot 10^{-27}\right):\\
\;\;\;\;x - x \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot z\right) \cdot \frac{1}{t}\\
\end{array}
\end{array}
if x < -7.6000000000000003e-116 or 1.5499999999999999e-27 < x Initial program 90.9%
Taylor expanded in y around 0 84.9%
associate-*r/42.9%
mul-1-neg42.9%
distribute-rgt-neg-out42.9%
associate-*l/44.8%
Simplified90.7%
if -7.6000000000000003e-116 < x < 1.5499999999999999e-27Initial program 94.5%
Taylor expanded in y around inf 87.0%
associate-*r/65.2%
Simplified85.5%
clear-num65.1%
un-div-inv65.5%
Applied egg-rr85.8%
div-inv85.5%
clear-num85.5%
div-inv85.5%
associate-*r*87.0%
Applied egg-rr87.0%
Final simplification89.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.4e+57) (not (<= t 8e+36))) (+ x (* y (/ z t))) (* z (/ (- y x) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.4e+57) || !(t <= 8e+36)) {
tmp = x + (y * (z / t));
} else {
tmp = z * ((y - x) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-1.4d+57)) .or. (.not. (t <= 8d+36))) then
tmp = x + (y * (z / t))
else
tmp = z * ((y - x) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.4e+57) || !(t <= 8e+36)) {
tmp = x + (y * (z / t));
} else {
tmp = z * ((y - x) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.4e+57) or not (t <= 8e+36): tmp = x + (y * (z / t)) else: tmp = z * ((y - x) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.4e+57) || !(t <= 8e+36)) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(z * Float64(Float64(y - x) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.4e+57) || ~((t <= 8e+36))) tmp = x + (y * (z / t)); else tmp = z * ((y - x) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.4e+57], N[Not[LessEqual[t, 8e+36]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+57} \lor \neg \left(t \leq 8 \cdot 10^{+36}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y - x}{t}\\
\end{array}
\end{array}
if t < -1.4e57 or 8.00000000000000034e36 < t Initial program 83.5%
Taylor expanded in y around inf 82.6%
associate-*r/28.5%
Simplified92.6%
if -1.4e57 < t < 8.00000000000000034e36Initial program 99.1%
+-commutative99.1%
*-commutative99.1%
associate-*l/94.2%
fma-def94.2%
Simplified94.2%
Taylor expanded in t around 0 85.4%
associate-*l/80.6%
Applied egg-rr80.6%
Final simplification85.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.4e+57) (not (<= t 5.8e+37))) (+ x (* y (/ z t))) (/ (* (- y x) z) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.4e+57) || !(t <= 5.8e+37)) {
tmp = x + (y * (z / t));
} else {
tmp = ((y - 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 ((t <= (-1.4d+57)) .or. (.not. (t <= 5.8d+37))) then
tmp = x + (y * (z / t))
else
tmp = ((y - x) * z) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.4e+57) || !(t <= 5.8e+37)) {
tmp = x + (y * (z / t));
} else {
tmp = ((y - x) * z) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.4e+57) or not (t <= 5.8e+37): tmp = x + (y * (z / t)) else: tmp = ((y - x) * z) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.4e+57) || !(t <= 5.8e+37)) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(Float64(Float64(y - x) * z) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.4e+57) || ~((t <= 5.8e+37))) tmp = x + (y * (z / t)); else tmp = ((y - x) * z) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.4e+57], N[Not[LessEqual[t, 5.8e+37]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+57} \lor \neg \left(t \leq 5.8 \cdot 10^{+37}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot z}{t}\\
\end{array}
\end{array}
if t < -1.4e57 or 5.79999999999999957e37 < t Initial program 83.4%
Taylor expanded in y around inf 82.4%
associate-*r/27.9%
Simplified92.5%
if -1.4e57 < t < 5.79999999999999957e37Initial program 99.1%
+-commutative99.1%
*-commutative99.1%
associate-*l/94.2%
fma-def94.2%
Simplified94.2%
Taylor expanded in t around 0 85.5%
Final simplification88.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -7.6e-116) (not (<= x 1.05e-27))) (- x (* x (/ z t))) (+ x (/ y (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.6e-116) || !(x <= 1.05e-27)) {
tmp = x - (x * (z / t));
} else {
tmp = x + (y / (t / z));
}
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 <= (-7.6d-116)) .or. (.not. (x <= 1.05d-27))) then
tmp = x - (x * (z / t))
else
tmp = x + (y / (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.6e-116) || !(x <= 1.05e-27)) {
tmp = x - (x * (z / t));
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7.6e-116) or not (x <= 1.05e-27): tmp = x - (x * (z / t)) else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7.6e-116) || !(x <= 1.05e-27)) tmp = Float64(x - Float64(x * Float64(z / t))); else tmp = Float64(x + Float64(y / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -7.6e-116) || ~((x <= 1.05e-27))) tmp = x - (x * (z / t)); else tmp = x + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7.6e-116], N[Not[LessEqual[x, 1.05e-27]], $MachinePrecision]], N[(x - N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.6 \cdot 10^{-116} \lor \neg \left(x \leq 1.05 \cdot 10^{-27}\right):\\
\;\;\;\;x - x \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if x < -7.6000000000000003e-116 or 1.05000000000000008e-27 < x Initial program 90.9%
Taylor expanded in y around 0 84.9%
associate-*r/42.9%
mul-1-neg42.9%
distribute-rgt-neg-out42.9%
associate-*l/44.8%
Simplified90.7%
if -7.6000000000000003e-116 < x < 1.05000000000000008e-27Initial program 94.5%
Taylor expanded in y around inf 87.0%
associate-*r/65.2%
Simplified85.5%
clear-num65.1%
un-div-inv65.5%
Applied egg-rr85.8%
Final simplification88.6%
(FPCore (x y z t) :precision binary64 (if (<= t -1.52e+57) (+ x (* y (/ z t))) (if (<= t 9.5e+36) (* z (/ (- y x) t)) (+ x (/ y (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.52e+57) {
tmp = x + (y * (z / t));
} else if (t <= 9.5e+36) {
tmp = z * ((y - x) / t);
} else {
tmp = x + (y / (t / z));
}
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 <= (-1.52d+57)) then
tmp = x + (y * (z / t))
else if (t <= 9.5d+36) then
tmp = z * ((y - x) / t)
else
tmp = x + (y / (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.52e+57) {
tmp = x + (y * (z / t));
} else if (t <= 9.5e+36) {
tmp = z * ((y - x) / t);
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.52e+57: tmp = x + (y * (z / t)) elif t <= 9.5e+36: tmp = z * ((y - x) / t) else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.52e+57) tmp = Float64(x + Float64(y * Float64(z / t))); elseif (t <= 9.5e+36) tmp = Float64(z * Float64(Float64(y - x) / t)); else tmp = Float64(x + Float64(y / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.52e+57) tmp = x + (y * (z / t)); elseif (t <= 9.5e+36) tmp = z * ((y - x) / t); else tmp = x + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.52e+57], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e+36], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.52 \cdot 10^{+57}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+36}:\\
\;\;\;\;z \cdot \frac{y - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if t < -1.51999999999999998e57Initial program 83.6%
Taylor expanded in y around inf 81.9%
associate-*r/24.6%
Simplified93.0%
if -1.51999999999999998e57 < t < 9.49999999999999974e36Initial program 99.1%
+-commutative99.1%
*-commutative99.1%
associate-*l/94.2%
fma-def94.2%
Simplified94.2%
Taylor expanded in t around 0 85.4%
associate-*l/80.6%
Applied egg-rr80.6%
if 9.49999999999999974e36 < t Initial program 83.5%
Taylor expanded in y around inf 83.3%
associate-*r/33.0%
Simplified92.0%
clear-num32.9%
un-div-inv33.0%
Applied egg-rr92.0%
Final simplification85.7%
(FPCore (x y z t) :precision binary64 (if (<= x -7.6e-116) (- x (* z (/ x t))) (if (<= x 2.8e-27) (+ x (/ y (/ t z))) (- x (/ z (/ t x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -7.6e-116) {
tmp = x - (z * (x / t));
} else if (x <= 2.8e-27) {
tmp = x + (y / (t / z));
} 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 (x <= (-7.6d-116)) then
tmp = x - (z * (x / t))
else if (x <= 2.8d-27) then
tmp = x + (y / (t / z))
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 (x <= -7.6e-116) {
tmp = x - (z * (x / t));
} else if (x <= 2.8e-27) {
tmp = x + (y / (t / z));
} else {
tmp = x - (z / (t / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -7.6e-116: tmp = x - (z * (x / t)) elif x <= 2.8e-27: tmp = x + (y / (t / z)) else: tmp = x - (z / (t / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -7.6e-116) tmp = Float64(x - Float64(z * Float64(x / t))); elseif (x <= 2.8e-27) tmp = Float64(x + Float64(y / Float64(t / z))); 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 (x <= -7.6e-116) tmp = x - (z * (x / t)); elseif (x <= 2.8e-27) tmp = x + (y / (t / z)); else tmp = x - (z / (t / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -7.6e-116], N[(x - N[(z * N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.8e-27], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z / N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.6 \cdot 10^{-116}:\\
\;\;\;\;x - z \cdot \frac{x}{t}\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-27}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z}{\frac{t}{x}}\\
\end{array}
\end{array}
if x < -7.6000000000000003e-116Initial program 88.4%
+-commutative88.4%
*-commutative88.4%
associate-*l/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in y around 0 81.8%
fma-def81.8%
*-commutative81.8%
associate-*r/88.2%
fma-def88.2%
neg-mul-188.2%
+-commutative88.2%
unsub-neg88.2%
*-commutative88.2%
associate-/r/83.7%
Simplified83.7%
clear-num83.7%
associate-/r/83.7%
clear-num83.7%
Applied egg-rr83.7%
if -7.6000000000000003e-116 < x < 2.8e-27Initial program 94.5%
Taylor expanded in y around inf 87.0%
associate-*r/65.2%
Simplified85.5%
clear-num65.1%
un-div-inv65.5%
Applied egg-rr85.8%
if 2.8e-27 < x Initial program 93.4%
+-commutative93.4%
*-commutative93.4%
associate-*l/100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in y around 0 88.1%
fma-def88.1%
*-commutative88.1%
associate-*r/93.3%
fma-def93.3%
neg-mul-193.3%
+-commutative93.3%
unsub-neg93.3%
*-commutative93.3%
associate-/r/89.3%
Simplified89.3%
Final simplification86.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -8e-39) (not (<= z 1.35e+141))) (* y (/ z t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8e-39) || !(z <= 1.35e+141)) {
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 ((z <= (-8d-39)) .or. (.not. (z <= 1.35d+141))) 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 ((z <= -8e-39) || !(z <= 1.35e+141)) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -8e-39) or not (z <= 1.35e+141): tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -8e-39) || !(z <= 1.35e+141)) tmp = Float64(y * Float64(z / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -8e-39) || ~((z <= 1.35e+141))) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8e-39], N[Not[LessEqual[z, 1.35e+141]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-39} \lor \neg \left(z \leq 1.35 \cdot 10^{+141}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.99999999999999943e-39 or 1.35e141 < z Initial program 87.2%
+-commutative87.2%
*-commutative87.2%
associate-*l/94.1%
fma-def94.1%
Simplified94.1%
Taylor expanded in t around 0 82.4%
Taylor expanded in y around inf 56.4%
associate-*r/62.4%
Simplified62.4%
if -7.99999999999999943e-39 < z < 1.35e141Initial program 96.5%
+-commutative96.5%
*-commutative96.5%
associate-*l/97.9%
fma-def97.9%
Simplified97.9%
Taylor expanded in z around 0 59.3%
Final simplification60.7%
(FPCore (x y z t) :precision binary64 (if (<= z -3.5e-39) (* y (/ z t)) (if (<= z 5.4e+76) x (* z (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.5e-39) {
tmp = y * (z / t);
} else if (z <= 5.4e+76) {
tmp = x;
} else {
tmp = z * (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 <= (-3.5d-39)) then
tmp = y * (z / t)
else if (z <= 5.4d+76) then
tmp = x
else
tmp = z * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.5e-39) {
tmp = y * (z / t);
} else if (z <= 5.4e+76) {
tmp = x;
} else {
tmp = z * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.5e-39: tmp = y * (z / t) elif z <= 5.4e+76: tmp = x else: tmp = z * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.5e-39) tmp = Float64(y * Float64(z / t)); elseif (z <= 5.4e+76) tmp = x; else tmp = Float64(z * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.5e-39) tmp = y * (z / t); elseif (z <= 5.4e+76) tmp = x; else tmp = z * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.5e-39], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e+76], x, N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-39}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+76}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -3.5e-39Initial program 91.8%
+-commutative91.8%
*-commutative91.8%
associate-*l/95.9%
fma-def95.9%
Simplified95.9%
Taylor expanded in t around 0 85.4%
Taylor expanded in y around inf 57.7%
associate-*r/61.8%
Simplified61.8%
if -3.5e-39 < z < 5.3999999999999998e76Initial program 97.6%
+-commutative97.6%
*-commutative97.6%
associate-*l/99.1%
fma-def99.1%
Simplified99.1%
Taylor expanded in z around 0 64.0%
if 5.3999999999999998e76 < z Initial program 81.2%
+-commutative81.2%
*-commutative81.2%
associate-*l/90.0%
fma-def90.0%
Simplified90.0%
Taylor expanded in t around 0 77.9%
Taylor expanded in y around inf 44.8%
associate-*r/49.9%
Simplified49.9%
clear-num49.9%
un-div-inv50.6%
Applied egg-rr50.6%
associate-/r/53.2%
Applied egg-rr53.2%
Final simplification61.0%
(FPCore (x y z t) :precision binary64 (if (<= z -6.8e-38) (/ y (/ t z)) (if (<= z 5.4e+76) x (* z (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.8e-38) {
tmp = y / (t / z);
} else if (z <= 5.4e+76) {
tmp = x;
} else {
tmp = z * (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 <= (-6.8d-38)) then
tmp = y / (t / z)
else if (z <= 5.4d+76) then
tmp = x
else
tmp = z * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.8e-38) {
tmp = y / (t / z);
} else if (z <= 5.4e+76) {
tmp = x;
} else {
tmp = z * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.8e-38: tmp = y / (t / z) elif z <= 5.4e+76: tmp = x else: tmp = z * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.8e-38) tmp = Float64(y / Float64(t / z)); elseif (z <= 5.4e+76) tmp = x; else tmp = Float64(z * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6.8e-38) tmp = y / (t / z); elseif (z <= 5.4e+76) tmp = x; else tmp = z * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.8e-38], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e+76], x, N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{-38}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+76}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -6.8000000000000004e-38Initial program 91.8%
+-commutative91.8%
*-commutative91.8%
associate-*l/95.9%
fma-def95.9%
Simplified95.9%
Taylor expanded in t around 0 85.4%
Taylor expanded in y around inf 57.7%
associate-*r/61.8%
Simplified61.8%
clear-num61.7%
un-div-inv61.8%
Applied egg-rr61.8%
if -6.8000000000000004e-38 < z < 5.3999999999999998e76Initial program 97.6%
+-commutative97.6%
*-commutative97.6%
associate-*l/99.1%
fma-def99.1%
Simplified99.1%
Taylor expanded in z around 0 64.0%
if 5.3999999999999998e76 < z Initial program 81.2%
+-commutative81.2%
*-commutative81.2%
associate-*l/90.0%
fma-def90.0%
Simplified90.0%
Taylor expanded in t around 0 77.9%
Taylor expanded in y around inf 44.8%
associate-*r/49.9%
Simplified49.9%
clear-num49.9%
un-div-inv50.6%
Applied egg-rr50.6%
associate-/r/53.2%
Applied egg-rr53.2%
Final simplification61.0%
(FPCore (x y z t) :precision binary64 (+ x (* z (/ (- y x) t))))
double code(double x, double y, double z, double t) {
return x + (z * ((y - x) / t));
}
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 + (z * ((y - x) / t))
end function
public static double code(double x, double y, double z, double t) {
return x + (z * ((y - x) / t));
}
def code(x, y, z, t): return x + (z * ((y - x) / t))
function code(x, y, z, t) return Float64(x + Float64(z * Float64(Float64(y - x) / t))) end
function tmp = code(x, y, z, t) tmp = x + (z * ((y - x) / t)); end
code[x_, y_, z_, t_] := N[(x + N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + z \cdot \frac{y - x}{t}
\end{array}
Initial program 92.4%
associate-*l/60.9%
Applied egg-rr95.6%
Final simplification95.6%
(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 92.4%
+-commutative92.4%
*-commutative92.4%
associate-*l/96.3%
fma-def96.3%
Simplified96.3%
Taylor expanded in z around 0 37.6%
Final simplification37.6%
(FPCore (x y z t)
:precision binary64
(if (< x -9.025511195533005e-135)
(- x (* (/ z t) (- x y)))
(if (< x 4.275032163700715e-250)
(+ x (* (/ (- y x) t) z))
(+ x (/ (- y x) (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x < -9.025511195533005e-135) {
tmp = x - ((z / t) * (x - y));
} else if (x < 4.275032163700715e-250) {
tmp = x + (((y - x) / t) * z);
} else {
tmp = x + ((y - x) / (t / z));
}
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 < (-9.025511195533005d-135)) then
tmp = x - ((z / t) * (x - y))
else if (x < 4.275032163700715d-250) then
tmp = x + (((y - x) / t) * z)
else
tmp = x + ((y - x) / (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x < -9.025511195533005e-135) {
tmp = x - ((z / t) * (x - y));
} else if (x < 4.275032163700715e-250) {
tmp = x + (((y - x) / t) * z);
} else {
tmp = x + ((y - x) / (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x < -9.025511195533005e-135: tmp = x - ((z / t) * (x - y)) elif x < 4.275032163700715e-250: tmp = x + (((y - x) / t) * z) else: tmp = x + ((y - x) / (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x < -9.025511195533005e-135) tmp = Float64(x - Float64(Float64(z / t) * Float64(x - y))); elseif (x < 4.275032163700715e-250) tmp = Float64(x + Float64(Float64(Float64(y - x) / t) * z)); else tmp = Float64(x + Float64(Float64(y - x) / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x < -9.025511195533005e-135) tmp = x - ((z / t) * (x - y)); elseif (x < 4.275032163700715e-250) tmp = x + (((y - x) / t) * z); else tmp = x + ((y - x) / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Less[x, -9.025511195533005e-135], N[(x - N[(N[(z / t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[x, 4.275032163700715e-250], N[(x + N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x < -9.025511195533005 \cdot 10^{-135}:\\
\;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\
\mathbf{elif}\;x < 4.275032163700715 \cdot 10^{-250}:\\
\;\;\;\;x + \frac{y - x}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\
\end{array}
\end{array}
herbie shell --seed 2023192
(FPCore (x y z t)
:name "Numeric.Histogram:binBounds from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< x -9.025511195533005e-135) (- x (* (/ z t) (- x y))) (if (< x 4.275032163700715e-250) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z)))))
(+ x (/ (* (- y x) z) t)))