
(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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - 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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
Initial program 85.3%
associate-/l*98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.4e+95)
(+ x y)
(if (<= t -2.8e-115)
(- x (* y (/ z t)))
(if (<= t 4e+24) (+ x (* z (/ y a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.4e+95) {
tmp = x + y;
} else if (t <= -2.8e-115) {
tmp = x - (y * (z / t));
} else if (t <= 4e+24) {
tmp = x + (z * (y / a));
} else {
tmp = x + y;
}
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.4d+95)) then
tmp = x + y
else if (t <= (-2.8d-115)) then
tmp = x - (y * (z / t))
else if (t <= 4d+24) then
tmp = x + (z * (y / a))
else
tmp = x + y
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.4e+95) {
tmp = x + y;
} else if (t <= -2.8e-115) {
tmp = x - (y * (z / t));
} else if (t <= 4e+24) {
tmp = x + (z * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.4e+95: tmp = x + y elif t <= -2.8e-115: tmp = x - (y * (z / t)) elif t <= 4e+24: tmp = x + (z * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.4e+95) tmp = Float64(x + y); elseif (t <= -2.8e-115) tmp = Float64(x - Float64(y * Float64(z / t))); elseif (t <= 4e+24) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.4e+95) tmp = x + y; elseif (t <= -2.8e-115) tmp = x - (y * (z / t)); elseif (t <= 4e+24) tmp = x + (z * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.4e+95], N[(x + y), $MachinePrecision], If[LessEqual[t, -2.8e-115], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e+24], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+95}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -2.8 \cdot 10^{-115}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+24}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.4e95 or 3.9999999999999999e24 < t Initial program 73.2%
+-commutative73.2%
associate-*l/94.6%
fma-def94.6%
Simplified94.6%
Taylor expanded in t around inf 82.5%
+-commutative82.5%
Simplified82.5%
if -2.4e95 < t < -2.79999999999999987e-115Initial program 93.5%
associate-/l*97.9%
Simplified97.9%
clear-num97.9%
associate-/r/97.8%
clear-num97.8%
Applied egg-rr97.8%
Taylor expanded in z around inf 87.3%
associate-/l*91.4%
Simplified91.4%
Taylor expanded in a around 0 72.7%
mul-1-neg72.7%
*-commutative72.7%
associate-*r/70.8%
unsub-neg70.8%
associate-*r/72.7%
associate-*l/70.7%
*-commutative70.7%
Simplified70.7%
if -2.79999999999999987e-115 < t < 3.9999999999999999e24Initial program 95.5%
+-commutative95.5%
associate-*l/98.1%
fma-def98.1%
Simplified98.1%
Taylor expanded in t around 0 79.0%
+-commutative79.0%
associate-/l*78.6%
Simplified78.6%
associate-/r/79.3%
Applied egg-rr79.3%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.4e+96) (not (<= t 6e+101))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.4e+96) || !(t <= 6e+101)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (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.4d+96)) .or. (.not. (t <= 6d+101))) then
tmp = x + y
else
tmp = x + (z * (y / (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.4e+96) || !(t <= 6e+101)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.4e+96) or not (t <= 6e+101): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.4e+96) || !(t <= 6e+101)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.4e+96) || ~((t <= 6e+101))) tmp = x + y; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.4e+96], N[Not[LessEqual[t, 6e+101]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+96} \lor \neg \left(t \leq 6 \cdot 10^{+101}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -2.39999999999999993e96 or 5.99999999999999986e101 < t Initial program 71.0%
+-commutative71.0%
associate-*l/93.7%
fma-def93.7%
Simplified93.7%
Taylor expanded in t around inf 85.2%
+-commutative85.2%
Simplified85.2%
if -2.39999999999999993e96 < t < 5.99999999999999986e101Initial program 94.1%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in z around inf 88.6%
associate-*l/89.8%
*-commutative89.8%
Simplified89.8%
Final simplification88.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7.2e+96) (not (<= t 3.3e+100))) (+ x (- y (* z (/ y t)))) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.2e+96) || !(t <= 3.3e+100)) {
tmp = x + (y - (z * (y / t)));
} else {
tmp = x + (z * (y / (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 <= (-7.2d+96)) .or. (.not. (t <= 3.3d+100))) then
tmp = x + (y - (z * (y / t)))
else
tmp = x + (z * (y / (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 <= -7.2e+96) || !(t <= 3.3e+100)) {
tmp = x + (y - (z * (y / t)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7.2e+96) or not (t <= 3.3e+100): tmp = x + (y - (z * (y / t))) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.2e+96) || !(t <= 3.3e+100)) tmp = Float64(x + Float64(y - Float64(z * Float64(y / t)))); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7.2e+96) || ~((t <= 3.3e+100))) tmp = x + (y - (z * (y / t))); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.2e+96], N[Not[LessEqual[t, 3.3e+100]], $MachinePrecision]], N[(x + N[(y - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{+96} \lor \neg \left(t \leq 3.3 \cdot 10^{+100}\right):\\
\;\;\;\;x + \left(y - z \cdot \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -7.20000000000000026e96 or 3.3000000000000001e100 < t Initial program 71.0%
+-commutative71.0%
associate-*l/93.7%
fma-def93.7%
Simplified93.7%
Taylor expanded in a around 0 68.2%
mul-1-neg68.2%
unsub-neg68.2%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in t around 0 80.5%
cancel-sign-sub-inv80.5%
metadata-eval80.5%
*-lft-identity80.5%
associate-+l+80.5%
+-commutative80.5%
mul-1-neg80.5%
unsub-neg80.5%
associate-*l/94.2%
*-commutative94.2%
Simplified94.2%
if -7.20000000000000026e96 < t < 3.3000000000000001e100Initial program 94.1%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in z around inf 88.6%
associate-*l/89.8%
*-commutative89.8%
Simplified89.8%
Final simplification91.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.16e+95) (not (<= t 2.6e+56))) (+ x (- y (* z (/ y t)))) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.16e+95) || !(t <= 2.6e+56)) {
tmp = x + (y - (z * (y / t)));
} else {
tmp = x + (y / ((a - 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 <= (-1.16d+95)) .or. (.not. (t <= 2.6d+56))) then
tmp = x + (y - (z * (y / t)))
else
tmp = x + (y / ((a - 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 <= -1.16e+95) || !(t <= 2.6e+56)) {
tmp = x + (y - (z * (y / t)));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.16e+95) or not (t <= 2.6e+56): tmp = x + (y - (z * (y / t))) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.16e+95) || !(t <= 2.6e+56)) tmp = Float64(x + Float64(y - Float64(z * Float64(y / t)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.16e+95) || ~((t <= 2.6e+56))) tmp = x + (y - (z * (y / t))); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.16e+95], N[Not[LessEqual[t, 2.6e+56]], $MachinePrecision]], N[(x + N[(y - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.16 \cdot 10^{+95} \lor \neg \left(t \leq 2.6 \cdot 10^{+56}\right):\\
\;\;\;\;x + \left(y - z \cdot \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -1.1599999999999999e95 or 2.60000000000000011e56 < t Initial program 71.9%
+-commutative71.9%
associate-*l/94.3%
fma-def94.3%
Simplified94.3%
Taylor expanded in a around 0 69.3%
mul-1-neg69.3%
unsub-neg69.3%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in t around 0 80.5%
cancel-sign-sub-inv80.5%
metadata-eval80.5%
*-lft-identity80.5%
associate-+l+80.5%
+-commutative80.5%
mul-1-neg80.5%
unsub-neg80.5%
associate-*l/92.9%
*-commutative92.9%
Simplified92.9%
if -1.1599999999999999e95 < t < 2.60000000000000011e56Initial program 95.0%
associate-/l*97.4%
Simplified97.4%
clear-num97.3%
associate-/r/96.7%
clear-num96.7%
Applied egg-rr96.7%
Taylor expanded in z around inf 89.1%
associate-/l*90.7%
Simplified90.7%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -8.6e+94) (+ x (- y (* z (/ y t)))) (if (<= t 3.3e+100) (+ x (/ y (/ (- a t) z))) (+ x (* y (/ (- t z) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.6e+94) {
tmp = x + (y - (z * (y / t)));
} else if (t <= 3.3e+100) {
tmp = x + (y / ((a - t) / z));
} 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 <= (-8.6d+94)) then
tmp = x + (y - (z * (y / t)))
else if (t <= 3.3d+100) then
tmp = x + (y / ((a - t) / z))
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 <= -8.6e+94) {
tmp = x + (y - (z * (y / t)));
} else if (t <= 3.3e+100) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x + (y * ((t - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.6e+94: tmp = x + (y - (z * (y / t))) elif t <= 3.3e+100: tmp = x + (y / ((a - t) / z)) else: tmp = x + (y * ((t - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.6e+94) tmp = Float64(x + Float64(y - Float64(z * Float64(y / t)))); elseif (t <= 3.3e+100) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); 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 <= -8.6e+94) tmp = x + (y - (z * (y / t))); elseif (t <= 3.3e+100) tmp = x + (y / ((a - t) / z)); else tmp = x + (y * ((t - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.6e+94], N[(x + N[(y - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.3e+100], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $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 -8.6 \cdot 10^{+94}:\\
\;\;\;\;x + \left(y - z \cdot \frac{y}{t}\right)\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{+100}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\end{array}
\end{array}
if t < -8.6e94Initial program 63.9%
+-commutative63.9%
associate-*l/94.8%
fma-def94.8%
Simplified94.8%
Taylor expanded in a around 0 60.5%
mul-1-neg60.5%
unsub-neg60.5%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in t around 0 77.3%
cancel-sign-sub-inv77.3%
metadata-eval77.3%
*-lft-identity77.3%
associate-+l+77.3%
+-commutative77.3%
mul-1-neg77.3%
unsub-neg77.3%
associate-*l/94.9%
*-commutative94.9%
Simplified94.9%
if -8.6e94 < t < 3.3000000000000001e100Initial program 94.1%
associate-/l*97.5%
Simplified97.5%
clear-num97.5%
associate-/r/96.9%
clear-num96.9%
Applied egg-rr96.9%
Taylor expanded in z around inf 88.6%
associate-/l*90.1%
Simplified90.1%
if 3.3000000000000001e100 < t Initial program 80.1%
+-commutative80.1%
associate-*l/92.4%
fma-def92.4%
Simplified92.4%
Taylor expanded in a around 0 78.1%
mul-1-neg78.1%
unsub-neg78.1%
associate-/l*95.5%
Simplified95.5%
clear-num95.5%
associate-/r/95.5%
clear-num95.5%
Applied egg-rr95.5%
Final simplification92.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.55e+95) (+ x (- y (* z (/ y t)))) (if (<= t 3.5e+101) (+ x (/ y (/ (- a t) z))) (- x (/ y (/ t (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.55e+95) {
tmp = x + (y - (z * (y / t)));
} else if (t <= 3.5e+101) {
tmp = x + (y / ((a - t) / z));
} 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 <= (-1.55d+95)) then
tmp = x + (y - (z * (y / t)))
else if (t <= 3.5d+101) then
tmp = x + (y / ((a - t) / z))
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 <= -1.55e+95) {
tmp = x + (y - (z * (y / t)));
} else if (t <= 3.5e+101) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x - (y / (t / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.55e+95: tmp = x + (y - (z * (y / t))) elif t <= 3.5e+101: tmp = x + (y / ((a - t) / z)) else: tmp = x - (y / (t / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.55e+95) tmp = Float64(x + Float64(y - Float64(z * Float64(y / t)))); elseif (t <= 3.5e+101) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); else tmp = Float64(x - Float64(y / Float64(t / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.55e+95) tmp = x + (y - (z * (y / t))); elseif (t <= 3.5e+101) tmp = x + (y / ((a - t) / z)); else tmp = x - (y / (t / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.55e+95], N[(x + N[(y - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e+101], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(t / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{+95}:\\
\;\;\;\;x + \left(y - z \cdot \frac{y}{t}\right)\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+101}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\end{array}
\end{array}
if t < -1.5500000000000001e95Initial program 63.9%
+-commutative63.9%
associate-*l/94.8%
fma-def94.8%
Simplified94.8%
Taylor expanded in a around 0 60.5%
mul-1-neg60.5%
unsub-neg60.5%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in t around 0 77.3%
cancel-sign-sub-inv77.3%
metadata-eval77.3%
*-lft-identity77.3%
associate-+l+77.3%
+-commutative77.3%
mul-1-neg77.3%
unsub-neg77.3%
associate-*l/94.9%
*-commutative94.9%
Simplified94.9%
if -1.5500000000000001e95 < t < 3.50000000000000023e101Initial program 94.1%
associate-/l*97.5%
Simplified97.5%
clear-num97.5%
associate-/r/96.9%
clear-num96.9%
Applied egg-rr96.9%
Taylor expanded in z around inf 88.6%
associate-/l*90.1%
Simplified90.1%
if 3.50000000000000023e101 < t Initial program 80.1%
+-commutative80.1%
associate-*l/92.4%
fma-def92.4%
Simplified92.4%
Taylor expanded in a around 0 78.1%
mul-1-neg78.1%
unsub-neg78.1%
associate-/l*95.5%
Simplified95.5%
Final simplification92.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8.8e+55) (not (<= t 3.5e+66))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8.8e+55) || !(t <= 3.5e+66)) {
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 <= (-8.8d+55)) .or. (.not. (t <= 3.5d+66))) 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 <= -8.8e+55) || !(t <= 3.5e+66)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8.8e+55) or not (t <= 3.5e+66): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8.8e+55) || !(t <= 3.5e+66)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -8.8e+55) || ~((t <= 3.5e+66))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8.8e+55], N[Not[LessEqual[t, 3.5e+66]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.8 \cdot 10^{+55} \lor \neg \left(t \leq 3.5 \cdot 10^{+66}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -8.80000000000000042e55 or 3.4999999999999997e66 < t Initial program 73.2%
+-commutative73.2%
associate-*l/94.6%
fma-def94.6%
Simplified94.6%
Taylor expanded in t around inf 81.6%
+-commutative81.6%
Simplified81.6%
if -8.80000000000000042e55 < t < 3.4999999999999997e66Initial program 94.9%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in t around 0 73.6%
Final simplification77.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.8e+56) (not (<= t 9.8e+26))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.8e+56) || !(t <= 9.8e+26)) {
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 <= (-5.8d+56)) .or. (.not. (t <= 9.8d+26))) 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 <= -5.8e+56) || !(t <= 9.8e+26)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.8e+56) or not (t <= 9.8e+26): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.8e+56) || !(t <= 9.8e+26)) 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 <= -5.8e+56) || ~((t <= 9.8e+26))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.8e+56], N[Not[LessEqual[t, 9.8e+26]], $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 -5.8 \cdot 10^{+56} \lor \neg \left(t \leq 9.8 \cdot 10^{+26}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -5.80000000000000014e56 or 9.79999999999999947e26 < t Initial program 75.1%
+-commutative75.1%
associate-*l/95.0%
fma-def95.0%
Simplified95.0%
Taylor expanded in t around inf 81.4%
+-commutative81.4%
Simplified81.4%
if -5.80000000000000014e56 < t < 9.79999999999999947e26Initial program 94.5%
+-commutative94.5%
associate-*l/96.8%
fma-def96.8%
Simplified96.8%
Taylor expanded in t around 0 73.3%
+-commutative73.3%
associate-/l*73.0%
Simplified73.0%
associate-/r/73.7%
Applied egg-rr73.7%
Final simplification77.3%
(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 85.3%
associate-/l*98.4%
Simplified98.4%
clear-num98.4%
associate-/r/98.0%
clear-num98.1%
Applied egg-rr98.1%
Final simplification98.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8e+94) (not (<= t 3.6e-41))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8e+94) || !(t <= 3.6e-41)) {
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 <= (-8d+94)) .or. (.not. (t <= 3.6d-41))) 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 <= -8e+94) || !(t <= 3.6e-41)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8e+94) or not (t <= 3.6e-41): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8e+94) || !(t <= 3.6e-41)) 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 <= -8e+94) || ~((t <= 3.6e-41))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8e+94], N[Not[LessEqual[t, 3.6e-41]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{+94} \lor \neg \left(t \leq 3.6 \cdot 10^{-41}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -8.0000000000000002e94 or 3.6e-41 < t Initial program 74.9%
+-commutative74.9%
associate-*l/94.9%
fma-def94.9%
Simplified94.9%
Taylor expanded in t around inf 81.4%
+-commutative81.4%
Simplified81.4%
if -8.0000000000000002e94 < t < 3.6e-41Initial program 94.6%
+-commutative94.6%
associate-*l/96.8%
fma-def96.8%
Simplified96.8%
Taylor expanded in y around 0 49.4%
Final simplification64.5%
(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 85.3%
+-commutative85.3%
associate-*l/95.9%
fma-def95.9%
Simplified95.9%
Taylor expanded in y around 0 53.1%
Final simplification53.1%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - 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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2023318
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))