
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
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 - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\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 z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
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 - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* (/ (- y z) (- a z)) t)))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) / (a - 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 - z) / (a - z)) * t)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) / (a - z)) * t);
}
def code(x, y, z, t, a): return x + (((y - z) / (a - z)) * t)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) / (a - z)) * t); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - z}{a - z} \cdot 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 (or (<= z -1.55e+67)
(not
(or (<= z -1.15e-18) (and (not (<= z -1.08e-162)) (<= z 1.2e-32)))))
(+ x t)
(+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.55e+67) || !((z <= -1.15e-18) || (!(z <= -1.08e-162) && (z <= 1.2e-32)))) {
tmp = x + t;
} else {
tmp = x + (y * (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 ((z <= (-1.55d+67)) .or. (.not. (z <= (-1.15d-18)) .or. (.not. (z <= (-1.08d-162))) .and. (z <= 1.2d-32))) then
tmp = x + t
else
tmp = x + (y * (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 ((z <= -1.55e+67) || !((z <= -1.15e-18) || (!(z <= -1.08e-162) && (z <= 1.2e-32)))) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.55e+67) or not ((z <= -1.15e-18) or (not (z <= -1.08e-162) and (z <= 1.2e-32))): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.55e+67) || !((z <= -1.15e-18) || (!(z <= -1.08e-162) && (z <= 1.2e-32)))) tmp = Float64(x + t); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.55e+67) || ~(((z <= -1.15e-18) || (~((z <= -1.08e-162)) && (z <= 1.2e-32))))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.55e+67], N[Not[Or[LessEqual[z, -1.15e-18], And[N[Not[LessEqual[z, -1.08e-162]], $MachinePrecision], LessEqual[z, 1.2e-32]]]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+67} \lor \neg \left(z \leq -1.15 \cdot 10^{-18} \lor \neg \left(z \leq -1.08 \cdot 10^{-162}\right) \land z \leq 1.2 \cdot 10^{-32}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.54999999999999998e67 or -1.15e-18 < z < -1.08000000000000006e-162 or 1.2000000000000001e-32 < z Initial program 79.2%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in z around inf 80.4%
if -1.54999999999999998e67 < z < -1.15e-18 or -1.08000000000000006e-162 < z < 1.2000000000000001e-32Initial program 93.2%
associate-*l/98.2%
Simplified98.2%
Taylor expanded in z around 0 74.3%
associate-/l*77.7%
associate-/r/77.7%
Simplified77.7%
Final simplification79.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.9e+69)
(+ x t)
(if (<= z -2e-19)
(+ x (* y (/ t a)))
(if (or (<= z -1.25e-162) (not (<= z 1.05e-32)))
(+ x t)
(+ x (* t (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.9e+69) {
tmp = x + t;
} else if (z <= -2e-19) {
tmp = x + (y * (t / a));
} else if ((z <= -1.25e-162) || !(z <= 1.05e-32)) {
tmp = x + t;
} else {
tmp = x + (t * (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 (z <= (-3.9d+69)) then
tmp = x + t
else if (z <= (-2d-19)) then
tmp = x + (y * (t / a))
else if ((z <= (-1.25d-162)) .or. (.not. (z <= 1.05d-32))) then
tmp = x + t
else
tmp = x + (t * (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 (z <= -3.9e+69) {
tmp = x + t;
} else if (z <= -2e-19) {
tmp = x + (y * (t / a));
} else if ((z <= -1.25e-162) || !(z <= 1.05e-32)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.9e+69: tmp = x + t elif z <= -2e-19: tmp = x + (y * (t / a)) elif (z <= -1.25e-162) or not (z <= 1.05e-32): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.9e+69) tmp = Float64(x + t); elseif (z <= -2e-19) tmp = Float64(x + Float64(y * Float64(t / a))); elseif ((z <= -1.25e-162) || !(z <= 1.05e-32)) tmp = Float64(x + t); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.9e+69) tmp = x + t; elseif (z <= -2e-19) tmp = x + (y * (t / a)); elseif ((z <= -1.25e-162) || ~((z <= 1.05e-32))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.9e+69], N[(x + t), $MachinePrecision], If[LessEqual[z, -2e-19], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.25e-162], N[Not[LessEqual[z, 1.05e-32]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+69}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-19}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-162} \lor \neg \left(z \leq 1.05 \cdot 10^{-32}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -3.8999999999999999e69 or -2e-19 < z < -1.25000000000000004e-162 or 1.05e-32 < z Initial program 79.2%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in z around inf 80.4%
if -3.8999999999999999e69 < z < -2e-19Initial program 86.9%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in z around 0 45.2%
associate-/l*53.7%
associate-/r/53.6%
Simplified53.6%
if -1.25000000000000004e-162 < z < 1.05e-32Initial program 94.7%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in z around 0 83.7%
Final simplification79.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -9.8e+67)
(+ x t)
(if (<= z -1.35e-18)
(+ x (/ t (/ a y)))
(if (or (<= z -1.25e-162) (not (<= z 1.22e-32)))
(+ x t)
(+ x (* t (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.8e+67) {
tmp = x + t;
} else if (z <= -1.35e-18) {
tmp = x + (t / (a / y));
} else if ((z <= -1.25e-162) || !(z <= 1.22e-32)) {
tmp = x + t;
} else {
tmp = x + (t * (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 (z <= (-9.8d+67)) then
tmp = x + t
else if (z <= (-1.35d-18)) then
tmp = x + (t / (a / y))
else if ((z <= (-1.25d-162)) .or. (.not. (z <= 1.22d-32))) then
tmp = x + t
else
tmp = x + (t * (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 (z <= -9.8e+67) {
tmp = x + t;
} else if (z <= -1.35e-18) {
tmp = x + (t / (a / y));
} else if ((z <= -1.25e-162) || !(z <= 1.22e-32)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9.8e+67: tmp = x + t elif z <= -1.35e-18: tmp = x + (t / (a / y)) elif (z <= -1.25e-162) or not (z <= 1.22e-32): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.8e+67) tmp = Float64(x + t); elseif (z <= -1.35e-18) tmp = Float64(x + Float64(t / Float64(a / y))); elseif ((z <= -1.25e-162) || !(z <= 1.22e-32)) tmp = Float64(x + t); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -9.8e+67) tmp = x + t; elseif (z <= -1.35e-18) tmp = x + (t / (a / y)); elseif ((z <= -1.25e-162) || ~((z <= 1.22e-32))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.8e+67], N[(x + t), $MachinePrecision], If[LessEqual[z, -1.35e-18], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.25e-162], N[Not[LessEqual[z, 1.22e-32]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{+67}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-18}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-162} \lor \neg \left(z \leq 1.22 \cdot 10^{-32}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -9.7999999999999998e67 or -1.34999999999999994e-18 < z < -1.25000000000000004e-162 or 1.22e-32 < z Initial program 79.2%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in z around inf 80.4%
if -9.7999999999999998e67 < z < -1.34999999999999994e-18Initial program 86.9%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in z around 0 45.2%
associate-/l*53.7%
Simplified53.7%
if -1.25000000000000004e-162 < z < 1.22e-32Initial program 94.7%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in z around 0 83.7%
Final simplification79.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1e+89)
(+ x t)
(if (<= z -3.7e-121)
(- x (* t (/ z a)))
(if (<= z 8.2e-38) (+ x (/ t (/ a y))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e+89) {
tmp = x + t;
} else if (z <= -3.7e-121) {
tmp = x - (t * (z / a));
} else if (z <= 8.2e-38) {
tmp = x + (t / (a / y));
} else {
tmp = x + 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 (z <= (-1d+89)) then
tmp = x + t
else if (z <= (-3.7d-121)) then
tmp = x - (t * (z / a))
else if (z <= 8.2d-38) then
tmp = x + (t / (a / y))
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e+89) {
tmp = x + t;
} else if (z <= -3.7e-121) {
tmp = x - (t * (z / a));
} else if (z <= 8.2e-38) {
tmp = x + (t / (a / y));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1e+89: tmp = x + t elif z <= -3.7e-121: tmp = x - (t * (z / a)) elif z <= 8.2e-38: tmp = x + (t / (a / y)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1e+89) tmp = Float64(x + t); elseif (z <= -3.7e-121) tmp = Float64(x - Float64(t * Float64(z / a))); elseif (z <= 8.2e-38) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1e+89) tmp = x + t; elseif (z <= -3.7e-121) tmp = x - (t * (z / a)); elseif (z <= 8.2e-38) tmp = x + (t / (a / y)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e+89], N[(x + t), $MachinePrecision], If[LessEqual[z, -3.7e-121], N[(x - N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e-38], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+89}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -3.7 \cdot 10^{-121}:\\
\;\;\;\;x - t \cdot \frac{z}{a}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-38}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -9.99999999999999995e88 or 8.1999999999999996e-38 < z Initial program 75.8%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 83.1%
if -9.99999999999999995e88 < z < -3.7000000000000002e-121Initial program 89.7%
associate-*l/97.7%
Simplified97.7%
Taylor expanded in a around inf 67.6%
Taylor expanded in x around 0 59.4%
+-commutative59.4%
associate-*l/69.6%
Simplified69.6%
Taylor expanded in y around 0 66.1%
mul-1-neg66.1%
associate-*l/68.2%
*-commutative68.2%
unsub-neg68.2%
associate-*r/66.1%
associate-*l/68.3%
*-commutative68.3%
Simplified68.3%
if -3.7000000000000002e-121 < z < 8.1999999999999996e-38Initial program 94.2%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in z around 0 77.2%
associate-/l*80.2%
Simplified80.2%
Final simplification79.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.6e+101) (not (<= z 2.65e+128))) (+ x t) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.6e+101) || !(z <= 2.65e+128)) {
tmp = x + t;
} else {
tmp = x + (y * (t / (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 ((z <= (-3.6d+101)) .or. (.not. (z <= 2.65d+128))) then
tmp = x + t
else
tmp = x + (y * (t / (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 ((z <= -3.6e+101) || !(z <= 2.65e+128)) {
tmp = x + t;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.6e+101) or not (z <= 2.65e+128): tmp = x + t else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.6e+101) || !(z <= 2.65e+128)) tmp = Float64(x + t); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.6e+101) || ~((z <= 2.65e+128))) tmp = x + t; else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.6e+101], N[Not[LessEqual[z, 2.65e+128]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+101} \lor \neg \left(z \leq 2.65 \cdot 10^{+128}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -3.60000000000000029e101 or 2.6500000000000001e128 < z Initial program 69.9%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 87.2%
if -3.60000000000000029e101 < z < 2.6500000000000001e128Initial program 92.4%
associate-/l*96.7%
clear-num96.7%
associate-/r/96.6%
clear-num96.7%
Applied egg-rr96.7%
Taylor expanded in y around inf 79.3%
associate-*l/83.2%
*-commutative83.2%
Simplified83.2%
Final simplification84.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.55e-170) (+ x (* y (/ t (- a z)))) (if (<= y 5.5e-238) (+ x t) (+ x (* t (/ y (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.55e-170) {
tmp = x + (y * (t / (a - z)));
} else if (y <= 5.5e-238) {
tmp = x + t;
} else {
tmp = x + (t * (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 (y <= (-1.55d-170)) then
tmp = x + (y * (t / (a - z)))
else if (y <= 5.5d-238) then
tmp = x + t
else
tmp = x + (t * (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 (y <= -1.55e-170) {
tmp = x + (y * (t / (a - z)));
} else if (y <= 5.5e-238) {
tmp = x + t;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.55e-170: tmp = x + (y * (t / (a - z))) elif y <= 5.5e-238: tmp = x + t else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.55e-170) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); elseif (y <= 5.5e-238) tmp = Float64(x + t); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.55e-170) tmp = x + (y * (t / (a - z))); elseif (y <= 5.5e-238) tmp = x + t; else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.55e-170], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e-238], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{-170}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-238}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if y < -1.54999999999999993e-170Initial program 86.9%
associate-/l*98.7%
clear-num98.6%
associate-/r/98.7%
clear-num98.9%
Applied egg-rr98.9%
Taylor expanded in y around inf 80.3%
associate-*l/87.9%
*-commutative87.9%
Simplified87.9%
if -1.54999999999999993e-170 < y < 5.49999999999999995e-238Initial program 87.8%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 84.1%
if 5.49999999999999995e-238 < y Initial program 82.6%
associate-*l/99.0%
Simplified99.0%
Taylor expanded in y around inf 82.0%
Final simplification84.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -2e-154) (+ x (* y (/ t (- a z)))) (if (<= y 1.65e-16) (+ x (/ t (- 1.0 (/ a z)))) (+ x (* t (/ y (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2e-154) {
tmp = x + (y * (t / (a - z)));
} else if (y <= 1.65e-16) {
tmp = x + (t / (1.0 - (a / z)));
} else {
tmp = x + (t * (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 (y <= (-2d-154)) then
tmp = x + (y * (t / (a - z)))
else if (y <= 1.65d-16) then
tmp = x + (t / (1.0d0 - (a / z)))
else
tmp = x + (t * (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 (y <= -2e-154) {
tmp = x + (y * (t / (a - z)));
} else if (y <= 1.65e-16) {
tmp = x + (t / (1.0 - (a / z)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2e-154: tmp = x + (y * (t / (a - z))) elif y <= 1.65e-16: tmp = x + (t / (1.0 - (a / z))) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2e-154) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); elseif (y <= 1.65e-16) tmp = Float64(x + Float64(t / Float64(1.0 - Float64(a / z)))); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2e-154) tmp = x + (y * (t / (a - z))); elseif (y <= 1.65e-16) tmp = x + (t / (1.0 - (a / z))); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2e-154], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e-16], N[(x + N[(t / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-154}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-16}:\\
\;\;\;\;x + \frac{t}{1 - \frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if y < -1.9999999999999999e-154Initial program 86.6%
associate-/l*98.6%
clear-num98.6%
associate-/r/98.7%
clear-num98.8%
Applied egg-rr98.8%
Taylor expanded in y around inf 79.9%
associate-*l/87.7%
*-commutative87.7%
Simplified87.7%
if -1.9999999999999999e-154 < y < 1.64999999999999994e-16Initial program 84.8%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in y around 0 80.8%
mul-1-neg80.8%
associate-/l*95.9%
distribute-neg-frac95.9%
div-sub95.9%
*-inverses95.9%
Simplified95.9%
frac-2neg95.9%
div-inv95.9%
remove-double-neg95.9%
sub-neg95.9%
metadata-eval95.9%
Applied egg-rr95.9%
associate-*r/95.9%
*-rgt-identity95.9%
neg-sub095.9%
+-commutative95.9%
associate--r+95.9%
metadata-eval95.9%
Simplified95.9%
if 1.64999999999999994e-16 < y Initial program 84.3%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in y around inf 89.8%
Final simplification91.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.6e+216) x (if (<= a 3.8e+144) (+ x t) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.6e+216) {
tmp = x;
} else if (a <= 3.8e+144) {
tmp = x + t;
} 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 (a <= (-2.6d+216)) then
tmp = x
else if (a <= 3.8d+144) then
tmp = x + t
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 (a <= -2.6e+216) {
tmp = x;
} else if (a <= 3.8e+144) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.6e+216: tmp = x elif a <= 3.8e+144: tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.6e+216) tmp = x; elseif (a <= 3.8e+144) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.6e+216) tmp = x; elseif (a <= 3.8e+144) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.6e+216], x, If[LessEqual[a, 3.8e+144], N[(x + t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{+216}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{+144}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.5999999999999999e216 or 3.80000000000000026e144 < a Initial program 79.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around 0 73.7%
associate-/l*89.2%
Simplified89.2%
Taylor expanded in x around inf 78.2%
if -2.5999999999999999e216 < a < 3.80000000000000026e144Initial program 86.4%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in z around inf 65.5%
Final simplification67.6%
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ t (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (t / (a - z)));
}
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 - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (t / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * (t / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * (t / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t}{a - z}
\end{array}
Initial program 85.3%
associate-/l*96.2%
clear-num96.2%
associate-/r/96.1%
clear-num96.2%
Applied egg-rr96.2%
Final simplification96.2%
(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%
associate-*l/98.4%
Simplified98.4%
Taylor expanded in z around 0 60.9%
associate-/l*63.4%
Simplified63.4%
Taylor expanded in x around inf 54.4%
Final simplification54.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} 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) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (a - z))
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) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024027
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))