
(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 10 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 (/ t (/ (- a z) (- y z)))))
double code(double x, double y, double z, double t, double a) {
return x + (t / ((a - z) / (y - 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 + (t / ((a - z) / (y - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t / ((a - z) / (y - z)));
}
def code(x, y, z, t, a): return x + (t / ((a - z) / (y - z)))
function code(x, y, z, t, a) return Float64(x + Float64(t / Float64(Float64(a - z) / Float64(y - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + (t / ((a - z) / (y - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{t}{\frac{a - z}{y - z}}
\end{array}
Initial program 87.9%
associate-*l/98.4%
Simplified98.4%
*-commutative98.4%
clear-num98.4%
un-div-inv98.5%
Applied egg-rr98.5%
Final simplification98.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.8e+35) (not (<= z 3.45e+152))) (+ x t) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.8e+35) || !(z <= 3.45e+152)) {
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 ((z <= (-3.8d+35)) .or. (.not. (z <= 3.45d+152))) 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 ((z <= -3.8e+35) || !(z <= 3.45e+152)) {
tmp = x + t;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.8e+35) or not (z <= 3.45e+152): tmp = x + t else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.8e+35) || !(z <= 3.45e+152)) 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 ((z <= -3.8e+35) || ~((z <= 3.45e+152))) tmp = x + t; else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.8e+35], N[Not[LessEqual[z, 3.45e+152]], $MachinePrecision]], 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}\;z \leq -3.8 \cdot 10^{+35} \lor \neg \left(z \leq 3.45 \cdot 10^{+152}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -3.8e35 or 3.45e152 < z Initial program 74.5%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 88.0%
if -3.8e35 < z < 3.45e152Initial program 94.7%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in y around inf 88.2%
Final simplification88.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -180000000.0) (not (<= z 2.35e+111))) (+ x (- t (* y (/ t z)))) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -180000000.0) || !(z <= 2.35e+111)) {
tmp = x + (t - (y * (t / 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 ((z <= (-180000000.0d0)) .or. (.not. (z <= 2.35d+111))) then
tmp = x + (t - (y * (t / 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 ((z <= -180000000.0) || !(z <= 2.35e+111)) {
tmp = x + (t - (y * (t / z)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -180000000.0) or not (z <= 2.35e+111): tmp = x + (t - (y * (t / z))) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -180000000.0) || !(z <= 2.35e+111)) tmp = Float64(x + Float64(t - Float64(y * Float64(t / 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 ((z <= -180000000.0) || ~((z <= 2.35e+111))) tmp = x + (t - (y * (t / z))); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -180000000.0], N[Not[LessEqual[z, 2.35e+111]], $MachinePrecision]], N[(x + N[(t - N[(y * N[(t / 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}\;z \leq -180000000 \lor \neg \left(z \leq 2.35 \cdot 10^{+111}\right):\\
\;\;\;\;x + \left(t - y \cdot \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -1.8e8 or 2.35000000000000004e111 < z Initial program 74.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 70.0%
mul-1-neg70.0%
associate-/l*92.1%
distribute-neg-frac92.1%
Simplified92.1%
Taylor expanded in z around 0 84.5%
mul-1-neg84.5%
unsub-neg84.5%
associate-*l/93.1%
*-commutative93.1%
Simplified93.1%
if -1.8e8 < z < 2.35000000000000004e111Initial program 96.1%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in y around inf 89.4%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -105000000.0) (not (<= z 6e+111))) (+ x (- t (* y (/ t z)))) (+ x (/ t (/ (- a z) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -105000000.0) || !(z <= 6e+111)) {
tmp = x + (t - (y * (t / z)));
} 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 <= (-105000000.0d0)) .or. (.not. (z <= 6d+111))) then
tmp = x + (t - (y * (t / z)))
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 <= -105000000.0) || !(z <= 6e+111)) {
tmp = x + (t - (y * (t / z)));
} else {
tmp = x + (t / ((a - z) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -105000000.0) or not (z <= 6e+111): tmp = x + (t - (y * (t / z))) else: tmp = x + (t / ((a - z) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -105000000.0) || !(z <= 6e+111)) tmp = Float64(x + Float64(t - Float64(y * Float64(t / z)))); 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 <= -105000000.0) || ~((z <= 6e+111))) tmp = x + (t - (y * (t / z))); else tmp = x + (t / ((a - z) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -105000000.0], N[Not[LessEqual[z, 6e+111]], $MachinePrecision]], N[(x + N[(t - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -105000000 \lor \neg \left(z \leq 6 \cdot 10^{+111}\right):\\
\;\;\;\;x + \left(t - y \cdot \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\end{array}
\end{array}
if z < -1.05e8 or 6e111 < z Initial program 74.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 70.0%
mul-1-neg70.0%
associate-/l*92.1%
distribute-neg-frac92.1%
Simplified92.1%
Taylor expanded in z around 0 84.5%
mul-1-neg84.5%
unsub-neg84.5%
associate-*l/93.1%
*-commutative93.1%
Simplified93.1%
if -1.05e8 < z < 6e111Initial program 96.1%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in y around inf 89.3%
associate-/l*89.5%
Simplified89.5%
Final simplification90.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -105000000.0) (not (<= z 2.4e+111))) (+ x (- t (* y (/ t z)))) (+ x (/ y (/ (- a z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -105000000.0) || !(z <= 2.4e+111)) {
tmp = x + (t - (y * (t / z)));
} 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 <= (-105000000.0d0)) .or. (.not. (z <= 2.4d+111))) then
tmp = x + (t - (y * (t / z)))
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 <= -105000000.0) || !(z <= 2.4e+111)) {
tmp = x + (t - (y * (t / z)));
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -105000000.0) or not (z <= 2.4e+111): tmp = x + (t - (y * (t / z))) else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -105000000.0) || !(z <= 2.4e+111)) tmp = Float64(x + Float64(t - Float64(y * Float64(t / z)))); 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 <= -105000000.0) || ~((z <= 2.4e+111))) tmp = x + (t - (y * (t / z))); else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -105000000.0], N[Not[LessEqual[z, 2.4e+111]], $MachinePrecision]], N[(x + N[(t - N[(y * N[(t / z), $MachinePrecision]), $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 -105000000 \lor \neg \left(z \leq 2.4 \cdot 10^{+111}\right):\\
\;\;\;\;x + \left(t - y \cdot \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if z < -1.05e8 or 2.40000000000000006e111 < z Initial program 74.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 70.0%
mul-1-neg70.0%
associate-/l*92.1%
distribute-neg-frac92.1%
Simplified92.1%
Taylor expanded in z around 0 84.5%
mul-1-neg84.5%
unsub-neg84.5%
associate-*l/93.1%
*-commutative93.1%
Simplified93.1%
if -1.05e8 < z < 2.40000000000000006e111Initial program 96.1%
associate-*l/97.4%
Simplified97.4%
*-commutative97.4%
clear-num97.4%
un-div-inv97.6%
Applied egg-rr97.6%
Taylor expanded in y around inf 89.3%
associate-*r/89.4%
*-commutative89.4%
associate-/r/90.6%
Simplified90.6%
Final simplification91.6%
(FPCore (x y z t a)
:precision binary64
(if (<= y -2.8e+93)
(+ x (/ y (/ (- a z) t)))
(if (<= y 3.4e-103)
(- x (/ t (+ (/ a z) -1.0)))
(+ x (/ t (/ (- a z) y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.8e+93) {
tmp = x + (y / ((a - z) / t));
} else if (y <= 3.4e-103) {
tmp = x - (t / ((a / z) + -1.0));
} 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 (y <= (-2.8d+93)) then
tmp = x + (y / ((a - z) / t))
else if (y <= 3.4d-103) then
tmp = x - (t / ((a / z) + (-1.0d0)))
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 (y <= -2.8e+93) {
tmp = x + (y / ((a - z) / t));
} else if (y <= 3.4e-103) {
tmp = x - (t / ((a / z) + -1.0));
} else {
tmp = x + (t / ((a - z) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.8e+93: tmp = x + (y / ((a - z) / t)) elif y <= 3.4e-103: tmp = x - (t / ((a / z) + -1.0)) else: tmp = x + (t / ((a - z) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.8e+93) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); elseif (y <= 3.4e-103) tmp = Float64(x - Float64(t / Float64(Float64(a / z) + -1.0))); 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 (y <= -2.8e+93) tmp = x + (y / ((a - z) / t)); elseif (y <= 3.4e-103) tmp = x - (t / ((a / z) + -1.0)); else tmp = x + (t / ((a - z) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.8e+93], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e-103], N[(x - N[(t / N[(N[(a / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+93}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-103}:\\
\;\;\;\;x - \frac{t}{\frac{a}{z} + -1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\end{array}
\end{array}
if y < -2.79999999999999989e93Initial program 87.7%
associate-*l/93.7%
Simplified93.7%
*-commutative93.7%
clear-num93.7%
un-div-inv93.7%
Applied egg-rr93.7%
Taylor expanded in y around inf 87.6%
associate-*r/89.6%
*-commutative89.6%
associate-/r/95.6%
Simplified95.6%
if -2.79999999999999989e93 < y < 3.40000000000000003e-103Initial program 87.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 80.9%
mul-1-neg80.9%
associate-/l*92.9%
distribute-neg-frac92.9%
div-sub92.9%
*-inverses92.9%
Simplified92.9%
distribute-frac-neg92.9%
unsub-neg92.9%
sub-neg92.9%
metadata-eval92.9%
Applied egg-rr92.9%
if 3.40000000000000003e-103 < y Initial program 88.1%
associate-*l/99.0%
Simplified99.0%
Taylor expanded in y around inf 86.2%
associate-/l*92.3%
Simplified92.3%
Final simplification93.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -230000000.0) (not (<= z 2.35e+111))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -230000000.0) || !(z <= 2.35e+111)) {
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 <= (-230000000.0d0)) .or. (.not. (z <= 2.35d+111))) 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 <= -230000000.0) || !(z <= 2.35e+111)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -230000000.0) or not (z <= 2.35e+111): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -230000000.0) || !(z <= 2.35e+111)) 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 <= -230000000.0) || ~((z <= 2.35e+111))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -230000000.0], N[Not[LessEqual[z, 2.35e+111]], $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 -230000000 \lor \neg \left(z \leq 2.35 \cdot 10^{+111}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.3e8 or 2.35000000000000004e111 < z Initial program 74.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 84.7%
if -2.3e8 < z < 2.35000000000000004e111Initial program 96.1%
associate-*l/97.4%
Simplified97.4%
associate-/r/98.0%
clear-num98.0%
Applied egg-rr98.0%
Taylor expanded in z around 0 80.4%
associate-*l/81.7%
Simplified81.7%
Final simplification82.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.45e-27) (not (<= z 2.5e+111))) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.45e-27) || !(z <= 2.5e+111)) {
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 ((z <= (-1.45d-27)) .or. (.not. (z <= 2.5d+111))) 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 ((z <= -1.45e-27) || !(z <= 2.5e+111)) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.45e-27) or not (z <= 2.5e+111): tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.45e-27) || !(z <= 2.5e+111)) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.45e-27) || ~((z <= 2.5e+111))) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.45e-27], N[Not[LessEqual[z, 2.5e+111]], $MachinePrecision]], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{-27} \lor \neg \left(z \leq 2.5 \cdot 10^{+111}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.45000000000000002e-27 or 2.4999999999999998e111 < z Initial program 76.5%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.5%
if -1.45000000000000002e-27 < z < 2.4999999999999998e111Initial program 96.5%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in a around inf 84.1%
Taylor expanded in x around inf 53.6%
Final simplification64.3%
(FPCore (x y z t a) :precision binary64 (+ x (* t (/ (- y z) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + (t * ((y - z) / (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 + (t * ((y - z) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t * ((y - z) / (a - z)));
}
def code(x, y, z, t, a): return x + (t * ((y - z) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(t * Float64(Float64(y - z) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + (t * ((y - z) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + t \cdot \frac{y - z}{a - z}
\end{array}
Initial program 87.9%
associate-*l/98.4%
Simplified98.4%
Final simplification98.4%
(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 87.9%
associate-*l/98.4%
Simplified98.4%
Taylor expanded in a around inf 63.5%
Taylor expanded in x around inf 53.9%
Final simplification53.9%
(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 2024036
(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))))