
(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 11 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 86.3%
associate-/l*98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.05e+14)
(+ x y)
(if (<= t 9.8e-98)
(+ x (/ y (/ a z)))
(if (<= t 5.6e+41) (- x (/ y (/ t z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.05e+14) {
tmp = x + y;
} else if (t <= 9.8e-98) {
tmp = x + (y / (a / z));
} else if (t <= 5.6e+41) {
tmp = x - (y / (t / z));
} 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 <= (-1.05d+14)) then
tmp = x + y
else if (t <= 9.8d-98) then
tmp = x + (y / (a / z))
else if (t <= 5.6d+41) then
tmp = x - (y / (t / z))
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 <= -1.05e+14) {
tmp = x + y;
} else if (t <= 9.8e-98) {
tmp = x + (y / (a / z));
} else if (t <= 5.6e+41) {
tmp = x - (y / (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.05e+14: tmp = x + y elif t <= 9.8e-98: tmp = x + (y / (a / z)) elif t <= 5.6e+41: tmp = x - (y / (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.05e+14) tmp = Float64(x + y); elseif (t <= 9.8e-98) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 5.6e+41) tmp = Float64(x - Float64(y / Float64(t / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.05e+14) tmp = x + y; elseif (t <= 9.8e-98) tmp = x + (y / (a / z)); elseif (t <= 5.6e+41) tmp = x - (y / (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.05e+14], N[(x + y), $MachinePrecision], If[LessEqual[t, 9.8e-98], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.6e+41], N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+14}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 9.8 \cdot 10^{-98}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+41}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.05e14 or 5.5999999999999999e41 < t Initial program 77.6%
associate-*l/95.2%
Simplified95.2%
Taylor expanded in t around inf 83.7%
if -1.05e14 < t < 9.80000000000000028e-98Initial program 92.1%
associate-*l/98.2%
Simplified98.2%
Taylor expanded in t around 0 74.5%
associate-/l*80.5%
Simplified80.5%
if 9.80000000000000028e-98 < t < 5.5999999999999999e41Initial program 97.0%
associate-*l/94.4%
Simplified94.4%
Taylor expanded in z around inf 81.8%
associate-/l*84.7%
Simplified84.7%
Taylor expanded in a around 0 73.0%
+-commutative73.0%
mul-1-neg73.0%
unsub-neg73.0%
associate-/l*73.1%
Simplified73.1%
Final simplification81.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -42000000000000.0)
(+ x y)
(if (<= t 5.3e-98)
(+ x (* (- z t) (/ y a)))
(if (<= t 5.5e+41) (- x (/ y (/ t z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -42000000000000.0) {
tmp = x + y;
} else if (t <= 5.3e-98) {
tmp = x + ((z - t) * (y / a));
} else if (t <= 5.5e+41) {
tmp = x - (y / (t / z));
} 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 <= (-42000000000000.0d0)) then
tmp = x + y
else if (t <= 5.3d-98) then
tmp = x + ((z - t) * (y / a))
else if (t <= 5.5d+41) then
tmp = x - (y / (t / z))
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 <= -42000000000000.0) {
tmp = x + y;
} else if (t <= 5.3e-98) {
tmp = x + ((z - t) * (y / a));
} else if (t <= 5.5e+41) {
tmp = x - (y / (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -42000000000000.0: tmp = x + y elif t <= 5.3e-98: tmp = x + ((z - t) * (y / a)) elif t <= 5.5e+41: tmp = x - (y / (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -42000000000000.0) tmp = Float64(x + y); elseif (t <= 5.3e-98) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / a))); elseif (t <= 5.5e+41) tmp = Float64(x - Float64(y / Float64(t / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -42000000000000.0) tmp = x + y; elseif (t <= 5.3e-98) tmp = x + ((z - t) * (y / a)); elseif (t <= 5.5e+41) tmp = x - (y / (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -42000000000000.0], N[(x + y), $MachinePrecision], If[LessEqual[t, 5.3e-98], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e+41], N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -42000000000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 5.3 \cdot 10^{-98}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+41}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -4.2e13 or 5.5000000000000003e41 < t Initial program 77.6%
associate-*l/95.2%
Simplified95.2%
Taylor expanded in t around inf 83.7%
if -4.2e13 < t < 5.30000000000000031e-98Initial program 92.1%
associate-*l/98.2%
Simplified98.2%
Taylor expanded in a around inf 81.8%
if 5.30000000000000031e-98 < t < 5.5000000000000003e41Initial program 97.0%
associate-*l/94.4%
Simplified94.4%
Taylor expanded in z around inf 81.8%
associate-/l*84.7%
Simplified84.7%
Taylor expanded in a around 0 73.0%
+-commutative73.0%
mul-1-neg73.0%
unsub-neg73.0%
associate-/l*73.1%
Simplified73.1%
Final simplification81.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.8e+19) (not (<= t 4.9e+28))) (+ x (/ y (/ (- t a) t))) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.8e+19) || !(t <= 4.9e+28)) {
tmp = x + (y / ((t - a) / 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 <= (-5.8d+19)) .or. (.not. (t <= 4.9d+28))) then
tmp = x + (y / ((t - a) / 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 <= -5.8e+19) || !(t <= 4.9e+28)) {
tmp = x + (y / ((t - a) / t));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.8e+19) or not (t <= 4.9e+28): tmp = x + (y / ((t - a) / t)) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.8e+19) || !(t <= 4.9e+28)) tmp = Float64(x + Float64(y / Float64(Float64(t - a) / 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 <= -5.8e+19) || ~((t <= 4.9e+28))) tmp = x + (y / ((t - a) / t)); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.8e+19], N[Not[LessEqual[t, 4.9e+28]], $MachinePrecision]], N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / t), $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 -5.8 \cdot 10^{+19} \lor \neg \left(t \leq 4.9 \cdot 10^{+28}\right):\\
\;\;\;\;x + \frac{y}{\frac{t - a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -5.8e19 or 4.8999999999999996e28 < t Initial program 77.9%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 88.0%
associate-*r/88.0%
neg-mul-188.0%
neg-sub088.0%
associate--r-88.0%
neg-sub088.0%
Simplified88.0%
Taylor expanded in y around 0 69.6%
associate-/l*88.0%
Simplified88.0%
if -5.8e19 < t < 4.8999999999999996e28Initial program 93.2%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in z around inf 86.8%
associate-/l*91.4%
Simplified91.4%
Final simplification89.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8.6e+21) (not (<= t 1.55e+32))) (- x (/ y (/ t (- z t)))) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8.6e+21) || !(t <= 1.55e+32)) {
tmp = x - (y / (t / (z - 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 <= (-8.6d+21)) .or. (.not. (t <= 1.55d+32))) then
tmp = x - (y / (t / (z - 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 <= -8.6e+21) || !(t <= 1.55e+32)) {
tmp = x - (y / (t / (z - t)));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8.6e+21) or not (t <= 1.55e+32): tmp = x - (y / (t / (z - t))) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8.6e+21) || !(t <= 1.55e+32)) tmp = Float64(x - Float64(y / Float64(t / Float64(z - 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 <= -8.6e+21) || ~((t <= 1.55e+32))) tmp = x - (y / (t / (z - t))); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8.6e+21], N[Not[LessEqual[t, 1.55e+32]], $MachinePrecision]], N[(x - N[(y / N[(t / N[(z - 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 -8.6 \cdot 10^{+21} \lor \neg \left(t \leq 1.55 \cdot 10^{+32}\right):\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -8.6e21 or 1.54999999999999997e32 < t Initial program 77.6%
associate-*l/95.2%
Simplified95.2%
Taylor expanded in a around 0 73.3%
+-commutative73.3%
mul-1-neg73.3%
unsub-neg73.3%
*-commutative73.3%
associate-/l*93.2%
Simplified93.2%
if -8.6e21 < t < 1.54999999999999997e32Initial program 93.2%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in z around inf 85.8%
associate-/l*90.4%
Simplified90.4%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.2e+23) (+ x y) (if (<= t 6.1e+41) (+ x (/ y (/ (- a t) z))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.2e+23) {
tmp = x + y;
} else if (t <= 6.1e+41) {
tmp = x + (y / ((a - t) / z));
} 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 <= (-3.2d+23)) then
tmp = x + y
else if (t <= 6.1d+41) then
tmp = x + (y / ((a - t) / z))
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 <= -3.2e+23) {
tmp = x + y;
} else if (t <= 6.1e+41) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.2e+23: tmp = x + y elif t <= 6.1e+41: tmp = x + (y / ((a - t) / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.2e+23) tmp = Float64(x + y); elseif (t <= 6.1e+41) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.2e+23) tmp = x + y; elseif (t <= 6.1e+41) tmp = x + (y / ((a - t) / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.2e+23], N[(x + y), $MachinePrecision], If[LessEqual[t, 6.1e+41], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+23}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 6.1 \cdot 10^{+41}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.2e23 or 6.09999999999999998e41 < t Initial program 77.2%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in t around inf 84.3%
if -3.2e23 < t < 6.09999999999999998e41Initial program 93.3%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in z around inf 86.0%
associate-/l*90.6%
Simplified90.6%
Final simplification87.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -900000000000.0) (not (<= t 2e-11))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -900000000000.0) || !(t <= 2e-11)) {
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 <= (-900000000000.0d0)) .or. (.not. (t <= 2d-11))) 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 <= -900000000000.0) || !(t <= 2e-11)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -900000000000.0) or not (t <= 2e-11): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -900000000000.0) || !(t <= 2e-11)) 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 <= -900000000000.0) || ~((t <= 2e-11))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -900000000000.0], N[Not[LessEqual[t, 2e-11]], $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 -900000000000 \lor \neg \left(t \leq 2 \cdot 10^{-11}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -9e11 or 1.99999999999999988e-11 < t Initial program 80.3%
associate-*l/95.8%
Simplified95.8%
Taylor expanded in t around inf 80.4%
if -9e11 < t < 1.99999999999999988e-11Initial program 92.4%
associate-*l/97.0%
Simplified97.0%
*-commutative97.0%
clear-num97.0%
un-div-inv97.3%
Applied egg-rr97.3%
Taylor expanded in t around 0 71.5%
associate-*r/77.0%
Simplified77.0%
Final simplification78.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5000000000.0) (not (<= t 9.8e-11))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5000000000.0) || !(t <= 9.8e-11)) {
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 <= (-5000000000.0d0)) .or. (.not. (t <= 9.8d-11))) 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 <= -5000000000.0) || !(t <= 9.8e-11)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5000000000.0) or not (t <= 9.8e-11): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5000000000.0) || !(t <= 9.8e-11)) 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 <= -5000000000.0) || ~((t <= 9.8e-11))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5000000000.0], N[Not[LessEqual[t, 9.8e-11]], $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 -5000000000 \lor \neg \left(t \leq 9.8 \cdot 10^{-11}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -5e9 or 9.7999999999999998e-11 < t Initial program 80.3%
associate-*l/95.8%
Simplified95.8%
Taylor expanded in t around inf 80.4%
if -5e9 < t < 9.7999999999999998e-11Initial program 92.4%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in t around 0 71.5%
associate-/l*77.5%
Simplified77.5%
Final simplification79.0%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (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 + ((z - t) * (y / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (a - t)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{a - t}
\end{array}
Initial program 86.3%
associate-*l/96.4%
Simplified96.4%
Final simplification96.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.6e-136) (+ x y) (if (<= t 5.2e+41) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.6e-136) {
tmp = x + y;
} else if (t <= 5.2e+41) {
tmp = x;
} 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.6d-136)) then
tmp = x + y
else if (t <= 5.2d+41) then
tmp = x
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.6e-136) {
tmp = x + y;
} else if (t <= 5.2e+41) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.6e-136: tmp = x + y elif t <= 5.2e+41: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.6e-136) tmp = Float64(x + y); elseif (t <= 5.2e+41) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.6e-136) tmp = x + y; elseif (t <= 5.2e+41) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.6e-136], N[(x + y), $MachinePrecision], If[LessEqual[t, 5.2e+41], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{-136}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{+41}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.59999999999999997e-136 or 5.2000000000000001e41 < t Initial program 81.0%
associate-*l/95.7%
Simplified95.7%
Taylor expanded in t around inf 73.7%
if -2.59999999999999997e-136 < t < 5.2000000000000001e41Initial program 93.7%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in x around inf 60.3%
Final simplification68.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 86.3%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in x around inf 51.9%
Final simplification51.9%
(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 2023200
(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))))