
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 98.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.2e+67) (not (<= t 9.4e+110))) (+ x (* y (/ (- t z) t))) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e+67) || !(t <= 9.4e+110)) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.2d+67)) .or. (.not. (t <= 9.4d+110))) then
tmp = x + (y * ((t - z) / t))
else
tmp = x + (y * (z / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e+67) || !(t <= 9.4e+110)) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.2e+67) or not (t <= 9.4e+110): tmp = x + (y * ((t - z) / t)) else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.2e+67) || !(t <= 9.4e+110)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.2e+67) || ~((t <= 9.4e+110))) tmp = x + (y * ((t - z) / t)); else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.2e+67], N[Not[LessEqual[t, 9.4e+110]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+67} \lor \neg \left(t \leq 9.4 \cdot 10^{+110}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -2.2e67 or 9.3999999999999996e110 < t Initial program 99.9%
Taylor expanded in a around 0 62.4%
mul-1-neg62.4%
associate-/l*93.6%
distribute-rgt-neg-in93.6%
distribute-frac-neg93.6%
neg-sub093.6%
sub-neg93.6%
+-commutative93.6%
associate--r+93.6%
neg-sub093.6%
remove-double-neg93.6%
Simplified93.6%
if -2.2e67 < t < 9.3999999999999996e110Initial program 97.9%
Taylor expanded in z around inf 84.8%
associate-/l*88.8%
Simplified88.8%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.4e+65) (not (<= t 2.1e+118))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.4e+65) || !(t <= 2.1e+118)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-3.4d+65)) .or. (.not. (t <= 2.1d+118))) then
tmp = x + y
else
tmp = x + (y * (z / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.4e+65) || !(t <= 2.1e+118)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.4e+65) or not (t <= 2.1e+118): tmp = x + y else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.4e+65) || !(t <= 2.1e+118)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.4e+65) || ~((t <= 2.1e+118))) tmp = x + y; else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.4e+65], N[Not[LessEqual[t, 2.1e+118]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+65} \lor \neg \left(t \leq 2.1 \cdot 10^{+118}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -3.3999999999999999e65 or 2.1e118 < t Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around inf 87.8%
+-commutative87.8%
Simplified87.8%
if -3.3999999999999999e65 < t < 2.1e118Initial program 97.9%
Taylor expanded in z around inf 84.6%
associate-/l*88.5%
Simplified88.5%
Final simplification88.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -8.7e+52) (- x (* y (/ t (- a t)))) (if (<= t 9e+110) (+ x (* y (/ z (- a t)))) (+ x (/ y (/ t (- t z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.7e+52) {
tmp = x - (y * (t / (a - t)));
} else if (t <= 9e+110) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (y / (t / (t - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-8.7d+52)) then
tmp = x - (y * (t / (a - t)))
else if (t <= 9d+110) then
tmp = x + (y * (z / (a - t)))
else
tmp = x + (y / (t / (t - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.7e+52) {
tmp = x - (y * (t / (a - t)));
} else if (t <= 9e+110) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (y / (t / (t - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.7e+52: tmp = x - (y * (t / (a - t))) elif t <= 9e+110: tmp = x + (y * (z / (a - t))) else: tmp = x + (y / (t / (t - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.7e+52) tmp = Float64(x - Float64(y * Float64(t / Float64(a - t)))); elseif (t <= 9e+110) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x + Float64(y / Float64(t / Float64(t - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8.7e+52) tmp = x - (y * (t / (a - t))); elseif (t <= 9e+110) tmp = x + (y * (z / (a - t))); else tmp = x + (y / (t / (t - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.7e+52], N[(x - N[(y * N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e+110], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.7 \cdot 10^{+52}:\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+110}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{t - z}}\\
\end{array}
\end{array}
if t < -8.69999999999999994e52Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around 0 61.8%
+-commutative61.8%
associate-*r/61.8%
mul-1-neg61.8%
distribute-lft-neg-out61.8%
*-commutative61.8%
*-lft-identity61.8%
times-frac93.4%
/-rgt-identity93.4%
distribute-neg-frac93.4%
distribute-neg-frac293.4%
neg-sub093.4%
sub-neg93.4%
+-commutative93.4%
associate--r+93.4%
neg-sub093.4%
remove-double-neg93.4%
Simplified93.4%
if -8.69999999999999994e52 < t < 9.0000000000000005e110Initial program 97.9%
Taylor expanded in z around inf 85.2%
associate-/l*89.3%
Simplified89.3%
if 9.0000000000000005e110 < t Initial program 100.0%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in a around 0 93.8%
neg-mul-193.8%
distribute-neg-frac93.8%
Simplified93.8%
Final simplification90.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -1e+55) (- x (* y (/ t (- a t)))) (if (<= t 3.3e+113) (+ x (* y (/ z (- a t)))) (+ x (* y (/ (- t z) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1e+55) {
tmp = x - (y * (t / (a - t)));
} else if (t <= 3.3e+113) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (y * ((t - z) / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1d+55)) then
tmp = x - (y * (t / (a - t)))
else if (t <= 3.3d+113) then
tmp = x + (y * (z / (a - t)))
else
tmp = x + (y * ((t - z) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1e+55) {
tmp = x - (y * (t / (a - t)));
} else if (t <= 3.3e+113) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (y * ((t - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1e+55: tmp = x - (y * (t / (a - t))) elif t <= 3.3e+113: tmp = x + (y * (z / (a - t))) else: tmp = x + (y * ((t - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1e+55) tmp = Float64(x - Float64(y * Float64(t / Float64(a - t)))); elseif (t <= 3.3e+113) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1e+55) tmp = x - (y * (t / (a - t))); elseif (t <= 3.3e+113) tmp = x + (y * (z / (a - t))); else tmp = x + (y * ((t - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1e+55], N[(x - N[(y * N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.3e+113], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+55}:\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{+113}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\end{array}
\end{array}
if t < -1.00000000000000001e55Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around 0 61.8%
+-commutative61.8%
associate-*r/61.8%
mul-1-neg61.8%
distribute-lft-neg-out61.8%
*-commutative61.8%
*-lft-identity61.8%
times-frac93.4%
/-rgt-identity93.4%
distribute-neg-frac93.4%
distribute-neg-frac293.4%
neg-sub093.4%
sub-neg93.4%
+-commutative93.4%
associate--r+93.4%
neg-sub093.4%
remove-double-neg93.4%
Simplified93.4%
if -1.00000000000000001e55 < t < 3.3000000000000003e113Initial program 97.9%
Taylor expanded in z around inf 85.2%
associate-/l*89.3%
Simplified89.3%
if 3.3000000000000003e113 < t Initial program 100.0%
Taylor expanded in a around 0 66.7%
mul-1-neg66.7%
associate-/l*93.7%
distribute-rgt-neg-in93.7%
distribute-frac-neg93.7%
neg-sub093.7%
sub-neg93.7%
+-commutative93.7%
associate--r+93.7%
neg-sub093.7%
remove-double-neg93.7%
Simplified93.7%
Final simplification90.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.05e+49) (not (<= t 2.9e+60))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.05e+49) || !(t <= 2.9e+60)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.05d+49)) .or. (.not. (t <= 2.9d+60))) then
tmp = x + y
else
tmp = x + (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.05e+49) || !(t <= 2.9e+60)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.05e+49) or not (t <= 2.9e+60): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.05e+49) || !(t <= 2.9e+60)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.05e+49) || ~((t <= 2.9e+60))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.05e+49], N[Not[LessEqual[t, 2.9e+60]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{+49} \lor \neg \left(t \leq 2.9 \cdot 10^{+60}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -2.05e49 or 2.9e60 < t Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around inf 80.4%
+-commutative80.4%
Simplified80.4%
if -2.05e49 < t < 2.9e60Initial program 97.6%
+-commutative97.6%
fma-define97.6%
Simplified97.6%
Taylor expanded in t around 0 77.8%
+-commutative77.8%
associate-/l*81.9%
Simplified81.9%
clear-num81.9%
un-div-inv81.9%
Applied egg-rr81.9%
Final simplification81.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.6e+48) (not (<= t 9e+110))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.6e+48) || !(t <= 9e+110)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-5.6d+48)) .or. (.not. (t <= 9d+110))) then
tmp = x + y
else
tmp = x + (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.6e+48) || !(t <= 9e+110)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.6e+48) or not (t <= 9e+110): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.6e+48) || !(t <= 9e+110)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.6e+48) || ~((t <= 9e+110))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.6e+48], N[Not[LessEqual[t, 9e+110]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.6 \cdot 10^{+48} \lor \neg \left(t \leq 9 \cdot 10^{+110}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -5.60000000000000025e48 or 9.0000000000000005e110 < t Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around inf 85.6%
+-commutative85.6%
Simplified85.6%
if -5.60000000000000025e48 < t < 9.0000000000000005e110Initial program 97.9%
+-commutative97.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in t around 0 73.2%
+-commutative73.2%
associate-/l*78.5%
Simplified78.5%
Final simplification81.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.3e+49) (not (<= t 2.7e+60))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.3e+49) || !(t <= 2.7e+60)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4.3d+49)) .or. (.not. (t <= 2.7d+60))) then
tmp = x + y
else
tmp = x + (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.3e+49) || !(t <= 2.7e+60)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.3e+49) or not (t <= 2.7e+60): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.3e+49) || !(t <= 2.7e+60)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.3e+49) || ~((t <= 2.7e+60))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.3e+49], N[Not[LessEqual[t, 2.7e+60]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{+49} \lor \neg \left(t \leq 2.7 \cdot 10^{+60}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -4.2999999999999999e49 or 2.6999999999999999e60 < t Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around inf 80.4%
+-commutative80.4%
Simplified80.4%
if -4.2999999999999999e49 < t < 2.6999999999999999e60Initial program 97.6%
clear-num97.2%
un-div-inv97.3%
Applied egg-rr97.3%
Taylor expanded in z around inf 88.5%
associate-*l/89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in a around inf 79.2%
Final simplification79.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.7e+50) (not (<= t 0.27))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.7e+50) || !(t <= 0.27)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-6.7d+50)) .or. (.not. (t <= 0.27d0))) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.7e+50) || !(t <= 0.27)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.7e+50) or not (t <= 0.27): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.7e+50) || !(t <= 0.27)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6.7e+50) || ~((t <= 0.27))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.7e+50], N[Not[LessEqual[t, 0.27]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.7 \cdot 10^{+50} \lor \neg \left(t \leq 0.27\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -6.6999999999999999e50 or 0.27000000000000002 < t Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around inf 80.0%
+-commutative80.0%
Simplified80.0%
if -6.6999999999999999e50 < t < 0.27000000000000002Initial program 97.3%
+-commutative97.3%
fma-define97.3%
Simplified97.3%
Taylor expanded in y around 0 56.5%
Final simplification68.6%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 98.6%
+-commutative98.6%
fma-define98.6%
Simplified98.6%
Taylor expanded in y around 0 51.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y * ((z - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024163
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (if (< y -8508084860551241/100000000000000000000000000000000) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t)))))))
(+ x (* y (/ (- z t) (- a t)))))