
(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 12 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
(let* ((t_1 (/ (* (- y z) t) (- a z))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+266)))
(+ x (* (- y z) (/ t (- a z))))
(+ t_1 x))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+266)) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = t_1 + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) * t) / (a - z);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+266)) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = t_1 + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - z) * t) / (a - z) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+266): tmp = x + ((y - z) * (t / (a - z))) else: tmp = t_1 + x return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+266)) tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))); else tmp = Float64(t_1 + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - z) * t) / (a - z); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 1e+266))) tmp = x + ((y - z) * (t / (a - z))); else tmp = t_1 + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+266]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+266}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0 or 1e266 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 42.3%
associate-/l*99.9%
Simplified99.9%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 1e266Initial program 99.8%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.18e-51)
(+ t x)
(if (<= z 1.65e-87)
(+ x (* y (/ t a)))
(if (<= z 1150000000.0) (- x (* t (/ y z))) (+ t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.18e-51) {
tmp = t + x;
} else if (z <= 1.65e-87) {
tmp = x + (y * (t / a));
} else if (z <= 1150000000.0) {
tmp = x - (t * (y / z));
} else {
tmp = t + 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.18d-51)) then
tmp = t + x
else if (z <= 1.65d-87) then
tmp = x + (y * (t / a))
else if (z <= 1150000000.0d0) then
tmp = x - (t * (y / z))
else
tmp = t + 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.18e-51) {
tmp = t + x;
} else if (z <= 1.65e-87) {
tmp = x + (y * (t / a));
} else if (z <= 1150000000.0) {
tmp = x - (t * (y / z));
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.18e-51: tmp = t + x elif z <= 1.65e-87: tmp = x + (y * (t / a)) elif z <= 1150000000.0: tmp = x - (t * (y / z)) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.18e-51) tmp = Float64(t + x); elseif (z <= 1.65e-87) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 1150000000.0) tmp = Float64(x - Float64(t * Float64(y / z))); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.18e-51) tmp = t + x; elseif (z <= 1.65e-87) tmp = x + (y * (t / a)); elseif (z <= 1150000000.0) tmp = x - (t * (y / z)); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.18e-51], N[(t + x), $MachinePrecision], If[LessEqual[z, 1.65e-87], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1150000000.0], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.18 \cdot 10^{-51}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-87}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 1150000000:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -1.18000000000000004e-51 or 1.15e9 < z Initial program 73.4%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in z around inf 78.9%
if -1.18000000000000004e-51 < z < 1.65e-87Initial program 97.3%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in z around 0 77.4%
associate-/l*74.4%
Simplified74.4%
clear-num74.5%
un-div-inv75.3%
Applied egg-rr75.3%
associate-/r/77.8%
Simplified77.8%
if 1.65e-87 < z < 1.15e9Initial program 100.0%
Taylor expanded in y around inf 79.3%
Taylor expanded in a around 0 68.7%
mul-1-neg68.7%
unsub-neg68.7%
associate-/l*68.7%
Simplified68.7%
Final simplification77.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.48e-18) (not (<= z 1700000000.0))) (+ x (* t (/ z (- z a)))) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.48e-18) || !(z <= 1700000000.0)) {
tmp = x + (t * (z / (z - a)));
} 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.48d-18)) .or. (.not. (z <= 1700000000.0d0))) then
tmp = x + (t * (z / (z - a)))
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.48e-18) || !(z <= 1700000000.0)) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.48e-18) or not (z <= 1700000000.0): tmp = x + (t * (z / (z - a))) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.48e-18) || !(z <= 1700000000.0)) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); 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.48e-18) || ~((z <= 1700000000.0))) tmp = x + (t * (z / (z - a))); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.48e-18], N[Not[LessEqual[z, 1700000000.0]], $MachinePrecision]], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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.48 \cdot 10^{-18} \lor \neg \left(z \leq 1700000000\right):\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -1.48000000000000002e-18 or 1.7e9 < z Initial program 71.9%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in y around 0 66.5%
mul-1-neg66.5%
associate-/l*91.4%
distribute-rgt-neg-in91.4%
distribute-neg-frac291.4%
neg-sub091.4%
sub-neg91.4%
+-commutative91.4%
associate--r+91.4%
neg-sub091.4%
remove-double-neg91.4%
Simplified91.4%
if -1.48000000000000002e-18 < z < 1.7e9Initial program 97.8%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in y around inf 88.4%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.3e-52) (not (<= z 2.75e-98))) (+ x (* t (/ z (- z a)))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e-52) || !(z <= 2.75e-98)) {
tmp = x + (t * (z / (z - a)));
} 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 <= (-4.3d-52)) .or. (.not. (z <= 2.75d-98))) then
tmp = x + (t * (z / (z - a)))
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 <= -4.3e-52) || !(z <= 2.75e-98)) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.3e-52) or not (z <= 2.75e-98): tmp = x + (t * (z / (z - a))) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.3e-52) || !(z <= 2.75e-98)) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); 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 <= -4.3e-52) || ~((z <= 2.75e-98))) tmp = x + (t * (z / (z - a))); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.3e-52], N[Not[LessEqual[z, 2.75e-98]], $MachinePrecision]], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-52} \lor \neg \left(z \leq 2.75 \cdot 10^{-98}\right):\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -4.3000000000000003e-52 or 2.7499999999999999e-98 < z Initial program 77.2%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in y around 0 66.1%
mul-1-neg66.1%
associate-/l*86.4%
distribute-rgt-neg-in86.4%
distribute-neg-frac286.4%
neg-sub086.4%
sub-neg86.4%
+-commutative86.4%
associate--r+86.4%
neg-sub086.4%
remove-double-neg86.4%
Simplified86.4%
if -4.3000000000000003e-52 < z < 2.7499999999999999e-98Initial program 97.2%
associate-/l*94.1%
Simplified94.1%
Taylor expanded in z around 0 76.8%
associate-/l*73.7%
Simplified73.7%
clear-num73.7%
un-div-inv74.6%
Applied egg-rr74.6%
associate-/r/77.1%
Simplified77.1%
Final simplification82.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.9e-21)
(+ x (* t (/ z (- z a))))
(if (<= z 1300000000.0)
(+ x (/ (* y t) (- a z)))
(+ x (/ t (/ (- z a) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.9e-21) {
tmp = x + (t * (z / (z - a)));
} else if (z <= 1300000000.0) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + (t / ((z - 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 <= (-5.9d-21)) then
tmp = x + (t * (z / (z - a)))
else if (z <= 1300000000.0d0) then
tmp = x + ((y * t) / (a - z))
else
tmp = x + (t / ((z - 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 <= -5.9e-21) {
tmp = x + (t * (z / (z - a)));
} else if (z <= 1300000000.0) {
tmp = x + ((y * t) / (a - z));
} else {
tmp = x + (t / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.9e-21: tmp = x + (t * (z / (z - a))) elif z <= 1300000000.0: tmp = x + ((y * t) / (a - z)) else: tmp = x + (t / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.9e-21) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); elseif (z <= 1300000000.0) tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); else tmp = Float64(x + Float64(t / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.9e-21) tmp = x + (t * (z / (z - a))); elseif (z <= 1300000000.0) tmp = x + ((y * t) / (a - z)); else tmp = x + (t / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.9e-21], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1300000000.0], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.9 \cdot 10^{-21}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 1300000000:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if z < -5.9000000000000003e-21Initial program 73.3%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in y around 0 68.3%
mul-1-neg68.3%
associate-/l*89.9%
distribute-rgt-neg-in89.9%
distribute-neg-frac289.9%
neg-sub089.9%
sub-neg89.9%
+-commutative89.9%
associate--r+89.9%
neg-sub089.9%
remove-double-neg89.9%
Simplified89.9%
if -5.9000000000000003e-21 < z < 1.3e9Initial program 97.8%
Taylor expanded in y around inf 88.8%
if 1.3e9 < z Initial program 70.7%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in y around 0 64.8%
mul-1-neg64.8%
associate-/l*92.7%
distribute-rgt-neg-in92.7%
distribute-neg-frac292.7%
neg-sub092.7%
sub-neg92.7%
+-commutative92.7%
associate--r+92.7%
neg-sub092.7%
remove-double-neg92.7%
Simplified92.7%
clear-num92.6%
un-div-inv92.7%
Applied egg-rr92.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.4e-18)
(+ x (* t (/ z (- z a))))
(if (<= z 1550000000.0)
(+ x (* y (/ t (- a z))))
(+ x (/ t (/ (- z a) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e-18) {
tmp = x + (t * (z / (z - a)));
} else if (z <= 1550000000.0) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (t / ((z - 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.4d-18)) then
tmp = x + (t * (z / (z - a)))
else if (z <= 1550000000.0d0) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (t / ((z - 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.4e-18) {
tmp = x + (t * (z / (z - a)));
} else if (z <= 1550000000.0) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (t / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.4e-18: tmp = x + (t * (z / (z - a))) elif z <= 1550000000.0: tmp = x + (y * (t / (a - z))) else: tmp = x + (t / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.4e-18) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); elseif (z <= 1550000000.0) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(t / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.4e-18) tmp = x + (t * (z / (z - a))); elseif (z <= 1550000000.0) tmp = x + (y * (t / (a - z))); else tmp = x + (t / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.4e-18], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1550000000.0], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-18}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 1550000000:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if z < -2.39999999999999994e-18Initial program 73.3%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in y around 0 68.3%
mul-1-neg68.3%
associate-/l*89.9%
distribute-rgt-neg-in89.9%
distribute-neg-frac289.9%
neg-sub089.9%
sub-neg89.9%
+-commutative89.9%
associate--r+89.9%
neg-sub089.9%
remove-double-neg89.9%
Simplified89.9%
if -2.39999999999999994e-18 < z < 1.55e9Initial program 97.8%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in y around inf 88.4%
if 1.55e9 < z Initial program 70.7%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in y around 0 64.8%
mul-1-neg64.8%
associate-/l*92.7%
distribute-rgt-neg-in92.7%
distribute-neg-frac292.7%
neg-sub092.7%
sub-neg92.7%
+-commutative92.7%
associate--r+92.7%
neg-sub092.7%
remove-double-neg92.7%
Simplified92.7%
clear-num92.6%
un-div-inv92.7%
Applied egg-rr92.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6e-51) (not (<= z 5.2e-87))) (+ t x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6e-51) || !(z <= 5.2e-87)) {
tmp = t + x;
} 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 <= (-6d-51)) .or. (.not. (z <= 5.2d-87))) then
tmp = t + x
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 <= -6e-51) || !(z <= 5.2e-87)) {
tmp = t + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6e-51) or not (z <= 5.2e-87): tmp = t + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6e-51) || !(z <= 5.2e-87)) tmp = Float64(t + x); 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 <= -6e-51) || ~((z <= 5.2e-87))) tmp = t + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6e-51], N[Not[LessEqual[z, 5.2e-87]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-51} \lor \neg \left(z \leq 5.2 \cdot 10^{-87}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -6.00000000000000005e-51 or 5.20000000000000005e-87 < z Initial program 76.7%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around inf 74.8%
if -6.00000000000000005e-51 < z < 5.20000000000000005e-87Initial program 97.3%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in z around 0 77.4%
associate-/l*74.4%
Simplified74.4%
clear-num74.5%
un-div-inv75.3%
Applied egg-rr75.3%
associate-/r/77.8%
Simplified77.8%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5e-51) (not (<= z 5.2e-87))) (+ t x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5e-51) || !(z <= 5.2e-87)) {
tmp = t + x;
} 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 <= (-5d-51)) .or. (.not. (z <= 5.2d-87))) then
tmp = t + x
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 <= -5e-51) || !(z <= 5.2e-87)) {
tmp = t + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5e-51) or not (z <= 5.2e-87): tmp = t + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5e-51) || !(z <= 5.2e-87)) tmp = Float64(t + x); 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 <= -5e-51) || ~((z <= 5.2e-87))) tmp = t + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5e-51], N[Not[LessEqual[z, 5.2e-87]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-51} \lor \neg \left(z \leq 5.2 \cdot 10^{-87}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -5.00000000000000004e-51 or 5.20000000000000005e-87 < z Initial program 76.7%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around inf 74.8%
if -5.00000000000000004e-51 < z < 5.20000000000000005e-87Initial program 97.3%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in z around 0 77.4%
associate-/l*74.4%
Simplified74.4%
Final simplification74.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.5%
associate-/l*95.9%
Simplified95.9%
(FPCore (x y z t a) :precision binary64 (if (<= a 6e+149) (+ t x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 6e+149) {
tmp = t + x;
} 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 <= 6d+149) then
tmp = t + x
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 <= 6e+149) {
tmp = t + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 6e+149: tmp = t + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 6e+149) tmp = Float64(t + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 6e+149) tmp = t + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 6e+149], N[(t + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 6 \cdot 10^{+149}:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 6.00000000000000007e149Initial program 86.6%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in z around inf 62.3%
if 6.00000000000000007e149 < a Initial program 75.9%
+-commutative75.9%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around 0 68.5%
Final simplification63.0%
(FPCore (x y z t a) :precision binary64 (if (<= z 2.7e+213) x t))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 2.7e+213) {
tmp = x;
} else {
tmp = 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 <= 2.7d+213) then
tmp = x
else
tmp = 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 <= 2.7e+213) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 2.7e+213: tmp = x else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 2.7e+213) tmp = x; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 2.7e+213) tmp = x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 2.7e+213], x, t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.7 \cdot 10^{+213}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if z < 2.7000000000000001e213Initial program 90.0%
+-commutative90.0%
associate-/l*95.9%
fma-define95.9%
Simplified95.9%
Taylor expanded in t around 0 50.6%
if 2.7000000000000001e213 < z Initial program 45.4%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in z around inf 94.8%
Taylor expanded in x around 0 68.6%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return 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 = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 85.5%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in z around inf 59.3%
Taylor expanded in x around 0 20.3%
(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 2024180
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (if (< t -10682974490174067/10000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 312887599100691/80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t)))))
(+ x (/ (* (- y z) t) (- a z))))