
(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 8 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)) (t_2 (/ t_1 (- a z))))
(if (<= t_2 (- INFINITY))
(+ x (/ (- z y) (/ (- z a) t)))
(if (<= t_2 1e+261)
(- x (/ t_1 (- z a)))
(+ x (* (/ t (- z a)) (- z y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) * t;
double t_2 = t_1 / (a - z);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = x + ((z - y) / ((z - a) / t));
} else if (t_2 <= 1e+261) {
tmp = x - (t_1 / (z - a));
} else {
tmp = x + ((t / (z - a)) * (z - y));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) * t;
double t_2 = t_1 / (a - z);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = x + ((z - y) / ((z - a) / t));
} else if (t_2 <= 1e+261) {
tmp = x - (t_1 / (z - a));
} else {
tmp = x + ((t / (z - a)) * (z - y));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - z) * t t_2 = t_1 / (a - z) tmp = 0 if t_2 <= -math.inf: tmp = x + ((z - y) / ((z - a) / t)) elif t_2 <= 1e+261: tmp = x - (t_1 / (z - a)) else: tmp = x + ((t / (z - a)) * (z - y)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - z) * t) t_2 = Float64(t_1 / Float64(a - z)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(x + Float64(Float64(z - y) / Float64(Float64(z - a) / t))); elseif (t_2 <= 1e+261) tmp = Float64(x - Float64(t_1 / Float64(z - a))); else tmp = Float64(x + Float64(Float64(t / Float64(z - a)) * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - z) * t; t_2 = t_1 / (a - z); tmp = 0.0; if (t_2 <= -Inf) tmp = x + ((z - y) / ((z - a) / t)); elseif (t_2 <= 1e+261) tmp = x - (t_1 / (z - a)); else tmp = x + ((t / (z - a)) * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(x + N[(N[(z - y), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+261], N[(x - N[(t$95$1 / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
t_2 := \frac{t\_1}{a - z}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;x + \frac{z - y}{\frac{z - a}{t}}\\
\mathbf{elif}\;t\_2 \leq 10^{+261}:\\
\;\;\;\;x - \frac{t\_1}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{z - a} \cdot \left(z - y\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0Initial program 30.8%
associate-/l*99.9%
Simplified99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 9.9999999999999993e260Initial program 99.4%
if 9.9999999999999993e260 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 34.9%
associate-/l*99.9%
Simplified99.9%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- y z) t)) (t_2 (/ t_1 (- a z))))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 1e+261)))
(+ x (* (/ t (- z a)) (- z y)))
(- x (/ t_1 (- z a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) * t;
double t_2 = t_1 / (a - z);
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 1e+261)) {
tmp = x + ((t / (z - a)) * (z - y));
} else {
tmp = x - (t_1 / (z - a));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y - z) * t;
double t_2 = t_1 / (a - z);
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 1e+261)) {
tmp = x + ((t / (z - a)) * (z - y));
} else {
tmp = x - (t_1 / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - z) * t t_2 = t_1 / (a - z) tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 1e+261): tmp = x + ((t / (z - a)) * (z - y)) else: tmp = x - (t_1 / (z - a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - z) * t) t_2 = Float64(t_1 / Float64(a - z)) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 1e+261)) tmp = Float64(x + Float64(Float64(t / Float64(z - a)) * Float64(z - y))); else tmp = Float64(x - Float64(t_1 / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - z) * t; t_2 = t_1 / (a - z); tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 1e+261))) tmp = x + ((t / (z - a)) * (z - y)); else tmp = x - (t_1 / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 1e+261]], $MachinePrecision]], N[(x + N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t$95$1 / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
t_2 := \frac{t\_1}{a - z}\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 10^{+261}\right):\\
\;\;\;\;x + \frac{t}{z - a} \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t\_1}{z - a}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0 or 9.9999999999999993e260 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 32.7%
associate-/l*99.9%
Simplified99.9%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 9.9999999999999993e260Initial program 99.4%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.6e+143) (not (<= z 1.05e+154))) (+ t x) (- x (* t (/ y (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.6e+143) || !(z <= 1.05e+154)) {
tmp = t + x;
} else {
tmp = x - (t * (y / (z - 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 <= (-6.6d+143)) .or. (.not. (z <= 1.05d+154))) then
tmp = t + x
else
tmp = x - (t * (y / (z - 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 <= -6.6e+143) || !(z <= 1.05e+154)) {
tmp = t + x;
} else {
tmp = x - (t * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.6e+143) or not (z <= 1.05e+154): tmp = t + x else: tmp = x - (t * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.6e+143) || !(z <= 1.05e+154)) tmp = Float64(t + x); else tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6.6e+143) || ~((z <= 1.05e+154))) tmp = t + x; else tmp = x - (t * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.6e+143], N[Not[LessEqual[z, 1.05e+154]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+143} \lor \neg \left(z \leq 1.05 \cdot 10^{+154}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if z < -6.6e143 or 1.04999999999999997e154 < z Initial program 67.6%
associate-/l*93.7%
Simplified93.7%
Taylor expanded in z around inf 97.0%
if -6.6e143 < z < 1.04999999999999997e154Initial program 93.0%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in y around inf 84.4%
associate-/l*87.5%
Simplified87.5%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (<= y -1e+62) (- x (* t (/ y (- z a)))) (if (<= y 7.2e+51) (+ x (* t (/ z (- z a)))) (- x (/ y (/ (- z a) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1e+62) {
tmp = x - (t * (y / (z - a)));
} else if (y <= 7.2e+51) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x - (y / ((z - 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 (y <= (-1d+62)) then
tmp = x - (t * (y / (z - a)))
else if (y <= 7.2d+51) then
tmp = x + (t * (z / (z - a)))
else
tmp = x - (y / ((z - 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 (y <= -1e+62) {
tmp = x - (t * (y / (z - a)));
} else if (y <= 7.2e+51) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x - (y / ((z - a) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1e+62: tmp = x - (t * (y / (z - a))) elif y <= 7.2e+51: tmp = x + (t * (z / (z - a))) else: tmp = x - (y / ((z - a) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1e+62) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); elseif (y <= 7.2e+51) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); else tmp = Float64(x - Float64(y / Float64(Float64(z - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1e+62) tmp = x - (t * (y / (z - a))); elseif (y <= 7.2e+51) tmp = x + (t * (z / (z - a))); else tmp = x - (y / ((z - a) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1e+62], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+51], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+62}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+51}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{z - a}{t}}\\
\end{array}
\end{array}
if y < -1.00000000000000004e62Initial program 90.2%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in y around inf 88.5%
associate-/l*95.6%
Simplified95.6%
if -1.00000000000000004e62 < y < 7.20000000000000022e51Initial program 85.4%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in y around 0 77.1%
mul-1-neg77.1%
unsub-neg77.1%
associate-/l*90.3%
Simplified90.3%
if 7.20000000000000022e51 < y Initial program 87.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 87.8%
div-inv87.7%
*-commutative87.7%
associate-*l*97.3%
div-inv97.3%
clear-num97.5%
div-inv97.5%
add-cube-cbrt96.9%
*-un-lft-identity96.9%
times-frac96.9%
pow296.9%
Applied egg-rr96.9%
/-rgt-identity96.9%
associate-*r/96.9%
unpow296.9%
rem-3cbrt-lft97.5%
Simplified97.5%
Final simplification92.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.5e-22) (not (<= a 2.9e-131))) (+ x (* t (/ y a))) (+ t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.5e-22) || !(a <= 2.9e-131)) {
tmp = x + (t * (y / a));
} 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 ((a <= (-1.5d-22)) .or. (.not. (a <= 2.9d-131))) then
tmp = x + (t * (y / a))
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 ((a <= -1.5e-22) || !(a <= 2.9e-131)) {
tmp = x + (t * (y / a));
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.5e-22) or not (a <= 2.9e-131): tmp = x + (t * (y / a)) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.5e-22) || !(a <= 2.9e-131)) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.5e-22) || ~((a <= 2.9e-131))) tmp = x + (t * (y / a)); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.5e-22], N[Not[LessEqual[a, 2.9e-131]], $MachinePrecision]], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.5 \cdot 10^{-22} \lor \neg \left(a \leq 2.9 \cdot 10^{-131}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if a < -1.5e-22 or 2.9000000000000002e-131 < a Initial program 89.4%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in z around 0 78.4%
associate-/l*81.0%
Simplified81.0%
if -1.5e-22 < a < 2.9000000000000002e-131Initial program 82.4%
associate-/l*91.8%
Simplified91.8%
Taylor expanded in z around inf 81.9%
Final simplification81.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -5.5e+63) x (if (<= a 3.4e+79) (+ t x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.5e+63) {
tmp = x;
} else if (a <= 3.4e+79) {
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 <= (-5.5d+63)) then
tmp = x
else if (a <= 3.4d+79) 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 <= -5.5e+63) {
tmp = x;
} else if (a <= 3.4e+79) {
tmp = t + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.5e+63: tmp = x elif a <= 3.4e+79: tmp = t + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.5e+63) tmp = x; elseif (a <= 3.4e+79) 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 <= -5.5e+63) tmp = x; elseif (a <= 3.4e+79) tmp = t + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.5e+63], x, If[LessEqual[a, 3.4e+79], N[(t + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{+63}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{+79}:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -5.50000000000000004e63 or 3.40000000000000032e79 < a Initial program 89.3%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in x around inf 69.6%
if -5.50000000000000004e63 < a < 3.40000000000000032e79Initial program 85.4%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in z around inf 70.9%
Final simplification70.4%
(FPCore (x y z t a) :precision binary64 (+ x (* (/ t (- z a)) (- z y))))
double code(double x, double y, double z, double t, double a) {
return x + ((t / (z - a)) * (z - y));
}
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 / (z - a)) * (z - y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((t / (z - a)) * (z - y));
}
def code(x, y, z, t, a): return x + ((t / (z - a)) * (z - y))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(t / Float64(z - a)) * Float64(z - y))) end
function tmp = code(x, y, z, t, a) tmp = x + ((t / (z - a)) * (z - y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{t}{z - a} \cdot \left(z - y\right)
\end{array}
Initial program 86.9%
associate-/l*94.7%
Simplified94.7%
Final simplification94.7%
(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 86.9%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in x around inf 60.0%
Final simplification60.0%
(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 2024055
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(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))))