
(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 (/ (- 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 89.3%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in y around 0 88.8%
associate-*r/88.8%
mul-1-neg88.8%
distribute-rgt-neg-out88.8%
associate-*l/91.2%
associate-*l/94.1%
distribute-lft-in95.0%
+-commutative95.0%
sub-neg95.0%
associate-*l/89.3%
associate-*r/98.8%
Simplified98.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.7e-32) (not (<= a 2.9e+49))) (- x (* t (/ (- z y) a))) (+ x (* t (/ (- z y) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.7e-32) || !(a <= 2.9e+49)) {
tmp = x - (t * ((z - y) / a));
} else {
tmp = x + (t * ((z - y) / 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 ((a <= (-4.7d-32)) .or. (.not. (a <= 2.9d+49))) then
tmp = x - (t * ((z - y) / a))
else
tmp = x + (t * ((z - y) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.7e-32) || !(a <= 2.9e+49)) {
tmp = x - (t * ((z - y) / a));
} else {
tmp = x + (t * ((z - y) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4.7e-32) or not (a <= 2.9e+49): tmp = x - (t * ((z - y) / a)) else: tmp = x + (t * ((z - y) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.7e-32) || !(a <= 2.9e+49)) tmp = Float64(x - Float64(t * Float64(Float64(z - y) / a))); else tmp = Float64(x + Float64(t * Float64(Float64(z - y) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -4.7e-32) || ~((a <= 2.9e+49))) tmp = x - (t * ((z - y) / a)); else tmp = x + (t * ((z - y) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.7e-32], N[Not[LessEqual[a, 2.9e+49]], $MachinePrecision]], N[(x - N[(t * N[(N[(z - y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.7 \cdot 10^{-32} \lor \neg \left(a \leq 2.9 \cdot 10^{+49}\right):\\
\;\;\;\;x - t \cdot \frac{z - y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{z - y}{z}\\
\end{array}
\end{array}
if a < -4.70000000000000019e-32 or 2.9e49 < a Initial program 85.4%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in y around 0 85.2%
associate-*r/85.2%
mul-1-neg85.2%
distribute-rgt-neg-out85.2%
associate-*l/89.6%
associate-*l/95.9%
distribute-lft-in95.9%
+-commutative95.9%
sub-neg95.9%
associate-*l/85.4%
associate-*r/99.1%
Simplified99.1%
Taylor expanded in a around inf 79.5%
+-commutative79.5%
associate-/l*87.9%
Simplified87.9%
if -4.70000000000000019e-32 < a < 2.9e49Initial program 92.9%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in a around 0 81.3%
mul-1-neg81.3%
unsub-neg81.3%
associate-/l*88.3%
Simplified88.3%
Final simplification88.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -58.0) (not (<= y 2.4e-150))) (+ x (* t (/ y (- a z)))) (- x (* z (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -58.0) || !(y <= 2.4e-150)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x - (z * (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 ((y <= (-58.0d0)) .or. (.not. (y <= 2.4d-150))) then
tmp = x + (t * (y / (a - z)))
else
tmp = x - (z * (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 ((y <= -58.0) || !(y <= 2.4e-150)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x - (z * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -58.0) or not (y <= 2.4e-150): tmp = x + (t * (y / (a - z))) else: tmp = x - (z * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -58.0) || !(y <= 2.4e-150)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x - Float64(z * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -58.0) || ~((y <= 2.4e-150))) tmp = x + (t * (y / (a - z))); else tmp = x - (z * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -58.0], N[Not[LessEqual[y, 2.4e-150]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -58 \lor \neg \left(y \leq 2.4 \cdot 10^{-150}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if y < -58 or 2.4e-150 < y Initial program 88.5%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in y around inf 83.1%
associate-/l*86.5%
Simplified86.5%
if -58 < y < 2.4e-150Initial program 90.6%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in y around 0 85.0%
associate-*r/85.0%
mul-1-neg85.0%
distribute-rgt-neg-out85.0%
associate-*l/90.5%
*-commutative90.5%
distribute-lft-neg-out90.5%
distribute-rgt-neg-in90.5%
distribute-frac-neg290.5%
neg-sub090.5%
sub-neg90.5%
+-commutative90.5%
associate--r+90.5%
neg-sub090.5%
remove-double-neg90.5%
Simplified90.5%
Final simplification88.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1e-53) (not (<= y 4.2e-150))) (+ x (* t (/ y (- a z)))) (+ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1e-53) || !(y <= 4.2e-150)) {
tmp = x + (t * (y / (a - z)));
} 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 ((y <= (-1d-53)) .or. (.not. (y <= 4.2d-150))) then
tmp = x + (t * (y / (a - z)))
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 ((y <= -1e-53) || !(y <= 4.2e-150)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1e-53) or not (y <= 4.2e-150): tmp = x + (t * (y / (a - z))) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1e-53) || !(y <= 4.2e-150)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1e-53) || ~((y <= 4.2e-150))) tmp = x + (t * (y / (a - z))); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1e-53], N[Not[LessEqual[y, 4.2e-150]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-53} \lor \neg \left(y \leq 4.2 \cdot 10^{-150}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if y < -1.00000000000000003e-53 or 4.2000000000000002e-150 < y Initial program 89.2%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in y around inf 81.9%
associate-/l*85.1%
Simplified85.1%
if -1.00000000000000003e-53 < y < 4.2000000000000002e-150Initial program 89.5%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in z around inf 80.9%
Final simplification83.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9e-11) (not (<= z 2.9e-87))) (+ x t) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9e-11) || !(z <= 2.9e-87)) {
tmp = x + t;
} 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 <= (-9d-11)) .or. (.not. (z <= 2.9d-87))) then
tmp = x + t
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 <= -9e-11) || !(z <= 2.9e-87)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9e-11) or not (z <= 2.9e-87): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9e-11) || !(z <= 2.9e-87)) tmp = Float64(x + t); 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 <= -9e-11) || ~((z <= 2.9e-87))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9e-11], N[Not[LessEqual[z, 2.9e-87]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-11} \lor \neg \left(z \leq 2.9 \cdot 10^{-87}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -8.9999999999999999e-11 or 2.8999999999999999e-87 < z Initial program 83.0%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in z around inf 69.7%
if -8.9999999999999999e-11 < z < 2.8999999999999999e-87Initial program 97.3%
associate-/l*93.3%
Simplified93.3%
Taylor expanded in z around 0 81.2%
associate-/l*81.3%
Simplified81.3%
Final simplification74.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.85e+228) x (if (<= a 3.7e+171) (+ x t) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.85e+228) {
tmp = x;
} else if (a <= 3.7e+171) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-2.85d+228)) then
tmp = x
else if (a <= 3.7d+171) then
tmp = x + t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.85e+228) {
tmp = x;
} else if (a <= 3.7e+171) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.85e+228: tmp = x elif a <= 3.7e+171: tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.85e+228) tmp = x; elseif (a <= 3.7e+171) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.85e+228) tmp = x; elseif (a <= 3.7e+171) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.85e+228], x, If[LessEqual[a, 3.7e+171], N[(x + t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.85 \cdot 10^{+228}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.7 \cdot 10^{+171}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.8500000000000001e228 or 3.69999999999999998e171 < a Initial program 80.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 76.6%
if -2.8500000000000001e228 < a < 3.69999999999999998e171Initial program 91.4%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in z around inf 60.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -2.6e+154) (* t (- 1.0 (/ y z))) (+ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.6e+154) {
tmp = t * (1.0 - (y / z));
} 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 (y <= (-2.6d+154)) then
tmp = t * (1.0d0 - (y / z))
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 (y <= -2.6e+154) {
tmp = t * (1.0 - (y / z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.6e+154: tmp = t * (1.0 - (y / z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.6e+154) tmp = Float64(t * Float64(1.0 - Float64(y / z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.6e+154) tmp = t * (1.0 - (y / z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.6e+154], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+154}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if y < -2.59999999999999989e154Initial program 81.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 53.4%
mul-1-neg53.4%
unsub-neg53.4%
associate-/l*64.6%
Simplified64.6%
clear-num64.4%
un-div-inv64.5%
Applied egg-rr64.5%
associate-/r/64.6%
Simplified64.6%
Taylor expanded in t around inf 57.0%
if -2.59999999999999989e154 < y Initial program 90.2%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in z around inf 63.6%
(FPCore (x y z t a) :precision binary64 (if (<= x -6.5e-106) x (if (<= x 2.1e-267) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -6.5e-106) {
tmp = x;
} else if (x <= 2.1e-267) {
tmp = 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 (x <= (-6.5d-106)) then
tmp = x
else if (x <= 2.1d-267) then
tmp = 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 (x <= -6.5e-106) {
tmp = x;
} else if (x <= 2.1e-267) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -6.5e-106: tmp = x elif x <= 2.1e-267: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -6.5e-106) tmp = x; elseif (x <= 2.1e-267) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -6.5e-106) tmp = x; elseif (x <= 2.1e-267) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -6.5e-106], x, If[LessEqual[x, 2.1e-267], t, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{-106}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-267}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6.4999999999999997e-106 or 2.1000000000000001e-267 < x Initial program 89.6%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in x around inf 59.7%
if -6.4999999999999997e-106 < x < 2.1000000000000001e-267Initial program 88.0%
associate-/l*85.7%
Simplified85.7%
Taylor expanded in z around inf 40.9%
Taylor expanded in x around inf 33.7%
Taylor expanded in x around 0 36.8%
(FPCore (x y z t a) :precision binary64 (if (<= y -3e+157) (* t (/ y (- z))) (+ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3e+157) {
tmp = t * (y / -z);
} 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 (y <= (-3d+157)) then
tmp = t * (y / -z)
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 (y <= -3e+157) {
tmp = t * (y / -z);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3e+157: tmp = t * (y / -z) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3e+157) tmp = Float64(t * Float64(y / Float64(-z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3e+157) tmp = t * (y / -z); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3e+157], N[(t * N[(y / (-z)), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+157}:\\
\;\;\;\;t \cdot \frac{y}{-z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if y < -3.0000000000000001e157Initial program 81.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 53.4%
mul-1-neg53.4%
unsub-neg53.4%
associate-/l*64.6%
Simplified64.6%
Taylor expanded in y around inf 57.2%
associate-/l*62.9%
Simplified62.9%
Taylor expanded in x around 0 49.7%
mul-1-neg49.7%
associate-*r/55.4%
distribute-rgt-neg-out55.4%
distribute-frac-neg55.4%
Simplified55.4%
if -3.0000000000000001e157 < y Initial program 90.2%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in z around inf 63.6%
Final simplification62.8%
(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 89.3%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in z around inf 58.6%
Taylor expanded in x around inf 56.6%
Taylor expanded in x around 0 18.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 2024165
(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))))