
(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.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.3e+45) (not (<= t 2.55e+39))) (+ 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 <= -3.3e+45) || !(t <= 2.55e+39)) {
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 <= (-3.3d+45)) .or. (.not. (t <= 2.55d+39))) 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 <= -3.3e+45) || !(t <= 2.55e+39)) {
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 <= -3.3e+45) or not (t <= 2.55e+39): 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 <= -3.3e+45) || !(t <= 2.55e+39)) 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 <= -3.3e+45) || ~((t <= 2.55e+39))) 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, -3.3e+45], N[Not[LessEqual[t, 2.55e+39]], $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 -3.3 \cdot 10^{+45} \lor \neg \left(t \leq 2.55 \cdot 10^{+39}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -3.3000000000000001e45 or 2.5499999999999999e39 < t Initial program 99.9%
Taylor expanded in a around 0 69.9%
mul-1-neg69.9%
associate-/l*88.8%
distribute-rgt-neg-in88.8%
distribute-frac-neg88.8%
neg-sub088.8%
sub-neg88.8%
+-commutative88.8%
associate--r+88.8%
neg-sub088.8%
remove-double-neg88.8%
Simplified88.8%
if -3.3000000000000001e45 < t < 2.5499999999999999e39Initial program 97.5%
Taylor expanded in z around inf 86.1%
associate-/l*86.7%
Simplified86.7%
Final simplification87.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6e+140) (not (<= t 4.3e+49))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6e+140) || !(t <= 4.3e+49)) {
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 <= (-6d+140)) .or. (.not. (t <= 4.3d+49))) 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 <= -6e+140) || !(t <= 4.3e+49)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6e+140) or not (t <= 4.3e+49): tmp = x + y else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6e+140) || !(t <= 4.3e+49)) 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 <= -6e+140) || ~((t <= 4.3e+49))) 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, -6e+140], N[Not[LessEqual[t, 4.3e+49]], $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 -6 \cdot 10^{+140} \lor \neg \left(t \leq 4.3 \cdot 10^{+49}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -5.99999999999999993e140 or 4.2999999999999999e49 < t Initial program 99.9%
Taylor expanded in t around inf 80.5%
+-commutative80.5%
Simplified80.5%
if -5.99999999999999993e140 < t < 4.2999999999999999e49Initial program 97.7%
Taylor expanded in z around inf 84.8%
associate-/l*85.9%
Simplified85.9%
Final simplification84.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.1e+45) (- x (* y (+ (/ z t) -1.0))) (if (<= t 1.4e-57) (+ x (* z (/ y (- a t)))) (+ x (/ y (- 1.0 (/ a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.1e+45) {
tmp = x - (y * ((z / t) + -1.0));
} else if (t <= 1.4e-57) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y / (1.0 - (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.1d+45)) then
tmp = x - (y * ((z / t) + (-1.0d0)))
else if (t <= 1.4d-57) then
tmp = x + (z * (y / (a - t)))
else
tmp = x + (y / (1.0d0 - (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.1e+45) {
tmp = x - (y * ((z / t) + -1.0));
} else if (t <= 1.4e-57) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y / (1.0 - (a / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.1e+45: tmp = x - (y * ((z / t) + -1.0)) elif t <= 1.4e-57: tmp = x + (z * (y / (a - t))) else: tmp = x + (y / (1.0 - (a / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.1e+45) tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); elseif (t <= 1.4e-57) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.1e+45) tmp = x - (y * ((z / t) + -1.0)); elseif (t <= 1.4e-57) tmp = x + (z * (y / (a - t))); else tmp = x + (y / (1.0 - (a / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.1e+45], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e-57], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(1.0 - N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+45}:\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-57}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{t}}\\
\end{array}
\end{array}
if t < -2.09999999999999995e45Initial program 99.9%
Taylor expanded in a around 0 71.1%
mul-1-neg71.1%
unsub-neg71.1%
associate-/l*90.1%
div-sub90.2%
sub-neg90.2%
*-inverses90.2%
metadata-eval90.2%
Simplified90.2%
if -2.09999999999999995e45 < t < 1.4e-57Initial program 97.0%
clear-num96.2%
un-div-inv96.3%
Applied egg-rr96.3%
associate-/r/96.9%
Applied egg-rr96.9%
Taylor expanded in z around inf 89.7%
if 1.4e-57 < t Initial program 99.9%
Taylor expanded in z around 0 72.9%
+-commutative72.9%
associate-*r/72.9%
mul-1-neg72.9%
distribute-lft-neg-out72.9%
*-commutative72.9%
*-lft-identity72.9%
times-frac87.9%
/-rgt-identity87.9%
distribute-neg-frac87.9%
distribute-neg-frac287.9%
neg-sub087.9%
sub-neg87.9%
+-commutative87.9%
associate--r+87.9%
neg-sub087.9%
remove-double-neg87.9%
Simplified87.9%
clear-num87.9%
un-div-inv87.9%
div-sub87.9%
*-inverses87.9%
Applied egg-rr87.9%
Final simplification89.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -8.8e+45) (+ x (* y (/ (- t z) t))) (if (<= t 1.3e-57) (+ x (* z (/ y (- a t)))) (+ x (/ y (- 1.0 (/ a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.8e+45) {
tmp = x + (y * ((t - z) / t));
} else if (t <= 1.3e-57) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y / (1.0 - (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 <= (-8.8d+45)) then
tmp = x + (y * ((t - z) / t))
else if (t <= 1.3d-57) then
tmp = x + (z * (y / (a - t)))
else
tmp = x + (y / (1.0d0 - (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 <= -8.8e+45) {
tmp = x + (y * ((t - z) / t));
} else if (t <= 1.3e-57) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y / (1.0 - (a / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.8e+45: tmp = x + (y * ((t - z) / t)) elif t <= 1.3e-57: tmp = x + (z * (y / (a - t))) else: tmp = x + (y / (1.0 - (a / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.8e+45) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); elseif (t <= 1.3e-57) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8.8e+45) tmp = x + (y * ((t - z) / t)); elseif (t <= 1.3e-57) tmp = x + (z * (y / (a - t))); else tmp = x + (y / (1.0 - (a / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.8e+45], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e-57], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(1.0 - N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.8 \cdot 10^{+45}:\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-57}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{t}}\\
\end{array}
\end{array}
if t < -8.8000000000000001e45Initial program 99.9%
Taylor expanded in a around 0 71.1%
mul-1-neg71.1%
associate-/l*90.1%
distribute-rgt-neg-in90.1%
distribute-frac-neg90.1%
neg-sub090.1%
sub-neg90.1%
+-commutative90.1%
associate--r+90.1%
neg-sub090.1%
remove-double-neg90.1%
Simplified90.1%
if -8.8000000000000001e45 < t < 1.29999999999999993e-57Initial program 97.0%
clear-num96.2%
un-div-inv96.3%
Applied egg-rr96.3%
associate-/r/96.9%
Applied egg-rr96.9%
Taylor expanded in z around inf 89.7%
if 1.29999999999999993e-57 < t Initial program 99.9%
Taylor expanded in z around 0 72.9%
+-commutative72.9%
associate-*r/72.9%
mul-1-neg72.9%
distribute-lft-neg-out72.9%
*-commutative72.9%
*-lft-identity72.9%
times-frac87.9%
/-rgt-identity87.9%
distribute-neg-frac87.9%
distribute-neg-frac287.9%
neg-sub087.9%
sub-neg87.9%
+-commutative87.9%
associate--r+87.9%
neg-sub087.9%
remove-double-neg87.9%
Simplified87.9%
clear-num87.9%
un-div-inv87.9%
div-sub87.9%
*-inverses87.9%
Applied egg-rr87.9%
Final simplification89.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.7e+45) (+ x (* y (/ (- t z) t))) (if (<= t 1.4e-57) (+ x (* z (/ y (- a t)))) (+ x (* y (/ t (- t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.7e+45) {
tmp = x + (y * ((t - z) / t));
} else if (t <= 1.4e-57) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y * (t / (t - 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 <= (-2.7d+45)) then
tmp = x + (y * ((t - z) / t))
else if (t <= 1.4d-57) then
tmp = x + (z * (y / (a - t)))
else
tmp = x + (y * (t / (t - 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 <= -2.7e+45) {
tmp = x + (y * ((t - z) / t));
} else if (t <= 1.4e-57) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y * (t / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.7e+45: tmp = x + (y * ((t - z) / t)) elif t <= 1.4e-57: tmp = x + (z * (y / (a - t))) else: tmp = x + (y * (t / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.7e+45) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); elseif (t <= 1.4e-57) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.7e+45) tmp = x + (y * ((t - z) / t)); elseif (t <= 1.4e-57) tmp = x + (z * (y / (a - t))); else tmp = x + (y * (t / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.7e+45], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e-57], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{+45}:\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-57}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\end{array}
\end{array}
if t < -2.69999999999999984e45Initial program 99.9%
Taylor expanded in a around 0 71.1%
mul-1-neg71.1%
associate-/l*90.1%
distribute-rgt-neg-in90.1%
distribute-frac-neg90.1%
neg-sub090.1%
sub-neg90.1%
+-commutative90.1%
associate--r+90.1%
neg-sub090.1%
remove-double-neg90.1%
Simplified90.1%
if -2.69999999999999984e45 < t < 1.4e-57Initial program 97.0%
clear-num96.2%
un-div-inv96.3%
Applied egg-rr96.3%
associate-/r/96.9%
Applied egg-rr96.9%
Taylor expanded in z around inf 89.7%
if 1.4e-57 < t Initial program 99.9%
Taylor expanded in z around 0 72.9%
+-commutative72.9%
associate-*r/72.9%
mul-1-neg72.9%
distribute-lft-neg-out72.9%
*-commutative72.9%
*-lft-identity72.9%
times-frac87.9%
/-rgt-identity87.9%
distribute-neg-frac87.9%
distribute-neg-frac287.9%
neg-sub087.9%
sub-neg87.9%
+-commutative87.9%
associate--r+87.9%
neg-sub087.9%
remove-double-neg87.9%
Simplified87.9%
Final simplification89.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4e+45) (not (<= t 6.8e+38))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4e+45) || !(t <= 6.8e+38)) {
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 <= (-4d+45)) .or. (.not. (t <= 6.8d+38))) 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 <= -4e+45) || !(t <= 6.8e+38)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4e+45) or not (t <= 6.8e+38): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4e+45) || !(t <= 6.8e+38)) 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 <= -4e+45) || ~((t <= 6.8e+38))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4e+45], N[Not[LessEqual[t, 6.8e+38]], $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 -4 \cdot 10^{+45} \lor \neg \left(t \leq 6.8 \cdot 10^{+38}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -3.9999999999999997e45 or 6.79999999999999992e38 < t Initial program 99.9%
Taylor expanded in t around inf 78.9%
+-commutative78.9%
Simplified78.9%
if -3.9999999999999997e45 < t < 6.79999999999999992e38Initial program 97.5%
Taylor expanded in t around 0 70.9%
+-commutative70.9%
associate-/l*72.7%
Simplified72.7%
Final simplification75.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.5e+44) (not (<= t 1.65e+39))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.5e+44) || !(t <= 1.65e+39)) {
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.5d+44)) .or. (.not. (t <= 1.65d+39))) 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.5e+44) || !(t <= 1.65e+39)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.5e+44) or not (t <= 1.65e+39): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.5e+44) || !(t <= 1.65e+39)) 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.5e+44) || ~((t <= 1.65e+39))) 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.5e+44], N[Not[LessEqual[t, 1.65e+39]], $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.5 \cdot 10^{+44} \lor \neg \left(t \leq 1.65 \cdot 10^{+39}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -4.5e44 or 1.6500000000000001e39 < t Initial program 99.9%
Taylor expanded in t around inf 78.9%
+-commutative78.9%
Simplified78.9%
if -4.5e44 < t < 1.6500000000000001e39Initial program 97.5%
clear-num96.9%
un-div-inv96.9%
Applied egg-rr96.9%
associate-/r/96.8%
Applied egg-rr96.8%
Taylor expanded in z around inf 86.6%
Taylor expanded in a around inf 71.4%
Final simplification74.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.3e+44) (not (<= t 1.4e-92))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.3e+44) || !(t <= 1.4e-92)) {
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 <= (-3.3d+44)) .or. (.not. (t <= 1.4d-92))) 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 <= -3.3e+44) || !(t <= 1.4e-92)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.3e+44) or not (t <= 1.4e-92): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.3e+44) || !(t <= 1.4e-92)) 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 <= -3.3e+44) || ~((t <= 1.4e-92))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.3e+44], N[Not[LessEqual[t, 1.4e-92]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+44} \lor \neg \left(t \leq 1.4 \cdot 10^{-92}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -3.30000000000000013e44 or 1.4e-92 < t Initial program 99.9%
Taylor expanded in t around inf 72.0%
+-commutative72.0%
Simplified72.0%
if -3.30000000000000013e44 < t < 1.4e-92Initial program 96.8%
Taylor expanded in x around inf 49.3%
Final simplification61.1%
(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.4%
Taylor expanded in x around inf 48.7%
(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 2024135
(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)))))