
(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 (* (/ (- 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 88.2%
associate-*l/97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.1e-79)
(+ x t)
(if (<= z 2.4e-75)
(+ x (/ y (/ a t)))
(if (<= z 2.7e-32)
(- x (* y (/ t z)))
(if (<= z 1.3e+33) (+ x (* t (/ y a))) (+ x t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e-79) {
tmp = x + t;
} else if (z <= 2.4e-75) {
tmp = x + (y / (a / t));
} else if (z <= 2.7e-32) {
tmp = x - (y * (t / z));
} else if (z <= 1.3e+33) {
tmp = x + (t * (y / a));
} 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 <= (-1.1d-79)) then
tmp = x + t
else if (z <= 2.4d-75) then
tmp = x + (y / (a / t))
else if (z <= 2.7d-32) then
tmp = x - (y * (t / z))
else if (z <= 1.3d+33) then
tmp = x + (t * (y / a))
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 <= -1.1e-79) {
tmp = x + t;
} else if (z <= 2.4e-75) {
tmp = x + (y / (a / t));
} else if (z <= 2.7e-32) {
tmp = x - (y * (t / z));
} else if (z <= 1.3e+33) {
tmp = x + (t * (y / a));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e-79: tmp = x + t elif z <= 2.4e-75: tmp = x + (y / (a / t)) elif z <= 2.7e-32: tmp = x - (y * (t / z)) elif z <= 1.3e+33: tmp = x + (t * (y / a)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e-79) tmp = Float64(x + t); elseif (z <= 2.4e-75) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 2.7e-32) tmp = Float64(x - Float64(y * Float64(t / z))); elseif (z <= 1.3e+33) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.1e-79) tmp = x + t; elseif (z <= 2.4e-75) tmp = x + (y / (a / t)); elseif (z <= 2.7e-32) tmp = x - (y * (t / z)); elseif (z <= 1.3e+33) tmp = x + (t * (y / a)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e-79], N[(x + t), $MachinePrecision], If[LessEqual[z, 2.4e-75], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e-32], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+33], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-79}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-75}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-32}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+33}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.0999999999999999e-79 or 1.2999999999999999e33 < z Initial program 78.8%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.4%
if -1.0999999999999999e-79 < z < 2.40000000000000019e-75Initial program 97.3%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in z around 0 90.0%
associate-/l*89.1%
associate-/r/89.9%
Applied egg-rr89.9%
*-commutative89.9%
clear-num89.8%
un-div-inv90.3%
Applied egg-rr90.3%
if 2.40000000000000019e-75 < z < 2.69999999999999981e-32Initial program 99.7%
associate-/l*99.8%
clear-num99.5%
associate-/r/99.5%
clear-num99.3%
Applied egg-rr99.3%
Taylor expanded in y around inf 89.2%
associate-*l/88.9%
*-commutative88.9%
Simplified88.9%
Taylor expanded in a around 0 77.1%
associate-*r/77.1%
neg-mul-177.1%
Simplified77.1%
if 2.69999999999999981e-32 < z < 1.2999999999999999e33Initial program 99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in z around 0 81.2%
Final simplification83.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.5e+20) (not (<= z 9e+67))) (+ x t) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e+20) || !(z <= 9e+67)) {
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 <= (-4.5d+20)) .or. (.not. (z <= 9d+67))) 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 <= -4.5e+20) || !(z <= 9e+67)) {
tmp = x + t;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.5e+20) or not (z <= 9e+67): tmp = x + t else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.5e+20) || !(z <= 9e+67)) 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 <= -4.5e+20) || ~((z <= 9e+67))) 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, -4.5e+20], N[Not[LessEqual[z, 9e+67]], $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 -4.5 \cdot 10^{+20} \lor \neg \left(z \leq 9 \cdot 10^{+67}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -4.5e20 or 8.9999999999999997e67 < z Initial program 73.8%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 83.7%
if -4.5e20 < z < 8.9999999999999997e67Initial program 97.6%
associate-/l*96.5%
clear-num96.4%
associate-/r/96.2%
clear-num96.2%
Applied egg-rr96.2%
Taylor expanded in y around inf 90.8%
associate-*l/90.6%
*-commutative90.6%
Simplified90.6%
Final simplification87.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.22e+120) (not (<= z 2.15e+69))) (+ x t) (+ x (/ (* y t) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.22e+120) || !(z <= 2.15e+69)) {
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.22d+120)) .or. (.not. (z <= 2.15d+69))) 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.22e+120) || !(z <= 2.15e+69)) {
tmp = x + t;
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.22e+120) or not (z <= 2.15e+69): 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.22e+120) || !(z <= 2.15e+69)) tmp = Float64(x + t); else tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.22e+120) || ~((z <= 2.15e+69))) 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.22e+120], N[Not[LessEqual[z, 2.15e+69]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{+120} \lor \neg \left(z \leq 2.15 \cdot 10^{+69}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\end{array}
\end{array}
if z < -1.22e120 or 2.14999999999999996e69 < z Initial program 67.4%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 84.6%
if -1.22e120 < z < 2.14999999999999996e69Initial program 97.8%
associate-*l/96.0%
Simplified96.0%
Taylor expanded in y around inf 89.6%
Final simplification88.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.9e-39) (not (<= z 4e+32))) (- x (* t (+ (/ y z) -1.0))) (+ x (/ (* y t) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.9e-39) || !(z <= 4e+32)) {
tmp = x - (t * ((y / z) + -1.0));
} 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 <= (-2.9d-39)) .or. (.not. (z <= 4d+32))) then
tmp = x - (t * ((y / z) + (-1.0d0)))
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 <= -2.9e-39) || !(z <= 4e+32)) {
tmp = x - (t * ((y / z) + -1.0));
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.9e-39) or not (z <= 4e+32): tmp = x - (t * ((y / z) + -1.0)) else: tmp = x + ((y * t) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.9e-39) || !(z <= 4e+32)) tmp = Float64(x - Float64(t * Float64(Float64(y / z) + -1.0))); else tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.9e-39) || ~((z <= 4e+32))) tmp = x - (t * ((y / z) + -1.0)); else tmp = x + ((y * t) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.9e-39], N[Not[LessEqual[z, 4e+32]], $MachinePrecision]], N[(x - N[(t * N[(N[(y / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-39} \lor \neg \left(z \leq 4 \cdot 10^{+32}\right):\\
\;\;\;\;x - t \cdot \left(\frac{y}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\end{array}
\end{array}
if z < -2.89999999999999988e-39 or 4.00000000000000021e32 < z Initial program 77.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 89.2%
mul-1-neg89.2%
div-sub89.3%
sub-neg89.3%
*-inverses89.3%
metadata-eval89.3%
Simplified89.3%
distribute-lft-neg-out89.3%
unsub-neg89.3%
*-commutative89.3%
Applied egg-rr89.3%
if -2.89999999999999988e-39 < z < 4.00000000000000021e32Initial program 97.8%
associate-*l/94.8%
Simplified94.8%
Taylor expanded in y around inf 92.1%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e-80) (not (<= z 1.56e+33))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e-80) || !(z <= 1.56e+33)) {
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.1d-80)) .or. (.not. (z <= 1.56d+33))) 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.1e-80) || !(z <= 1.56e+33)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.1e-80) or not (z <= 1.56e+33): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e-80) || !(z <= 1.56e+33)) 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.1e-80) || ~((z <= 1.56e+33))) 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.1e-80], N[Not[LessEqual[z, 1.56e+33]], $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.1 \cdot 10^{-80} \lor \neg \left(z \leq 1.56 \cdot 10^{+33}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.10000000000000005e-80 or 1.56e33 < z Initial program 78.8%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.4%
if -1.10000000000000005e-80 < z < 1.56e33Initial program 97.7%
associate-*l/94.5%
Simplified94.5%
Taylor expanded in z around 0 85.1%
associate-/l*83.8%
associate-/r/85.0%
Applied egg-rr85.0%
Final simplification81.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.6e-80) (not (<= z 3e+33))) (+ x t) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.6e-80) || !(z <= 3e+33)) {
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 <= (-9.6d-80)) .or. (.not. (z <= 3d+33))) 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 <= -9.6e-80) || !(z <= 3e+33)) {
tmp = x + t;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.6e-80) or not (z <= 3e+33): tmp = x + t else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.6e-80) || !(z <= 3e+33)) 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 <= -9.6e-80) || ~((z <= 3e+33))) tmp = x + t; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.6e-80], N[Not[LessEqual[z, 3e+33]], $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 -9.6 \cdot 10^{-80} \lor \neg \left(z \leq 3 \cdot 10^{+33}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -9.5999999999999996e-80 or 2.99999999999999984e33 < z Initial program 78.8%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.4%
if -9.5999999999999996e-80 < z < 2.99999999999999984e33Initial program 97.7%
associate-*l/94.5%
Simplified94.5%
Taylor expanded in z around 0 85.1%
associate-/l*83.8%
associate-/r/85.0%
Applied egg-rr85.0%
*-commutative85.0%
clear-num85.0%
un-div-inv85.4%
Applied egg-rr85.4%
Final simplification81.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.05e-80) (not (<= z 3.7e-87))) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.05e-80) || !(z <= 3.7e-87)) {
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.05d-80)) .or. (.not. (z <= 3.7d-87))) 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.05e-80) || !(z <= 3.7e-87)) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.05e-80) or not (z <= 3.7e-87): tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.05e-80) || !(z <= 3.7e-87)) 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.05e-80) || ~((z <= 3.7e-87))) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.05e-80], N[Not[LessEqual[z, 3.7e-87]], $MachinePrecision]], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-80} \lor \neg \left(z \leq 3.7 \cdot 10^{-87}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.05000000000000001e-80 or 3.7000000000000002e-87 < z Initial program 82.0%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in z around inf 73.3%
if -1.05000000000000001e-80 < z < 3.7000000000000002e-87Initial program 97.2%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in z around 0 91.5%
Taylor expanded in x around inf 52.6%
Final simplification64.9%
(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 88.2%
associate-/l*95.2%
clear-num95.1%
associate-/r/95.0%
clear-num95.4%
Applied egg-rr95.4%
Final simplification95.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 88.2%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in z around 0 66.1%
Taylor expanded in x around inf 52.5%
Final simplification52.5%
(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 2024031
(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))))