
(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 83.5%
associate-*l/97.4%
Simplified97.4%
Final simplification97.4%
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -1.8e+82)
(and (not (<= z 3.2e-7)) (or (<= z 3.6e+129) (not (<= z 2.6e+175)))))
(+ x t)
(+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.8e+82) || (!(z <= 3.2e-7) && ((z <= 3.6e+129) || !(z <= 2.6e+175)))) {
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 <= (-1.8d+82)) .or. (.not. (z <= 3.2d-7)) .and. (z <= 3.6d+129) .or. (.not. (z <= 2.6d+175))) 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 <= -1.8e+82) || (!(z <= 3.2e-7) && ((z <= 3.6e+129) || !(z <= 2.6e+175)))) {
tmp = x + t;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.8e+82) or (not (z <= 3.2e-7) and ((z <= 3.6e+129) or not (z <= 2.6e+175))): tmp = x + t else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.8e+82) || (!(z <= 3.2e-7) && ((z <= 3.6e+129) || !(z <= 2.6e+175)))) 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 <= -1.8e+82) || (~((z <= 3.2e-7)) && ((z <= 3.6e+129) || ~((z <= 2.6e+175))))) 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, -1.8e+82], And[N[Not[LessEqual[z, 3.2e-7]], $MachinePrecision], Or[LessEqual[z, 3.6e+129], N[Not[LessEqual[z, 2.6e+175]], $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 -1.8 \cdot 10^{+82} \lor \neg \left(z \leq 3.2 \cdot 10^{-7}\right) \land \left(z \leq 3.6 \cdot 10^{+129} \lor \neg \left(z \leq 2.6 \cdot 10^{+175}\right)\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -1.80000000000000007e82 or 3.2000000000000001e-7 < z < 3.6000000000000001e129 or 2.6e175 < z Initial program 67.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.6%
if -1.80000000000000007e82 < z < 3.2000000000000001e-7 or 3.6000000000000001e129 < z < 2.6e175Initial program 93.6%
associate-/l*97.5%
clear-num97.4%
associate-/r/96.9%
clear-num96.9%
Applied egg-rr96.9%
Taylor expanded in y around inf 84.1%
associate-*l/87.7%
*-commutative87.7%
Simplified87.7%
Final simplification85.0%
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -3.4e+79)
(and (not (<= z 3.2e-7)) (or (<= z 2.65e+126) (not (<= z 3.1e+174)))))
(+ x t)
(+ x (/ y (/ (- a z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.4e+79) || (!(z <= 3.2e-7) && ((z <= 2.65e+126) || !(z <= 3.1e+174)))) {
tmp = x + t;
} else {
tmp = x + (y / ((a - 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 ((z <= (-3.4d+79)) .or. (.not. (z <= 3.2d-7)) .and. (z <= 2.65d+126) .or. (.not. (z <= 3.1d+174))) then
tmp = x + t
else
tmp = x + (y / ((a - 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 ((z <= -3.4e+79) || (!(z <= 3.2e-7) && ((z <= 2.65e+126) || !(z <= 3.1e+174)))) {
tmp = x + t;
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.4e+79) or (not (z <= 3.2e-7) and ((z <= 2.65e+126) or not (z <= 3.1e+174))): tmp = x + t else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.4e+79) || (!(z <= 3.2e-7) && ((z <= 2.65e+126) || !(z <= 3.1e+174)))) tmp = Float64(x + t); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.4e+79) || (~((z <= 3.2e-7)) && ((z <= 2.65e+126) || ~((z <= 3.1e+174))))) tmp = x + t; else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.4e+79], And[N[Not[LessEqual[z, 3.2e-7]], $MachinePrecision], Or[LessEqual[z, 2.65e+126], N[Not[LessEqual[z, 3.1e+174]], $MachinePrecision]]]], N[(x + t), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+79} \lor \neg \left(z \leq 3.2 \cdot 10^{-7}\right) \land \left(z \leq 2.65 \cdot 10^{+126} \lor \neg \left(z \leq 3.1 \cdot 10^{+174}\right)\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if z < -3.40000000000000032e79 or 3.2000000000000001e-7 < z < 2.65000000000000014e126 or 3.1e174 < z Initial program 67.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.6%
if -3.40000000000000032e79 < z < 3.2000000000000001e-7 or 2.65000000000000014e126 < z < 3.1e174Initial program 93.6%
associate-*l/95.8%
Simplified95.8%
Taylor expanded in y around inf 85.7%
associate-*l/84.1%
associate-/l*87.8%
Applied egg-rr87.8%
Final simplification85.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -7.8e+81)
(+ x t)
(if (<= z 3.2e-7)
(+ x (* y (/ t (- a z))))
(if (or (<= z 1.4e+126) (not (<= z 2.9e+175)))
(+ x t)
(+ x (/ t (/ (- a z) y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.8e+81) {
tmp = x + t;
} else if (z <= 3.2e-7) {
tmp = x + (y * (t / (a - z)));
} else if ((z <= 1.4e+126) || !(z <= 2.9e+175)) {
tmp = x + t;
} else {
tmp = x + (t / ((a - z) / 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 (z <= (-7.8d+81)) then
tmp = x + t
else if (z <= 3.2d-7) then
tmp = x + (y * (t / (a - z)))
else if ((z <= 1.4d+126) .or. (.not. (z <= 2.9d+175))) then
tmp = x + t
else
tmp = x + (t / ((a - z) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.8e+81) {
tmp = x + t;
} else if (z <= 3.2e-7) {
tmp = x + (y * (t / (a - z)));
} else if ((z <= 1.4e+126) || !(z <= 2.9e+175)) {
tmp = x + t;
} else {
tmp = x + (t / ((a - z) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.8e+81: tmp = x + t elif z <= 3.2e-7: tmp = x + (y * (t / (a - z))) elif (z <= 1.4e+126) or not (z <= 2.9e+175): tmp = x + t else: tmp = x + (t / ((a - z) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.8e+81) tmp = Float64(x + t); elseif (z <= 3.2e-7) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); elseif ((z <= 1.4e+126) || !(z <= 2.9e+175)) tmp = Float64(x + t); else tmp = Float64(x + Float64(t / Float64(Float64(a - z) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.8e+81) tmp = x + t; elseif (z <= 3.2e-7) tmp = x + (y * (t / (a - z))); elseif ((z <= 1.4e+126) || ~((z <= 2.9e+175))) tmp = x + t; else tmp = x + (t / ((a - z) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.8e+81], N[(x + t), $MachinePrecision], If[LessEqual[z, 3.2e-7], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.4e+126], N[Not[LessEqual[z, 2.9e+175]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+81}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-7}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+126} \lor \neg \left(z \leq 2.9 \cdot 10^{+175}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\end{array}
\end{array}
if z < -7.8000000000000002e81 or 3.2000000000000001e-7 < z < 1.40000000000000005e126 or 2.9e175 < z Initial program 67.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.6%
if -7.8000000000000002e81 < z < 3.2000000000000001e-7Initial program 94.5%
associate-/l*97.3%
clear-num97.3%
associate-/r/96.7%
clear-num96.7%
Applied egg-rr96.7%
Taylor expanded in y around inf 85.6%
associate-*l/88.8%
*-commutative88.8%
Simplified88.8%
if 1.40000000000000005e126 < z < 2.9e175Initial program 82.4%
associate-*l/99.7%
Simplified99.7%
Taylor expanded in y around inf 64.4%
associate-/l*73.2%
Simplified73.2%
Final simplification85.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e+80) (not (<= z 5.1e-44))) (- x (* t (+ (/ y z) -1.0))) (+ x (/ y (/ (- a z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e+80) || !(z <= 5.1e-44)) {
tmp = x - (t * ((y / z) + -1.0));
} else {
tmp = x + (y / ((a - 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 ((z <= (-1.1d+80)) .or. (.not. (z <= 5.1d-44))) then
tmp = x - (t * ((y / z) + (-1.0d0)))
else
tmp = x + (y / ((a - 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 ((z <= -1.1e+80) || !(z <= 5.1e-44)) {
tmp = x - (t * ((y / z) + -1.0));
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.1e+80) or not (z <= 5.1e-44): tmp = x - (t * ((y / z) + -1.0)) else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e+80) || !(z <= 5.1e-44)) tmp = Float64(x - Float64(t * Float64(Float64(y / z) + -1.0))); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.1e+80) || ~((z <= 5.1e-44))) tmp = x - (t * ((y / z) + -1.0)); else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.1e+80], N[Not[LessEqual[z, 5.1e-44]], $MachinePrecision]], N[(x - N[(t * N[(N[(y / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+80} \lor \neg \left(z \leq 5.1 \cdot 10^{-44}\right):\\
\;\;\;\;x - t \cdot \left(\frac{y}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if z < -1.10000000000000001e80 or 5.1000000000000005e-44 < z Initial program 70.7%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 82.9%
mul-1-neg82.9%
div-sub83.0%
sub-neg83.0%
*-inverses83.0%
metadata-eval83.0%
Simplified83.0%
if -1.10000000000000001e80 < z < 5.1000000000000005e-44Initial program 94.2%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in y around inf 86.7%
associate-*l/85.6%
associate-/l*89.1%
Applied egg-rr89.1%
Final simplification86.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.12e+82) (not (<= z 2.5e-7))) (- x (/ t (+ (/ a z) -1.0))) (+ x (/ y (/ (- a z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.12e+82) || !(z <= 2.5e-7)) {
tmp = x - (t / ((a / z) + -1.0));
} else {
tmp = x + (y / ((a - 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 ((z <= (-1.12d+82)) .or. (.not. (z <= 2.5d-7))) then
tmp = x - (t / ((a / z) + (-1.0d0)))
else
tmp = x + (y / ((a - 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 ((z <= -1.12e+82) || !(z <= 2.5e-7)) {
tmp = x - (t / ((a / z) + -1.0));
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.12e+82) or not (z <= 2.5e-7): tmp = x - (t / ((a / z) + -1.0)) else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.12e+82) || !(z <= 2.5e-7)) tmp = Float64(x - Float64(t / Float64(Float64(a / z) + -1.0))); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.12e+82) || ~((z <= 2.5e-7))) tmp = x - (t / ((a / z) + -1.0)); else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.12e+82], N[Not[LessEqual[z, 2.5e-7]], $MachinePrecision]], N[(x - N[(t / N[(N[(a / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{+82} \lor \neg \left(z \leq 2.5 \cdot 10^{-7}\right):\\
\;\;\;\;x - \frac{t}{\frac{a}{z} + -1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if z < -1.11999999999999998e82 or 2.49999999999999989e-7 < z Initial program 69.1%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 63.8%
mul-1-neg63.8%
associate-/l*90.1%
distribute-neg-frac90.1%
div-sub90.1%
*-inverses90.1%
Simplified90.1%
if -1.11999999999999998e82 < z < 2.49999999999999989e-7Initial program 94.5%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in y around inf 86.6%
associate-*l/85.6%
associate-/l*88.9%
Applied egg-rr88.9%
Final simplification89.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.5e+17) (not (<= z 4.1e-8))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.5e+17) || !(z <= 4.1e-8)) {
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 <= (-2.5d+17)) .or. (.not. (z <= 4.1d-8))) 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 <= -2.5e+17) || !(z <= 4.1e-8)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.5e+17) or not (z <= 4.1e-8): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.5e+17) || !(z <= 4.1e-8)) 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 <= -2.5e+17) || ~((z <= 4.1e-8))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.5e+17], N[Not[LessEqual[z, 4.1e-8]], $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 -2.5 \cdot 10^{+17} \lor \neg \left(z \leq 4.1 \cdot 10^{-8}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.5e17 or 4.10000000000000032e-8 < z Initial program 70.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 73.9%
if -2.5e17 < z < 4.10000000000000032e-8Initial program 95.3%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in z around 0 77.3%
associate-/l*79.1%
associate-/r/80.8%
Applied egg-rr80.8%
Final simplification77.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -310.0) (not (<= z 5.1e-8))) (+ x t) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -310.0) || !(z <= 5.1e-8)) {
tmp = x + t;
} else {
tmp = x + (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 ((z <= (-310.0d0)) .or. (.not. (z <= 5.1d-8))) then
tmp = x + t
else
tmp = x + (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 ((z <= -310.0) || !(z <= 5.1e-8)) {
tmp = x + t;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -310.0) or not (z <= 5.1e-8): tmp = x + t else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -310.0) || !(z <= 5.1e-8)) tmp = Float64(x + t); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -310.0) || ~((z <= 5.1e-8))) tmp = x + t; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -310.0], N[Not[LessEqual[z, 5.1e-8]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -310 \lor \neg \left(z \leq 5.1 \cdot 10^{-8}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -310 or 5.10000000000000001e-8 < z Initial program 70.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 73.9%
if -310 < z < 5.10000000000000001e-8Initial program 95.3%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in z around 0 77.3%
associate-/l*79.1%
associate-/r/80.8%
Applied egg-rr80.8%
*-commutative80.8%
clear-num80.8%
un-div-inv80.8%
Applied egg-rr80.8%
Final simplification77.5%
(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 83.5%
associate-/l*97.3%
clear-num97.2%
associate-/r/96.9%
clear-num96.9%
Applied egg-rr96.9%
Final simplification96.9%
(FPCore (x y z t a) :precision binary64 (if (<= a 4.1e+116) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 4.1e+116) {
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 <= 4.1d+116) 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 <= 4.1e+116) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 4.1e+116: tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 4.1e+116) 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 <= 4.1e+116) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 4.1e+116], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.1 \cdot 10^{+116}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 4.0999999999999998e116Initial program 84.7%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in z around inf 62.8%
if 4.0999999999999998e116 < a Initial program 74.4%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around inf 72.4%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in y around 0 75.9%
associate-*r/75.9%
neg-mul-175.9%
Simplified75.9%
Taylor expanded in x around inf 63.4%
Final simplification62.8%
(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 83.5%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in a around inf 60.5%
associate-/l*62.1%
Simplified62.1%
Taylor expanded in y around 0 46.4%
associate-*r/46.4%
neg-mul-146.4%
Simplified46.4%
Taylor expanded in x around inf 48.7%
Final simplification48.7%
(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 2024021
(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))))